@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.
@@ -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
- const meta = resolveMetadata(f);
8364
- const argSchema = argumentSpecsToSchema(f.argumentSpecs);
8365
- const argBytes = serializeSchema(argSchema);
8366
- const outputSchemaBytes = serializeSchema(f.defaultOutputSchema ?? schema2([]));
8367
- const requiredSecrets = (meta.requiredSecrets ?? []).map((secretType) => ({ secret_type: secretType, scope: null, secret_name: null }));
8368
- const derivedTags = {};
8369
- const tags = { ...derivedTags, ...meta.tags ?? {} };
8370
- return {
8371
- comment: null,
8372
- tags,
8373
- name: f.meta.name,
8374
- schema_name: name,
8375
- function_type: meta.functionType.toUpperCase(),
8376
- arguments: argBytes,
8377
- output_schema: outputSchemaBytes,
8378
- stability: meta.stability,
8379
- null_handling: meta.nullHandling,
8380
- description: meta.description,
8381
- examples: meta.examples.map((e) => ({
8382
- sql: e.sql,
8383
- description: e.description,
8384
- expected_output: null
8385
- })),
8386
- categories: meta.categories,
8387
- projection_pushdown: meta.projectionPushdown,
8388
- filter_pushdown: meta.filterPushdown,
8389
- sampling_pushdown: meta.samplingPushdown,
8390
- late_materialization: f.kind === "table" && f.meta.lateMaterialization === true ? true : null,
8391
- supported_expression_filters: meta.supportedExpressionFilters,
8392
- order_preservation: meta.preservesOrder,
8393
- max_workers: meta.maxWorkers ?? DEFAULT_MAX_WORKERS,
8394
- supports_batch_index: f.kind === "table_buffering" && f.meta.requiresInputBatchIndex === true || f.kind === "table" && f.meta.supportsBatchIndex === true,
8395
- partition_kind: f.kind === "table" && f.meta.partitionKind ? f.meta.partitionKind : "NOT_PARTITIONED",
8396
- order_dependent: meta.orderDependent,
8397
- distinct_dependent: meta.distinctDependent,
8398
- supports_window: false,
8399
- streaming_partitioned: false,
8400
- has_finalize: f.kind === "table_in_out" && f.meta.hasFinalize === true || f.kind === "table_buffering",
8401
- source_order_dependent: f.kind === "table_buffering" && f.meta.sourceOrderDependent === true,
8402
- sink_order_dependent: f.kind === "table_buffering" && f.meta.sinkOrderDependent === true,
8403
- requires_input_batch_index: f.kind === "table_buffering" && f.meta.requiresInputBatchIndex === true,
8404
- input_from_args: f.kind === "table_in_out" && f.meta.inputFromArgs === true,
8405
- required_settings: meta.requiredSettings,
8406
- required_secrets: requiredSecrets.map((s) => ({
8407
- secret_type: s.secret_type,
8408
- scope: s.scope,
8409
- secret_name: s.secret_name
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=938A6404CE5CDC7964756E2164756E21
9715
+ //# debugId=27B541E45B6B151B64756E2164756E21