@query-farm/vgi 0.23.0 → 0.24.1
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 +6 -3
- package/scripts/postinstall.cjs +47 -0
- 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
package/dist/worker-cf-entry.js
CHANGED
|
@@ -3381,6 +3381,8 @@ var CatalogAttachResultSchema = schema2([
|
|
|
3381
3381
|
field2("comment", utf82(), true),
|
|
3382
3382
|
field2("tags", map2(field2("key", utf82(), false), field2("value", utf82(), true), false), false),
|
|
3383
3383
|
field2("supports_column_statistics", bool2(), false),
|
|
3384
|
+
field2("global_functions", list2(field2("item", binary2(), true)), false),
|
|
3385
|
+
field2("global_function_prefix", utf82(), false),
|
|
3384
3386
|
field2("resolved_data_version", utf82(), true),
|
|
3385
3387
|
field2("resolved_implementation_version", utf82(), true)
|
|
3386
3388
|
]);
|
|
@@ -6483,7 +6485,6 @@ var encodeMacroInfo = (v) => encodeASD(MacroInfoSchema, v);
|
|
|
6483
6485
|
var encodeSchemaInfo = (v) => encodeASD(SchemaInfoSchema, v);
|
|
6484
6486
|
var encodeTableInfo = (v) => encodeASD(TableInfoSchema, v);
|
|
6485
6487
|
var encodeViewInfo = (v) => encodeASD(ViewInfoSchema, v);
|
|
6486
|
-
|
|
6487
6488
|
// src/catalog/interface.ts
|
|
6488
6489
|
var encodeCopyFromFormatInfo = (v) => encodeASD(CopyFromFormatInfoSchema, {
|
|
6489
6490
|
comment: v.comment ?? null,
|
|
@@ -6689,6 +6690,8 @@ function registerCatalogAdminMethods(protocol, getCatalog, signingKey) {
|
|
|
6689
6690
|
comment: result.comment ?? null,
|
|
6690
6691
|
tags: result.tags ?? {},
|
|
6691
6692
|
supports_column_statistics: result.supports_column_statistics ?? true,
|
|
6693
|
+
global_functions: result.global_functions ?? [],
|
|
6694
|
+
global_function_prefix: result.global_function_prefix ?? "",
|
|
6692
6695
|
resolved_data_version: result.resolved_data_version ?? null,
|
|
6693
6696
|
resolved_implementation_version: result.resolved_implementation_version ?? null
|
|
6694
6697
|
}, CatalogAttachResultSchema);
|
|
@@ -8173,6 +8176,8 @@ class ReadOnlyCatalogInterface extends CatalogInterface {
|
|
|
8173
8176
|
comment: this._descriptor.comment ?? null,
|
|
8174
8177
|
tags: this._descriptor.tags ?? {},
|
|
8175
8178
|
supports_column_statistics: true,
|
|
8179
|
+
global_functions: this._globalFunctionInfos().map(encodeFunctionInfo),
|
|
8180
|
+
global_function_prefix: this._descriptor.globalFunctionPrefix ?? "",
|
|
8176
8181
|
resolved_data_version: null,
|
|
8177
8182
|
resolved_implementation_version: null
|
|
8178
8183
|
};
|
|
@@ -8359,56 +8364,76 @@ class ReadOnlyCatalogInterface extends CatalogInterface {
|
|
|
8359
8364
|
if (t === "AGGREGATE_FUNCTION")
|
|
8360
8365
|
return f.kind === "aggregate";
|
|
8361
8366
|
return true;
|
|
8362
|
-
}).map((f) =>
|
|
8363
|
-
|
|
8364
|
-
|
|
8365
|
-
|
|
8366
|
-
|
|
8367
|
-
|
|
8368
|
-
|
|
8369
|
-
|
|
8370
|
-
|
|
8371
|
-
|
|
8372
|
-
|
|
8373
|
-
|
|
8374
|
-
|
|
8375
|
-
|
|
8376
|
-
|
|
8377
|
-
|
|
8378
|
-
|
|
8379
|
-
|
|
8380
|
-
|
|
8381
|
-
|
|
8382
|
-
|
|
8383
|
-
|
|
8384
|
-
|
|
8385
|
-
|
|
8386
|
-
|
|
8387
|
-
|
|
8388
|
-
|
|
8389
|
-
|
|
8390
|
-
|
|
8391
|
-
|
|
8392
|
-
|
|
8393
|
-
|
|
8394
|
-
|
|
8395
|
-
|
|
8396
|
-
|
|
8397
|
-
|
|
8398
|
-
|
|
8399
|
-
|
|
8400
|
-
|
|
8401
|
-
|
|
8402
|
-
|
|
8403
|
-
|
|
8404
|
-
|
|
8405
|
-
|
|
8406
|
-
|
|
8407
|
-
|
|
8408
|
-
|
|
8409
|
-
|
|
8410
|
-
|
|
8411
|
-
|
|
8367
|
+
}).map((f) => this._functionToInfo(f, name));
|
|
8368
|
+
}
|
|
8369
|
+
_functionToInfo(f, name) {
|
|
8370
|
+
const meta = resolveMetadata(f);
|
|
8371
|
+
const argSchema = argumentSpecsToSchema(f.argumentSpecs);
|
|
8372
|
+
const argBytes = serializeSchema(argSchema);
|
|
8373
|
+
const outputSchemaBytes = serializeSchema(f.defaultOutputSchema ?? schema2([]));
|
|
8374
|
+
const requiredSecrets = (meta.requiredSecrets ?? []).map((secretType) => ({ secret_type: secretType, scope: null, secret_name: null }));
|
|
8375
|
+
const derivedTags = {};
|
|
8376
|
+
const tags = { ...derivedTags, ...meta.tags ?? {} };
|
|
8377
|
+
return {
|
|
8378
|
+
comment: null,
|
|
8379
|
+
tags,
|
|
8380
|
+
name: f.meta.name,
|
|
8381
|
+
schema_name: name,
|
|
8382
|
+
function_type: meta.functionType.toUpperCase(),
|
|
8383
|
+
arguments: argBytes,
|
|
8384
|
+
output_schema: outputSchemaBytes,
|
|
8385
|
+
stability: meta.stability,
|
|
8386
|
+
null_handling: meta.nullHandling,
|
|
8387
|
+
description: meta.description,
|
|
8388
|
+
examples: meta.examples.map((e) => ({
|
|
8389
|
+
sql: e.sql,
|
|
8390
|
+
description: e.description,
|
|
8391
|
+
expected_output: null
|
|
8392
|
+
})),
|
|
8393
|
+
categories: meta.categories,
|
|
8394
|
+
projection_pushdown: meta.projectionPushdown,
|
|
8395
|
+
filter_pushdown: meta.filterPushdown,
|
|
8396
|
+
sampling_pushdown: meta.samplingPushdown,
|
|
8397
|
+
late_materialization: f.kind === "table" && f.meta.lateMaterialization === true ? true : null,
|
|
8398
|
+
supported_expression_filters: meta.supportedExpressionFilters,
|
|
8399
|
+
order_preservation: meta.preservesOrder,
|
|
8400
|
+
max_workers: meta.maxWorkers ?? DEFAULT_MAX_WORKERS,
|
|
8401
|
+
supports_batch_index: f.kind === "table_buffering" && f.meta.requiresInputBatchIndex === true || f.kind === "table" && f.meta.supportsBatchIndex === true,
|
|
8402
|
+
partition_kind: f.kind === "table" && f.meta.partitionKind ? f.meta.partitionKind : "NOT_PARTITIONED",
|
|
8403
|
+
order_dependent: meta.orderDependent,
|
|
8404
|
+
distinct_dependent: meta.distinctDependent,
|
|
8405
|
+
supports_window: false,
|
|
8406
|
+
streaming_partitioned: false,
|
|
8407
|
+
has_finalize: f.kind === "table_in_out" && f.meta.hasFinalize === true || f.kind === "table_buffering",
|
|
8408
|
+
source_order_dependent: f.kind === "table_buffering" && f.meta.sourceOrderDependent === true,
|
|
8409
|
+
sink_order_dependent: f.kind === "table_buffering" && f.meta.sinkOrderDependent === true,
|
|
8410
|
+
requires_input_batch_index: f.kind === "table_buffering" && f.meta.requiresInputBatchIndex === true,
|
|
8411
|
+
input_from_args: f.kind === "table_in_out" && f.meta.inputFromArgs === true,
|
|
8412
|
+
required_settings: meta.requiredSettings,
|
|
8413
|
+
required_secrets: requiredSecrets.map((s) => ({
|
|
8414
|
+
secret_type: s.secret_type,
|
|
8415
|
+
scope: s.scope,
|
|
8416
|
+
secret_name: s.secret_name
|
|
8417
|
+
}))
|
|
8418
|
+
};
|
|
8419
|
+
}
|
|
8420
|
+
_globalFunctionInfos() {
|
|
8421
|
+
const globals = this._descriptor.globalFunctions ?? [];
|
|
8422
|
+
if (globals.length === 0)
|
|
8423
|
+
return [];
|
|
8424
|
+
const schemaOf = new Map;
|
|
8425
|
+
for (const sch of this._descriptor.schemas) {
|
|
8426
|
+
for (const fn of sch.functions ?? []) {
|
|
8427
|
+
if (!schemaOf.has(fn))
|
|
8428
|
+
schemaOf.set(fn, sch.name);
|
|
8429
|
+
}
|
|
8430
|
+
}
|
|
8431
|
+
return globals.map((fn) => {
|
|
8432
|
+
const schemaName = schemaOf.get(fn);
|
|
8433
|
+
if (schemaName === undefined) {
|
|
8434
|
+
throw new Error(`Catalog '${this._descriptor.name}': '${fn.meta.name}' is listed in ` + `globalFunctions but is not declared in any schema.`);
|
|
8435
|
+
}
|
|
8436
|
+
return this._functionToInfo(fn, schemaName);
|
|
8412
8437
|
});
|
|
8413
8438
|
}
|
|
8414
8439
|
schemaContentsMacros(attachOpaqueData, name, type, transactionOpaqueData) {
|
|
@@ -9687,4 +9712,4 @@ export {
|
|
|
9687
9712
|
Arguments
|
|
9688
9713
|
};
|
|
9689
9714
|
|
|
9690
|
-
//# debugId=
|
|
9715
|
+
//# debugId=27B541E45B6B151B64756E2164756E21
|