@query-farm/vgi 0.47.1 → 0.48.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.
Files changed (58) hide show
  1. package/README.md +1 -1
  2. package/dist/catalog/column-expressions.d.ts +22 -1
  3. package/dist/catalog/column-metadata.d.ts +7 -0
  4. package/dist/catalog/column-types.d.ts +15 -0
  5. package/dist/catalog/composite.d.ts +2 -0
  6. package/dist/catalog/constraints.d.ts +110 -12
  7. package/dist/catalog/descriptors.d.ts +19 -1
  8. package/dist/catalog/indexes.d.ts +29 -0
  9. package/dist/catalog/interface.d.ts +41 -0
  10. package/dist/catalog/public-codecs.d.ts +6 -0
  11. package/dist/catalog/read-only.d.ts +3 -0
  12. package/dist/catalog/sql-grammar.d.ts +53 -0
  13. package/dist/catalog/unconstrained-columns.d.ts +8 -0
  14. package/dist/client/types.d.ts +5 -1
  15. package/dist/client-entry.d.ts +1 -0
  16. package/dist/client-entry.js +1435 -152
  17. package/dist/client-entry.js.map +15 -11
  18. package/dist/generated/vgi-client.d.ts +5 -0
  19. package/dist/generated/vgi-protocol-schemas.d.ts +5 -0
  20. package/dist/generated/vgi-protocol-types.d.ts +57 -0
  21. package/dist/generated/vgi-service.d.ts +1 -1
  22. package/dist/index.core.d.ts +3 -1
  23. package/dist/index.js +1940 -545
  24. package/dist/index.js.map +26 -22
  25. package/dist/protocol/dispatch.d.ts +1 -1
  26. package/dist/protocol/serializers/splits.d.ts +41 -1
  27. package/dist/serve-entry.js +1172 -58
  28. package/dist/serve-entry.js.map +20 -17
  29. package/dist/worker-cf-entry.d.ts +2 -1
  30. package/dist/worker-cf-entry.js +1538 -191
  31. package/dist/worker-cf-entry.js.map +26 -22
  32. package/package.json +1 -1
  33. package/src/catalog/column-expressions.ts +85 -7
  34. package/src/catalog/column-metadata.ts +20 -2
  35. package/src/catalog/column-types.ts +50 -0
  36. package/src/catalog/composite.ts +10 -0
  37. package/src/catalog/constraints.ts +496 -58
  38. package/src/catalog/contents-codec.ts +3 -3
  39. package/src/catalog/descriptors.ts +19 -1
  40. package/src/catalog/indexes.ts +59 -0
  41. package/src/catalog/interface.ts +103 -1
  42. package/src/catalog/public-codecs.ts +36 -0
  43. package/src/catalog/read-only.ts +92 -36
  44. package/src/catalog/sql-grammar.ts +476 -0
  45. package/src/catalog/unconstrained-columns.ts +34 -8
  46. package/src/client/client.ts +6 -3
  47. package/src/client/types.ts +5 -1
  48. package/src/client-entry.ts +4 -0
  49. package/src/generated/vgi-client.ts +6 -1
  50. package/src/generated/vgi-protocol-schemas.ts +36 -1
  51. package/src/generated/vgi-protocol-types.ts +130 -1
  52. package/src/generated/vgi-service.ts +2 -2
  53. package/src/index.core.ts +34 -1
  54. package/src/protocol/dispatch.ts +1 -1
  55. package/src/protocol/handlers/catalog/admin.ts +14 -13
  56. package/src/protocol/handlers/catalog/table.ts +58 -11
  57. package/src/protocol/serializers/splits.ts +82 -9
  58. package/src/worker-cf-entry.ts +2 -4
@@ -50,7 +50,7 @@ export { VGI_PROTOCOL_NAME };
50
50
  * hash covers method names, types and the params/result/header schemas only
51
51
  * (WIRE_PROTOCOL.md §14).
52
52
  *
53
- * It changes only with vgi.v3's protocol version (currently 3.0.0). Asserted
53
+ * It changes only with vgi.v3's protocol version (currently 3.1.0). Asserted
54
54
  * by src/protocol/__tests__/vgi-v3-hash.test.ts; if that test fails, the
55
55
  * surface drifted from the reference -- fix the schemas, do not bump this.
56
56
  */
@@ -1,5 +1,6 @@
1
1
  import { type VgiSchema } from "../../arrow/index.js";
2
2
  import type { BindRequest } from "../types.js";
3
+ import { OrderByDirection, OrderByNullOrder } from "../types.js";
3
4
  /**
4
5
  * One named, independently redeemable unit of scan work.
5
6
  *
@@ -21,7 +22,16 @@ export interface ScanSplit {
21
22
  * claiming client needs no cost model at all.
22
23
  */
23
24
  estimatedBytes?: number | bigint | null;
24
- /** 2-row (min, max) batch in the existing `vgi_partition_values` encoding. */
25
+ /** One-row exact transformed-key tuple aligned with `PlanResult.keyGrouping`. */
26
+ keyValue?: Uint8Array | null;
27
+ /** Zero-based range owned by this split under `PlanResult.rangePartitioning`. */
28
+ rangeIndex?: number | bigint | null;
29
+ /** Two-row (min, max) pruning batch; never an exact distribution claim. */
30
+ columnBounds?: Uint8Array | null;
31
+ /**
32
+ * Two-row (min, max) batch in the legacy `vgi_partition_values` encoding.
33
+ * @deprecated Protocol 3 producers should use `columnBounds`.
34
+ */
25
35
  partitionBounds?: Uint8Array | null;
26
36
  columnStatistics?: Uint8Array | null;
27
37
  locationIds?: number[] | null;
@@ -61,7 +71,21 @@ export interface PlanResult {
61
71
  * cacheable and is not redeemable after commit or rollback.
62
72
  */
63
73
  scope?: "catalog" | "transaction";
74
+ /** Hoisted host list indexed by each split's `locationIds`. */
75
+ locations?: string[] | null;
76
+ /** Serialized `KeyGrouping` shared by every page of this plan. */
77
+ keyGrouping?: Uint8Array | null;
78
+ /** Serialized `RangePartitioning` shared by every page of this plan. */
79
+ rangePartitioning?: Uint8Array | null;
80
+ /** @deprecated Protocol 3 producers should use `keyGrouping` or `rangePartitioning`. */
81
+ partitioning?: Uint8Array[] | null;
82
+ /** Serialized `SortField` records describing order within each split. */
83
+ sortOrder?: Uint8Array[] | null;
64
84
  cacheMaxAgeSeconds?: number | null;
85
+ /** Actual exclusive lower data position selected by the worker. */
86
+ startPosition?: Uint8Array | null;
87
+ /** Data frontier resolved by the worker for this plan. */
88
+ endPosition?: Uint8Array | null;
65
89
  }
66
90
  /** The request a client sends to divide a scan. */
67
91
  export interface TableFunctionPlanRequest {
@@ -69,6 +93,8 @@ export interface TableFunctionPlanRequest {
69
93
  bind_opaque_data: Uint8Array | null;
70
94
  projection_ids: number[] | null;
71
95
  pushdown_filters: Uint8Array | null;
96
+ join_keys: Uint8Array[] | null;
97
+ row_limit: bigint | null;
72
98
  /** The primary sizing lever: every engine is byte-driven. */
73
99
  target_split_bytes: bigint | null;
74
100
  /**
@@ -76,12 +102,26 @@ export interface TableFunctionPlanRequest {
76
102
  * per thread, which a byte target alone would not give it.
77
103
  */
78
104
  min_splits: bigint | null;
105
+ /** Maximum number of splits to enumerate on this response page. */
106
+ max_splits_per_response: bigint | null;
79
107
  /**
80
108
  * A place in the ENUMERATION of splits — NOT a place in the data. A cursor
81
109
  * lives for one plan call; a position is checkpointed and must survive
82
110
  * restarts, upgrades and key rotation.
83
111
  */
84
112
  cursor: Uint8Array | null;
113
+ /** Narrower filters supplied on a continuation request. */
114
+ refined_filters: Uint8Array | null;
115
+ /** False while the client may still send further filter refinement. */
116
+ filters_complete: boolean;
117
+ start_position: Uint8Array | null;
118
+ end_position: Uint8Array | null;
119
+ order_by_column_name: string | null;
120
+ order_by_direction: OrderByDirection | null;
121
+ order_by_null_order: OrderByNullOrder | null;
122
+ order_by_limit: bigint | null;
123
+ tablesample_percentage: number | null;
124
+ tablesample_seed: bigint | null;
85
125
  }
86
126
  /**
87
127
  * The ScanSplit shape, from codegen rather than hand-written.