@query-farm/vgi 0.23.0 → 0.24.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/catalog/descriptors.d.ts +18 -0
- package/dist/catalog/read-only.d.ts +20 -0
- package/dist/client-entry.js +5 -1
- package/dist/client-entry.js.map +5 -5
- package/dist/generated/vgi-client.d.ts +2 -0
- package/dist/index.js +79 -51
- package/dist/index.js.map +7 -7
- package/dist/serve-entry.js +5 -1
- package/dist/serve-entry.js.map +5 -5
- package/dist/worker-cf-entry.js +77 -52
- package/dist/worker-cf-entry.js.map +6 -6
- package/package.json +3 -3
- package/src/catalog/descriptors.ts +18 -0
- package/src/catalog/read-only.ts +51 -2
- package/src/client/client.ts +4 -0
- package/src/generated/vgi-client.ts +3 -1
- package/src/generated/vgi-protocol-schemas.ts +3 -1
- package/src/protocol/handlers/catalog/admin.ts +6 -0
|
@@ -322,6 +322,8 @@ export interface CatalogAttachResult {
|
|
|
322
322
|
comment?: string | null;
|
|
323
323
|
tags: Record<string, string>;
|
|
324
324
|
supports_column_statistics: boolean;
|
|
325
|
+
global_functions: Uint8Array[];
|
|
326
|
+
global_function_prefix: string;
|
|
325
327
|
resolved_data_version?: string | null;
|
|
326
328
|
resolved_implementation_version?: string | null;
|
|
327
329
|
}
|
package/dist/index.js
CHANGED
|
@@ -6242,6 +6242,8 @@ var CatalogAttachResultSchema = schema2([
|
|
|
6242
6242
|
field2("comment", utf82(), true),
|
|
6243
6243
|
field2("tags", map2(field2("key", utf82(), false), field2("value", utf82(), true), false), false),
|
|
6244
6244
|
field2("supports_column_statistics", bool2(), false),
|
|
6245
|
+
field2("global_functions", list2(field2("item", binary2(), true)), false),
|
|
6246
|
+
field2("global_function_prefix", utf82(), false),
|
|
6245
6247
|
field2("resolved_data_version", utf82(), true),
|
|
6246
6248
|
field2("resolved_implementation_version", utf82(), true)
|
|
6247
6249
|
]);
|
|
@@ -7080,6 +7082,8 @@ class ReadOnlyCatalogInterface extends CatalogInterface {
|
|
|
7080
7082
|
comment: this._descriptor.comment ?? null,
|
|
7081
7083
|
tags: this._descriptor.tags ?? {},
|
|
7082
7084
|
supports_column_statistics: true,
|
|
7085
|
+
global_functions: this._globalFunctionInfos().map(encodeFunctionInfo),
|
|
7086
|
+
global_function_prefix: this._descriptor.globalFunctionPrefix ?? "",
|
|
7083
7087
|
resolved_data_version: null,
|
|
7084
7088
|
resolved_implementation_version: null
|
|
7085
7089
|
};
|
|
@@ -7266,56 +7270,76 @@ class ReadOnlyCatalogInterface extends CatalogInterface {
|
|
|
7266
7270
|
if (t === "AGGREGATE_FUNCTION")
|
|
7267
7271
|
return f.kind === "aggregate";
|
|
7268
7272
|
return true;
|
|
7269
|
-
}).map((f) =>
|
|
7270
|
-
|
|
7271
|
-
|
|
7272
|
-
|
|
7273
|
-
|
|
7274
|
-
|
|
7275
|
-
|
|
7276
|
-
|
|
7277
|
-
|
|
7278
|
-
|
|
7279
|
-
|
|
7280
|
-
|
|
7281
|
-
|
|
7282
|
-
|
|
7283
|
-
|
|
7284
|
-
|
|
7285
|
-
|
|
7286
|
-
|
|
7287
|
-
|
|
7288
|
-
|
|
7289
|
-
|
|
7290
|
-
|
|
7291
|
-
|
|
7292
|
-
|
|
7293
|
-
|
|
7294
|
-
|
|
7295
|
-
|
|
7296
|
-
|
|
7297
|
-
|
|
7298
|
-
|
|
7299
|
-
|
|
7300
|
-
|
|
7301
|
-
|
|
7302
|
-
|
|
7303
|
-
|
|
7304
|
-
|
|
7305
|
-
|
|
7306
|
-
|
|
7307
|
-
|
|
7308
|
-
|
|
7309
|
-
|
|
7310
|
-
|
|
7311
|
-
|
|
7312
|
-
|
|
7313
|
-
|
|
7314
|
-
|
|
7315
|
-
|
|
7316
|
-
|
|
7317
|
-
|
|
7318
|
-
|
|
7273
|
+
}).map((f) => this._functionToInfo(f, name));
|
|
7274
|
+
}
|
|
7275
|
+
_functionToInfo(f, name) {
|
|
7276
|
+
const meta = resolveMetadata(f);
|
|
7277
|
+
const argSchema = argumentSpecsToSchema(f.argumentSpecs);
|
|
7278
|
+
const argBytes = serializeSchema(argSchema);
|
|
7279
|
+
const outputSchemaBytes = serializeSchema(f.defaultOutputSchema ?? schema2([]));
|
|
7280
|
+
const requiredSecrets = (meta.requiredSecrets ?? []).map((secretType) => ({ secret_type: secretType, scope: null, secret_name: null }));
|
|
7281
|
+
const derivedTags = {};
|
|
7282
|
+
const tags = { ...derivedTags, ...meta.tags ?? {} };
|
|
7283
|
+
return {
|
|
7284
|
+
comment: null,
|
|
7285
|
+
tags,
|
|
7286
|
+
name: f.meta.name,
|
|
7287
|
+
schema_name: name,
|
|
7288
|
+
function_type: meta.functionType.toUpperCase(),
|
|
7289
|
+
arguments: argBytes,
|
|
7290
|
+
output_schema: outputSchemaBytes,
|
|
7291
|
+
stability: meta.stability,
|
|
7292
|
+
null_handling: meta.nullHandling,
|
|
7293
|
+
description: meta.description,
|
|
7294
|
+
examples: meta.examples.map((e) => ({
|
|
7295
|
+
sql: e.sql,
|
|
7296
|
+
description: e.description,
|
|
7297
|
+
expected_output: null
|
|
7298
|
+
})),
|
|
7299
|
+
categories: meta.categories,
|
|
7300
|
+
projection_pushdown: meta.projectionPushdown,
|
|
7301
|
+
filter_pushdown: meta.filterPushdown,
|
|
7302
|
+
sampling_pushdown: meta.samplingPushdown,
|
|
7303
|
+
late_materialization: f.kind === "table" && f.meta.lateMaterialization === true ? true : null,
|
|
7304
|
+
supported_expression_filters: meta.supportedExpressionFilters,
|
|
7305
|
+
order_preservation: meta.preservesOrder,
|
|
7306
|
+
max_workers: meta.maxWorkers ?? DEFAULT_MAX_WORKERS,
|
|
7307
|
+
supports_batch_index: f.kind === "table_buffering" && f.meta.requiresInputBatchIndex === true || f.kind === "table" && f.meta.supportsBatchIndex === true,
|
|
7308
|
+
partition_kind: f.kind === "table" && f.meta.partitionKind ? f.meta.partitionKind : "NOT_PARTITIONED",
|
|
7309
|
+
order_dependent: meta.orderDependent,
|
|
7310
|
+
distinct_dependent: meta.distinctDependent,
|
|
7311
|
+
supports_window: false,
|
|
7312
|
+
streaming_partitioned: false,
|
|
7313
|
+
has_finalize: f.kind === "table_in_out" && f.meta.hasFinalize === true || f.kind === "table_buffering",
|
|
7314
|
+
source_order_dependent: f.kind === "table_buffering" && f.meta.sourceOrderDependent === true,
|
|
7315
|
+
sink_order_dependent: f.kind === "table_buffering" && f.meta.sinkOrderDependent === true,
|
|
7316
|
+
requires_input_batch_index: f.kind === "table_buffering" && f.meta.requiresInputBatchIndex === true,
|
|
7317
|
+
input_from_args: f.kind === "table_in_out" && f.meta.inputFromArgs === true,
|
|
7318
|
+
required_settings: meta.requiredSettings,
|
|
7319
|
+
required_secrets: requiredSecrets.map((s) => ({
|
|
7320
|
+
secret_type: s.secret_type,
|
|
7321
|
+
scope: s.scope,
|
|
7322
|
+
secret_name: s.secret_name
|
|
7323
|
+
}))
|
|
7324
|
+
};
|
|
7325
|
+
}
|
|
7326
|
+
_globalFunctionInfos() {
|
|
7327
|
+
const globals = this._descriptor.globalFunctions ?? [];
|
|
7328
|
+
if (globals.length === 0)
|
|
7329
|
+
return [];
|
|
7330
|
+
const schemaOf = new Map;
|
|
7331
|
+
for (const sch of this._descriptor.schemas) {
|
|
7332
|
+
for (const fn of sch.functions ?? []) {
|
|
7333
|
+
if (!schemaOf.has(fn))
|
|
7334
|
+
schemaOf.set(fn, sch.name);
|
|
7335
|
+
}
|
|
7336
|
+
}
|
|
7337
|
+
return globals.map((fn) => {
|
|
7338
|
+
const schemaName = schemaOf.get(fn);
|
|
7339
|
+
if (schemaName === undefined) {
|
|
7340
|
+
throw new Error(`Catalog '${this._descriptor.name}': '${fn.meta.name}' is listed in ` + `globalFunctions but is not declared in any schema.`);
|
|
7341
|
+
}
|
|
7342
|
+
return this._functionToInfo(fn, schemaName);
|
|
7319
7343
|
});
|
|
7320
7344
|
}
|
|
7321
7345
|
schemaContentsMacros(attachOpaqueData, name, type, transactionOpaqueData) {
|
|
@@ -9845,6 +9869,8 @@ function registerCatalogAdminMethods(protocol, getCatalog, signingKey) {
|
|
|
9845
9869
|
comment: result.comment ?? null,
|
|
9846
9870
|
tags: result.tags ?? {},
|
|
9847
9871
|
supports_column_statistics: result.supports_column_statistics ?? true,
|
|
9872
|
+
global_functions: result.global_functions ?? [],
|
|
9873
|
+
global_function_prefix: result.global_function_prefix ?? "",
|
|
9848
9874
|
resolved_data_version: result.resolved_data_version ?? null,
|
|
9849
9875
|
resolved_implementation_version: result.resolved_implementation_version ?? null
|
|
9850
9876
|
}, CatalogAttachResultSchema);
|
|
@@ -11347,6 +11373,8 @@ class VgiClient {
|
|
|
11347
11373
|
comment: inner.comment ?? null,
|
|
11348
11374
|
tags: deserializeTags(inner.tags),
|
|
11349
11375
|
supports_column_statistics: inner.supports_column_statistics ?? false,
|
|
11376
|
+
global_functions: inner.global_functions ? (Array.isArray(inner.global_functions) ? inner.global_functions : [...inner.global_functions]).map(toUint8Array) : [],
|
|
11377
|
+
global_function_prefix: inner.global_function_prefix ?? "",
|
|
11350
11378
|
resolved_data_version: inner.resolved_data_version ?? null,
|
|
11351
11379
|
resolved_implementation_version: inner.resolved_implementation_version ?? null
|
|
11352
11380
|
};
|
|
@@ -12142,4 +12170,4 @@ export {
|
|
|
12142
12170
|
ArgumentValidationError
|
|
12143
12171
|
};
|
|
12144
12172
|
|
|
12145
|
-
//# debugId=
|
|
12173
|
+
//# debugId=F2B3478BD764EF8C64756E2164756E21
|