@query-farm/vgi 0.28.0 → 0.29.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.
Files changed (121) hide show
  1. package/README.md +52 -8
  2. package/dist/arguments/argument-spec.d.ts +57 -2
  3. package/dist/arrow/impl-arrowjs/index.d.ts +1 -1
  4. package/dist/arrow/impl-arrowjs/iterate.d.ts +10 -1
  5. package/dist/arrow/impl-arrowjs/schema.d.ts +2 -0
  6. package/dist/arrow/impl-flechette/index.d.ts +1 -1
  7. package/dist/arrow/impl-flechette/iterate.d.ts +10 -1
  8. package/dist/arrow/impl-flechette/schema.d.ts +2 -0
  9. package/dist/arrow/index.d.ts +1 -1
  10. package/dist/arrow/schema-types.d.ts +3 -1
  11. package/dist/arrow/types.d.ts +39 -3
  12. package/dist/catalog/composite.d.ts +13 -13
  13. package/dist/catalog/descriptors.d.ts +7 -3
  14. package/dist/catalog/interface.d.ts +108 -38
  15. package/dist/catalog/read-only.d.ts +32 -15
  16. package/dist/client/client.d.ts +37 -30
  17. package/dist/client/types.d.ts +2 -0
  18. package/dist/client-entry.d.ts +1 -1
  19. package/dist/client-entry.js +791 -447
  20. package/dist/client-entry.js.map +18 -17
  21. package/dist/filter-pushdown/capabilities.d.ts +3 -0
  22. package/dist/filter-pushdown/deserialize.d.ts +14 -15
  23. package/dist/filter-pushdown/evaluate.d.ts +14 -44
  24. package/dist/filter-pushdown/index.d.ts +2 -2
  25. package/dist/filter-pushdown/types.d.ts +120 -68
  26. package/dist/functions/aggregate.d.ts +4 -0
  27. package/dist/functions/registry.d.ts +5 -5
  28. package/dist/functions/scalar.d.ts +6 -1
  29. package/dist/functions/table-buffering.d.ts +9 -0
  30. package/dist/functions/table-in-out.d.ts +13 -0
  31. package/dist/functions/table.d.ts +72 -2
  32. package/dist/functions/types.d.ts +60 -2
  33. package/dist/generated/vgi-client.d.ts +114 -26
  34. package/dist/generated/vgi-protocol-schemas.d.ts +34 -0
  35. package/dist/http/fetch.d.ts +16 -0
  36. package/dist/index.core.d.ts +4 -3
  37. package/dist/index.js +3396 -2064
  38. package/dist/index.js.map +55 -49
  39. package/dist/metadata/types.d.ts +15 -2
  40. package/dist/protocol/handlers/catalog/shared.d.ts +0 -8
  41. package/dist/protocol/handlers/function.d.ts +11 -0
  42. package/dist/protocol/handlers/shared.d.ts +3 -1
  43. package/dist/protocol/serializers/bind.d.ts +1 -2
  44. package/dist/protocol/serializers/cardinality.d.ts +1 -2
  45. package/dist/protocol/serializers/splits.d.ts +126 -0
  46. package/dist/protocol/types.d.ts +36 -3
  47. package/dist/request-auth.d.ts +28 -0
  48. package/dist/schema-path.d.ts +7 -0
  49. package/dist/serve-entry.d.ts +25 -0
  50. package/dist/serve-entry.js +1129 -569
  51. package/dist/serve-entry.js.map +36 -32
  52. package/dist/split-token.d.ts +88 -0
  53. package/dist/types.d.ts +8 -0
  54. package/dist/worker-cf-entry.js +2928 -1689
  55. package/dist/worker-cf-entry.js.map +51 -44
  56. package/dist/worker.d.ts +1 -1
  57. package/package.json +3 -3
  58. package/src/arguments/argument-spec.ts +93 -4
  59. package/src/arguments/arguments.ts +0 -1
  60. package/src/arrow/impl-arrowjs/index.ts +1 -1
  61. package/src/arrow/impl-arrowjs/iterate.ts +21 -0
  62. package/src/arrow/impl-arrowjs/schema.ts +4 -0
  63. package/src/arrow/impl-flechette/index.ts +1 -1
  64. package/src/arrow/impl-flechette/iterate.ts +24 -1
  65. package/src/arrow/impl-flechette/schema.ts +4 -0
  66. package/src/arrow/index.ts +1 -1
  67. package/src/arrow/schema-types.ts +4 -0
  68. package/src/arrow/types.ts +39 -3
  69. package/src/catalog/composite.ts +26 -26
  70. package/src/catalog/descriptors.ts +12 -3
  71. package/src/catalog/interface.ts +217 -72
  72. package/src/catalog/read-only.ts +141 -84
  73. package/src/client/client.ts +97 -73
  74. package/src/client/types.ts +2 -0
  75. package/src/client-entry.ts +2 -1
  76. package/src/filter-pushdown/capabilities.ts +13 -0
  77. package/src/filter-pushdown/collector.ts +22 -35
  78. package/src/filter-pushdown/deserialize.ts +657 -221
  79. package/src/filter-pushdown/evaluate.ts +410 -499
  80. package/src/filter-pushdown/index.ts +16 -2
  81. package/src/filter-pushdown/types.ts +88 -71
  82. package/src/functions/aggregate.ts +12 -1
  83. package/src/functions/copy-from.ts +2 -1
  84. package/src/functions/copy-to.ts +2 -1
  85. package/src/functions/registry.ts +24 -22
  86. package/src/functions/scalar.ts +37 -0
  87. package/src/functions/table-buffering.ts +48 -6
  88. package/src/functions/table-in-out.ts +194 -33
  89. package/src/functions/table.ts +187 -22
  90. package/src/functions/types.ts +64 -1
  91. package/src/generated/vgi-client.ts +122 -28
  92. package/src/generated/vgi-protocol-schemas.ts +455 -58
  93. package/src/http/fetch.ts +129 -2
  94. package/src/index.core.ts +4 -2
  95. package/src/metadata/resolve.ts +43 -1
  96. package/src/metadata/serialize.ts +43 -5
  97. package/src/metadata/types.ts +17 -1
  98. package/src/protocol/dispatch.ts +1 -1
  99. package/src/protocol/handlers/aggregate.ts +23 -12
  100. package/src/protocol/handlers/catalog/admin.ts +47 -54
  101. package/src/protocol/handlers/catalog/index_methods.ts +6 -13
  102. package/src/protocol/handlers/catalog/macro.ts +12 -20
  103. package/src/protocol/handlers/catalog/shared.ts +12 -57
  104. package/src/protocol/handlers/catalog/table.ts +49 -112
  105. package/src/protocol/handlers/catalog/view.ts +18 -22
  106. package/src/protocol/handlers/function.ts +311 -18
  107. package/src/protocol/handlers/shared.ts +12 -3
  108. package/src/protocol/handlers/table-buffering.ts +11 -8
  109. package/src/protocol/serializers/bind.ts +69 -67
  110. package/src/protocol/serializers/cardinality.ts +7 -7
  111. package/src/protocol/serializers/init.ts +52 -10
  112. package/src/protocol/serializers/splits.ts +221 -0
  113. package/src/protocol/state-serializer.ts +55 -1
  114. package/src/protocol/types.ts +36 -3
  115. package/src/request-auth.ts +73 -0
  116. package/src/schema-path.ts +25 -0
  117. package/src/serve-entry.ts +69 -2
  118. package/src/split-token.ts +297 -0
  119. package/src/types.ts +9 -0
  120. package/src/worker-cf-entry.ts +2 -1
  121. package/src/worker.ts +79 -14
@@ -3,6 +3,7 @@
3
3
  // Matching Python's vgi/catalog/catalog_interface.py
4
4
 
5
5
  import { CatalogReadOnlyError } from "../errors.js";
6
+ import { schemaPathsEqual } from "../schema-path.js";
6
7
 
7
8
  export type AttachOpaqueData = Uint8Array;
8
9
  export type TransactionOpaqueData = Uint8Array;
@@ -164,7 +165,7 @@ export const encodeAttachCatalogInfo = (v: AttachCatalogInfo): Uint8Array =>
164
165
  import { deserializeBatch, serializeBatch, batchFromColumns } from "../util/arrow/index.js";
165
166
  import { schema as schema_, field as field_, type VgiDataType, type VgiField } from "../arrow/index.js";
166
167
  import { toUint8Array } from "../util/bytes.js";
167
- import { ScanBranchSchema } from "../generated/vgi-protocol-schemas.js";
168
+ import { ScanBranchSchema, ScanFunctionResultSchema } from "../generated/vgi-protocol-schemas.js";
168
169
 
169
170
  /**
170
171
  * Result from `tableScanFunctionGet` — tells the VGI DuckDB extension which
@@ -179,15 +180,61 @@ export interface ScanFunctionResult {
179
180
  namedArguments: Record<string, unknown>;
180
181
  /** DuckDB extensions to load before calling the function. */
181
182
  requiredExtensions: string[];
183
+ /**
184
+ * Catalog schema path `functionName` is registered in (protocol 2.0.0). A function
185
+ * name is unique only within a schema, so a client that doesn't know this
186
+ * cannot tell which implementation a colliding name refers to — set it
187
+ * whenever the resolving code already knows the schema. `null` for a
188
+ * pre-1.5.0 peer, or when the resolved function is a native DuckDB function
189
+ * with no VGI-side schema of its own (e.g. `read_parquet`).
190
+ */
191
+ schemaPath: string[] | null;
192
+ }
193
+
194
+ /**
195
+ * Encode a ScanFunctionResult wire record — the single-row batch shape
196
+ * `{ function_name, arguments, required_extensions, schema_path }` that
197
+ * `catalog_table_scan_function_get` returns and that a function-backed table
198
+ * inlines into `TableInfo.scan_function`.
199
+ *
200
+ * It exists so there is exactly one place that names those columns. The
201
+ * inline-scan path used to restate the schema locally even though codegen
202
+ * emits it; a hand-written wire schema is how four SDKs ended up disagreeing
203
+ * about which columns were binary and which were large_binary.
204
+ *
205
+ * `argumentsBytes` is the already-serialized inner arguments batch (one column
206
+ * per argument: `arg_<index>` positional, bare name for named).
207
+ *
208
+ * `schemaPath` (protocol 2.0.0) identifies the schema that registers `functionName`;
209
+ * leave it null when the caller has no VGI-side schema to report.
210
+ */
211
+ export function encodeScanFunctionResult(
212
+ functionName: string,
213
+ argumentsBytes: Uint8Array,
214
+ requiredExtensions: string[] = [],
215
+ schemaPath: string[] | null = null,
216
+ ): Uint8Array {
217
+ return serializeBatch(
218
+ batchFromColumns(
219
+ {
220
+ function_name: [functionName],
221
+ arguments: [argumentsBytes],
222
+ required_extensions: [requiredExtensions],
223
+ schema_path: [schemaPath],
224
+ },
225
+ ScanFunctionResultSchema as any,
226
+ ),
227
+ );
182
228
  }
183
229
 
184
230
  /**
185
231
  * Decode a ScanFunctionResult from a wire-shape inner result dict.
186
232
  *
187
233
  * The wire shape (per ScanFunctionResultSchema) is
188
- * `{ function_name: utf8, arguments: binary, required_extensions: list<utf8> }`,
189
- * where `arguments` is a serialized single-row batch with one column per
190
- * argument: `arg_<index>` for positional args, the bare name for named args.
234
+ * `{ function_name: utf8, arguments: binary, required_extensions: list<utf8>,
235
+ * schema_path: list<utf8>? }`, where `arguments` is a serialized single-row batch
236
+ * with one column per argument: `arg_<index>` for positional args, the bare
237
+ * name for named args.
191
238
  */
192
239
  export function decodeScanFunctionResult(inner: Record<string, unknown>): ScanFunctionResult {
193
240
  const argsBytes = inner.arguments;
@@ -221,6 +268,13 @@ export function decodeScanFunctionResult(inner: Record<string, unknown>): ScanFu
221
268
  positionalArguments,
222
269
  namedArguments,
223
270
  requiredExtensions,
271
+ // Absent for a pre-1.5.0 peer — the column itself won't be on the wire in
272
+ // that case, which reads the same as "present but null".
273
+ schemaPath: inner.schema_path == null
274
+ ? null
275
+ : (Array.isArray(inner.schema_path) ? inner.schema_path : [...(inner.schema_path as Iterable<unknown>)])
276
+ .filter((value) => value != null)
277
+ .map(String),
224
278
  };
225
279
  }
226
280
 
@@ -235,26 +289,75 @@ export function decodeScanFunctionResult(inner: Record<string, unknown>): ScanFu
235
289
  * `ScanBranch` expects, so it passes through untouched.
236
290
  */
237
291
  export function singleBranchResult(
238
- legacy: { function_name: string; arguments: unknown; required_extensions?: string[] },
292
+ legacy: {
293
+ function_name: string;
294
+ arguments: unknown;
295
+ required_extensions?: string[];
296
+ schema_path?: string[] | null;
297
+ },
239
298
  ): { branches: Uint8Array[]; required_extensions: string[] } {
240
- const branchBatch = batchFromColumns(
241
- {
242
- function_name: [legacy.function_name],
243
- arguments: [toUint8Array(legacy.arguments)],
244
- branch_filter: [null],
245
- writable: [false],
246
- source_catalog: [null],
247
- source_schema: [null],
248
- source_table: [null],
249
- },
250
- ScanBranchSchema as any,
251
- );
252
299
  return {
253
- branches: [serializeBatch(branchBatch)],
300
+ branches: [
301
+ encodeScanBranch({
302
+ function_name: legacy.function_name,
303
+ arguments: toUint8Array(legacy.arguments),
304
+ // This shim has no independent way to know the function's own schema;
305
+ // propagate whatever `tableScanFunctionGet` already resolved rather
306
+ // than dropping a value the legacy response carries.
307
+ schema_path: legacy.schema_path ?? null,
308
+ }),
309
+ ],
254
310
  required_extensions: legacy.required_extensions ?? [],
255
311
  };
256
312
  }
257
313
 
314
+ /**
315
+ * The ONE place `ScanBranch`'s columns are named.
316
+ *
317
+ * Both branch builders used to carry their own copy of this key list, and both
318
+ * copies were missing `format_name` / `format_locations` after those fields
319
+ * were added to the schema. `format_locations` is a LIST, and Arrow's assembler
320
+ * dereferences a list's `children[0]` while writing, so the omission did not
321
+ * degrade anything — it killed every scan through those builders with
322
+ * "Cannot read properties of undefined (reading 'slice')", including tables
323
+ * that predated format branches entirely. One key list is the fix; the
324
+ * completeness test in src/__tests__ pins it against ScanBranchSchema.
325
+ *
326
+ * Every column the schema declares must appear here, null included.
327
+ */
328
+ function encodeScanBranch(cols: {
329
+ function_name: string;
330
+ arguments: Uint8Array;
331
+ branch_filter?: string | null;
332
+ writable?: boolean;
333
+ source_catalog?: string | null;
334
+ source_schema_path?: string[] | null;
335
+ source_table?: string | null;
336
+ format_name?: string | null;
337
+ format_locations?: string[] | null;
338
+ format_options?: Uint8Array | null;
339
+ schema_path?: string[] | null;
340
+ }): Uint8Array {
341
+ return serializeBatch(
342
+ batchFromColumns(
343
+ {
344
+ function_name: [cols.function_name],
345
+ arguments: [cols.arguments],
346
+ branch_filter: [cols.branch_filter ?? null],
347
+ writable: [cols.writable ?? false],
348
+ source_catalog: [cols.source_catalog ?? null],
349
+ source_schema_path: [cols.source_schema_path ?? null],
350
+ source_table: [cols.source_table ?? null],
351
+ format_name: [cols.format_name ?? null],
352
+ format_locations: [cols.format_locations ?? null],
353
+ format_options: [cols.format_options ?? null],
354
+ schema_path: [cols.schema_path ?? null],
355
+ },
356
+ ScanBranchSchema as any,
357
+ ),
358
+ );
359
+ }
360
+
258
361
  /**
259
362
  * One physical source backing a multi-branch scan, in the shape the
260
363
  * `buildScanBranchesResult` helper consumes. Mirrors vgi-python's
@@ -275,15 +378,38 @@ export interface ScanBranchInput {
275
378
  branchFilter?: string | null;
276
379
  /** Declares this branch as the INSERT target (at most one per table). */
277
380
  writable?: boolean;
381
+ /** Custom file FORMAT this branch reads, for a format-backed branch. */
382
+ formatName?: string | null;
383
+ /** Locations the format branch reads. */
384
+ formatLocations?: string[] | null;
385
+ /** Reader options for a format branch, as a 1-row IPC batch whose COLUMN
386
+ * NAMES are the option names — the same shape `arguments` uses, because an
387
+ * option value may be any Arrow type. These BECOME the reader's named
388
+ * arguments, so without them a format branch cannot pass its reader a
389
+ * delimiter, a header flag, or anything else. */
390
+ formatOptions?: Uint8Array | null;
278
391
  /**
279
392
  * Catalog-table branch (lakehouse federation): leave `functionName` empty and
280
393
  * set these to scan the base table
281
- * `sourceCatalog.sourceSchema.sourceTable` in a companion catalog instead of
394
+ * `sourceCatalog.sourceSchemaPath.sourceTable` in a companion catalog instead of
282
395
  * calling a table function.
283
396
  */
284
397
  sourceCatalog?: string | null;
285
- sourceSchema?: string | null;
398
+ sourceSchemaPath?: string[] | null;
286
399
  sourceTable?: string | null;
400
+ /**
401
+ * Function branch only — the catalog schema that registers `functionName`
402
+ * (protocol 2.0.0). Without it a client has to guess (the table's own
403
+ * schema, then the catalog's default schema) which implementation
404
+ * `functionName` refers to when the same name is registered in more than
405
+ * one schema. Leave unset for a catalog-table or FORMAT branch, and for a
406
+ * branch that delegates straight to a native DuckDB function
407
+ * (`read_parquet`, `read_csv_auto`, `iceberg_scan`, …) — neither has a
408
+ * VGI-side schema of its own to report, which is why the field is optional
409
+ * rather than required. Not to be confused with `sourceSchemaPath` above, which
410
+ * names a catalog-table branch's *source table's* schema.
411
+ */
412
+ schemaPath?: string[] | null;
287
413
  }
288
414
 
289
415
  /**
@@ -292,6 +418,26 @@ export interface ScanBranchInput {
292
418
  * positional args, the bare name for named args. Mirrors Python's
293
419
  * `ScanBranch.to_row_dict` argument handling.
294
420
  */
421
+ /**
422
+ * Encode a format branch's reader options.
423
+ *
424
+ * Same shape as a branch's `arguments` blob — a 1-row batch whose COLUMN NAMES
425
+ * are the option names — because an option value may be any Arrow type, so no
426
+ * static schema could describe the map. Exported because a worker building a
427
+ * format branch needs it and has no other way to produce those bytes.
428
+ */
429
+ export function encodeFormatOptions(
430
+ options: Record<string, { value: unknown; type: VgiDataType }>,
431
+ ): Uint8Array {
432
+ const fields: VgiField[] = [];
433
+ const values: Record<string, unknown[]> = {};
434
+ for (const [name, arg] of Object.entries(options)) {
435
+ fields.push(field_(name, arg.type, true));
436
+ values[name] = [arg.value];
437
+ }
438
+ return serializeBatch(batchFromColumns(values, schema_(fields)));
439
+ }
440
+
295
441
  function serializeBranchArguments(branch: ScanBranchInput): Uint8Array {
296
442
  const fields: VgiField[] = [];
297
443
  const values: Record<string, unknown[]> = {};
@@ -328,21 +474,21 @@ export function buildScanBranchesResult(
328
474
  branches: ScanBranchInput[],
329
475
  requiredExtensions: string[] = [],
330
476
  ): { branches: Uint8Array[]; required_extensions: string[] } {
331
- const serializedBranches = branches.map((branch) => {
332
- const branchBatch = batchFromColumns(
333
- {
334
- function_name: [branch.functionName],
335
- arguments: [serializeBranchArguments(branch)],
336
- branch_filter: [branch.branchFilter ?? null],
337
- writable: [branch.writable ?? false],
338
- source_catalog: [branch.sourceCatalog ?? null],
339
- source_schema: [branch.sourceSchema ?? null],
340
- source_table: [branch.sourceTable ?? null],
341
- },
342
- ScanBranchSchema as any,
343
- );
344
- return serializeBatch(branchBatch);
345
- });
477
+ const serializedBranches = branches.map((branch) =>
478
+ encodeScanBranch({
479
+ function_name: branch.functionName,
480
+ arguments: serializeBranchArguments(branch),
481
+ branch_filter: branch.branchFilter,
482
+ writable: branch.writable,
483
+ source_catalog: branch.sourceCatalog,
484
+ source_schema_path: branch.sourceSchemaPath,
485
+ source_table: branch.sourceTable,
486
+ format_name: branch.formatName,
487
+ format_locations: branch.formatLocations,
488
+ format_options: branch.formatOptions,
489
+ schema_path: branch.schemaPath,
490
+ }),
491
+ );
346
492
  return {
347
493
  branches: serializedBranches,
348
494
  required_extensions: requiredExtensions,
@@ -422,18 +568,18 @@ export abstract class CatalogInterface {
422
568
  }
423
569
  schemaGet(
424
570
  attachOpaqueData: AttachOpaqueData,
425
- name: string,
571
+ path: string[],
426
572
  transactionOpaqueData?: TransactionOpaqueData
427
573
  ): Awaitable<SchemaInfo | null> {
428
574
  const all = this.schemas(attachOpaqueData, transactionOpaqueData);
429
575
  if (isPromise(all)) {
430
- return all.then((arr) => arr.find((s) => s.name === name) ?? null);
576
+ return all.then((arr) => arr.find((s) => schemaPathsEqual(s.path, path)) ?? null);
431
577
  }
432
- return all.find((s) => s.name === name) ?? null;
578
+ return all.find((s) => schemaPathsEqual(s.path, path)) ?? null;
433
579
  }
434
580
  schemaCreate(
435
581
  attachOpaqueData: AttachOpaqueData,
436
- name: string,
582
+ path: string[],
437
583
  comment?: string | null,
438
584
  tags?: any,
439
585
  transactionOpaqueData?: TransactionOpaqueData
@@ -442,7 +588,7 @@ export abstract class CatalogInterface {
442
588
  }
443
589
  schemaDrop(
444
590
  attachOpaqueData: AttachOpaqueData,
445
- name: string,
591
+ path: string[],
446
592
  ignoreNotFound?: boolean,
447
593
  cascade?: boolean,
448
594
  transactionOpaqueData?: TransactionOpaqueData
@@ -451,21 +597,21 @@ export abstract class CatalogInterface {
451
597
  }
452
598
  schemaContentsTables(
453
599
  attachOpaqueData: AttachOpaqueData,
454
- name: string,
600
+ path: string[],
455
601
  transactionOpaqueData?: TransactionOpaqueData
456
602
  ): Awaitable<TableInfo[]> {
457
603
  return [];
458
604
  }
459
605
  schemaContentsViews(
460
606
  attachOpaqueData: AttachOpaqueData,
461
- name: string,
607
+ path: string[],
462
608
  transactionOpaqueData?: TransactionOpaqueData
463
609
  ): Awaitable<ViewInfo[]> {
464
610
  return [];
465
611
  }
466
612
  schemaContentsFunctions(
467
613
  attachOpaqueData: AttachOpaqueData,
468
- name: string,
614
+ path: string[],
469
615
  type: string,
470
616
  transactionOpaqueData?: TransactionOpaqueData
471
617
  ): Awaitable<FunctionInfo[]> {
@@ -473,7 +619,7 @@ export abstract class CatalogInterface {
473
619
  }
474
620
  tableGet(
475
621
  attachOpaqueData: AttachOpaqueData,
476
- schemaName: string,
622
+ schemaPath: string[],
477
623
  name: string,
478
624
  atUnit?: string,
479
625
  atValue?: string,
@@ -483,7 +629,7 @@ export abstract class CatalogInterface {
483
629
  }
484
630
  tableCreate(
485
631
  attachOpaqueData: AttachOpaqueData,
486
- schemaName: string,
632
+ schemaPath: string[],
487
633
  name: string,
488
634
  columns: Uint8Array,
489
635
  onConflict: string,
@@ -496,7 +642,7 @@ export abstract class CatalogInterface {
496
642
  }
497
643
  tableDrop(
498
644
  attachOpaqueData: AttachOpaqueData,
499
- schemaName: string,
645
+ schemaPath: string[],
500
646
  name: string,
501
647
  ignoreNotFound?: boolean,
502
648
  transactionOpaqueData?: TransactionOpaqueData
@@ -505,7 +651,7 @@ export abstract class CatalogInterface {
505
651
  }
506
652
  tableScanFunctionGet(
507
653
  attachOpaqueData: AttachOpaqueData,
508
- schemaName: string,
654
+ schemaPath: string[],
509
655
  name: string,
510
656
  atUnit?: string,
511
657
  atValue?: string,
@@ -521,14 +667,14 @@ export abstract class CatalogInterface {
521
667
  */
522
668
  tableScanBranchesGet(
523
669
  attachOpaqueData: AttachOpaqueData,
524
- schemaName: string,
670
+ schemaPath: string[],
525
671
  name: string,
526
672
  atUnit?: string,
527
673
  atValue?: string,
528
674
  transactionOpaqueData?: TransactionOpaqueData
529
675
  ): Awaitable<any> {
530
676
  const legacy = this.tableScanFunctionGet(
531
- attachOpaqueData, schemaName, name, atUnit, atValue, transactionOpaqueData,
677
+ attachOpaqueData, schemaPath, name, atUnit, atValue, transactionOpaqueData,
532
678
  );
533
679
  return isPromise(legacy)
534
680
  ? legacy.then((r) => singleBranchResult(r))
@@ -544,7 +690,7 @@ export abstract class CatalogInterface {
544
690
  */
545
691
  tableColumnStatisticsGet(
546
692
  attachOpaqueData: AttachOpaqueData,
547
- schemaName: string,
693
+ schemaPath: string[],
548
694
  name: string,
549
695
  transactionOpaqueData?: TransactionOpaqueData,
550
696
  ): Awaitable<{ bytes: Uint8Array; cacheMaxAgeSeconds: number | null } | null> {
@@ -552,7 +698,7 @@ export abstract class CatalogInterface {
552
698
  }
553
699
  tableCommentSet(
554
700
  attachOpaqueData: AttachOpaqueData,
555
- schemaName: string,
701
+ schemaPath: string[],
556
702
  name: string,
557
703
  comment?: string | null,
558
704
  ignoreNotFound?: boolean,
@@ -562,7 +708,7 @@ export abstract class CatalogInterface {
562
708
  }
563
709
  tableRename(
564
710
  attachOpaqueData: AttachOpaqueData,
565
- schemaName: string,
711
+ schemaPath: string[],
566
712
  name: string,
567
713
  newName: string,
568
714
  ignoreNotFound?: boolean,
@@ -572,7 +718,7 @@ export abstract class CatalogInterface {
572
718
  }
573
719
  tableColumnAdd(
574
720
  attachOpaqueData: AttachOpaqueData,
575
- schemaName: string,
721
+ schemaPath: string[],
576
722
  name: string,
577
723
  columnName: string,
578
724
  columnType: string,
@@ -584,7 +730,7 @@ export abstract class CatalogInterface {
584
730
  }
585
731
  tableColumnDrop(
586
732
  attachOpaqueData: AttachOpaqueData,
587
- schemaName: string,
733
+ schemaPath: string[],
588
734
  name: string,
589
735
  columnName: string,
590
736
  ignoreNotFound?: boolean,
@@ -594,7 +740,7 @@ export abstract class CatalogInterface {
594
740
  }
595
741
  tableColumnRename(
596
742
  attachOpaqueData: AttachOpaqueData,
597
- schemaName: string,
743
+ schemaPath: string[],
598
744
  name: string,
599
745
  columnName: string,
600
746
  newName: string,
@@ -605,7 +751,7 @@ export abstract class CatalogInterface {
605
751
  }
606
752
  tableColumnDefaultSet(
607
753
  attachOpaqueData: AttachOpaqueData,
608
- schemaName: string,
754
+ schemaPath: string[],
609
755
  name: string,
610
756
  columnName: string,
611
757
  defaultValue: string,
@@ -616,7 +762,7 @@ export abstract class CatalogInterface {
616
762
  }
617
763
  tableColumnDefaultDrop(
618
764
  attachOpaqueData: AttachOpaqueData,
619
- schemaName: string,
765
+ schemaPath: string[],
620
766
  name: string,
621
767
  columnName: string,
622
768
  ignoreNotFound?: boolean,
@@ -626,7 +772,7 @@ export abstract class CatalogInterface {
626
772
  }
627
773
  tableColumnTypeChange(
628
774
  attachOpaqueData: AttachOpaqueData,
629
- schemaName: string,
775
+ schemaPath: string[],
630
776
  name: string,
631
777
  columnName: string,
632
778
  newType: string,
@@ -637,7 +783,7 @@ export abstract class CatalogInterface {
637
783
  }
638
784
  tableNotNullSet(
639
785
  attachOpaqueData: AttachOpaqueData,
640
- schemaName: string,
786
+ schemaPath: string[],
641
787
  name: string,
642
788
  columnName: string,
643
789
  ignoreNotFound?: boolean,
@@ -647,7 +793,7 @@ export abstract class CatalogInterface {
647
793
  }
648
794
  tableNotNullDrop(
649
795
  attachOpaqueData: AttachOpaqueData,
650
- schemaName: string,
796
+ schemaPath: string[],
651
797
  name: string,
652
798
  columnName: string,
653
799
  ignoreNotFound?: boolean,
@@ -657,7 +803,7 @@ export abstract class CatalogInterface {
657
803
  }
658
804
  viewGet(
659
805
  attachOpaqueData: AttachOpaqueData,
660
- schemaName: string,
806
+ schemaPath: string[],
661
807
  name: string,
662
808
  transactionOpaqueData?: TransactionOpaqueData
663
809
  ): Awaitable<ViewInfo | null> {
@@ -665,7 +811,7 @@ export abstract class CatalogInterface {
665
811
  }
666
812
  viewCreate(
667
813
  attachOpaqueData: AttachOpaqueData,
668
- schemaName: string,
814
+ schemaPath: string[],
669
815
  name: string,
670
816
  definition: string,
671
817
  onConflict: string,
@@ -675,7 +821,7 @@ export abstract class CatalogInterface {
675
821
  }
676
822
  viewDrop(
677
823
  attachOpaqueData: AttachOpaqueData,
678
- schemaName: string,
824
+ schemaPath: string[],
679
825
  name: string,
680
826
  ignoreNotFound?: boolean,
681
827
  transactionOpaqueData?: TransactionOpaqueData
@@ -684,7 +830,7 @@ export abstract class CatalogInterface {
684
830
  }
685
831
  viewRename(
686
832
  attachOpaqueData: AttachOpaqueData,
687
- schemaName: string,
833
+ schemaPath: string[],
688
834
  name: string,
689
835
  newName: string,
690
836
  ignoreNotFound?: boolean,
@@ -694,7 +840,7 @@ export abstract class CatalogInterface {
694
840
  }
695
841
  viewCommentSet(
696
842
  attachOpaqueData: AttachOpaqueData,
697
- schemaName: string,
843
+ schemaPath: string[],
698
844
  name: string,
699
845
  comment?: string | null,
700
846
  ignoreNotFound?: boolean,
@@ -704,7 +850,7 @@ export abstract class CatalogInterface {
704
850
  }
705
851
  macroGet(
706
852
  attachOpaqueData: AttachOpaqueData,
707
- schemaName: string,
853
+ schemaPath: string[],
708
854
  name: string,
709
855
  transactionOpaqueData?: TransactionOpaqueData
710
856
  ): Awaitable<MacroInfo | null> {
@@ -712,7 +858,7 @@ export abstract class CatalogInterface {
712
858
  }
713
859
  macroCreate(
714
860
  attachOpaqueData: AttachOpaqueData,
715
- schemaName: string,
861
+ schemaPath: string[],
716
862
  name: string,
717
863
  macroType: MacroType,
718
864
  parameters: string[],
@@ -732,7 +878,7 @@ export abstract class CatalogInterface {
732
878
  }
733
879
  macroDrop(
734
880
  attachOpaqueData: AttachOpaqueData,
735
- schemaName: string,
881
+ schemaPath: string[],
736
882
  name: string,
737
883
  ignoreNotFound?: boolean,
738
884
  transactionOpaqueData?: TransactionOpaqueData
@@ -741,7 +887,7 @@ export abstract class CatalogInterface {
741
887
  }
742
888
  schemaContentsMacros(
743
889
  attachOpaqueData: AttachOpaqueData,
744
- name: string,
890
+ path: string[],
745
891
  type: string,
746
892
  transactionOpaqueData?: TransactionOpaqueData
747
893
  ): Awaitable<MacroInfo[]> {
@@ -749,14 +895,14 @@ export abstract class CatalogInterface {
749
895
  }
750
896
  schemaContentsIndexes(
751
897
  attachOpaqueData: AttachOpaqueData,
752
- name: string,
898
+ path: string[],
753
899
  transactionOpaqueData?: TransactionOpaqueData
754
900
  ): Awaitable<IndexInfo[]> {
755
901
  return [];
756
902
  }
757
903
  indexGet(
758
904
  attachOpaqueData: AttachOpaqueData,
759
- schemaName: string,
905
+ schemaPath: string[],
760
906
  name: string,
761
907
  transactionOpaqueData?: TransactionOpaqueData
762
908
  ): Awaitable<IndexInfo | null> {
@@ -787,4 +933,3 @@ export abstract class CatalogInterface {
787
933
  transactionOpaqueData: TransactionOpaqueData
788
934
  ): Awaitable<void> {}
789
935
  }
790
-