@query-farm/vgi 0.32.0 → 0.33.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/README.md CHANGED
@@ -41,7 +41,7 @@ npm install @query-farm/vgi
41
41
  Requires **Node.js ≥ 22.15** or **Bun**.
42
42
 
43
43
  > **Peer dependencies (since 0.3.0).** `@query-farm/apache-arrow` (`^21.1.1`) and
44
- > `@query-farm/vgi-rpc` (`^0.24.0`) are **peerDependencies** — install them directly
44
+ > `@query-farm/vgi-rpc` (`^0.25.2`) are **peerDependencies** — install them directly
45
45
  > alongside `@query-farm/vgi`:
46
46
  >
47
47
  > ```bash
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@query-farm/vgi",
3
- "version": "0.32.0",
3
+ "version": "0.33.0",
4
4
  "description": "TypeScript framework for extending DuckDB with user-defined functions via the Vector Gateway Interface (VGI) over Arrow IPC.",
5
5
  "license": "SEE LICENSE IN LICENSE",
6
6
  "author": "Query Farm LLC (https://query.farm)",
@@ -91,12 +91,12 @@
91
91
  },
92
92
  "peerDependencies": {
93
93
  "@query-farm/apache-arrow": "^21.1.1",
94
- "@query-farm/vgi-rpc": ">=0.24.0 <0.25.0"
94
+ "@query-farm/vgi-rpc": ">=0.25.2 <0.26.0"
95
95
  },
96
96
  "devDependencies": {
97
97
  "@duckdb/node-api": "^1.5.5-r.4",
98
98
  "@query-farm/apache-arrow": "^21.1.1",
99
- "@query-farm/vgi-rpc": "^0.24.0",
99
+ "@query-farm/vgi-rpc": "^0.25.2",
100
100
  "@types/bun": "latest",
101
101
  "typescript": "^7.0.2"
102
102
  },
@@ -16,7 +16,18 @@ import type { VgiBatch } from "../types.js";
16
16
  */
17
17
  export function withBatchMetadata(batch: VgiBatch, metadata: Map<string, string>): VgiBatch {
18
18
  const t = batch as any;
19
- const clone = Object.assign(Object.create(Object.getPrototypeOf(t)), t);
19
+ // Copy the own properties as descriptors, not by assignment. vgi-rpc's reader
20
+ // pins a zero-column batch's row count as an own `numRows` over
21
+ // `Table.prototype.numRows`, a getter-only accessor, and `Object.assign`
22
+ // *assigns* each own property -- which throws in strict mode ("Attempted to
23
+ // assign to readonly property") over an inherited getter-only accessor.
24
+ const clone = Object.create(Object.getPrototypeOf(t), Object.getOwnPropertyDescriptors(t));
25
+ // This backend's own reader supplies that row count through a Proxy instead
26
+ // (see `deserializeBatch`), which no property copy carries: without this the
27
+ // clone would derive 0 rows from its absent columns.
28
+ if (clone.numRows !== t.numRows) {
29
+ Object.defineProperty(clone, "numRows", { value: t.numRows, configurable: true, enumerable: true });
30
+ }
20
31
  if (metadata && metadata.size > 0) {
21
32
  clone._vgiRecordMetadata = metadata;
22
33
  clone.metadata = metadata;
@@ -18,7 +18,7 @@
18
18
  import {
19
19
  Type,
20
20
  field as f_field,
21
- nullType, bool, int, float, utf8, binary, fixedSizeBinary,
21
+ nullType, bool, int, float, utf8, largeUtf8, binary, largeBinary, fixedSizeBinary,
22
22
  decimal, date, time, timestamp, duration, interval,
23
23
  list, largeList, fixedSizeList, struct, map, dictionary, union,
24
24
  } from "@query-farm/flechette";
@@ -47,12 +47,19 @@ export function toFlechetteType(type: any): any {
47
47
  return aliasIntSigned(int(type.bitWidth, type.isSigned ?? type.signed ?? true));
48
48
  case Type.Float:
49
49
  return float(type.precision);
50
+ // Large variants stay large: flechette builds and encodes them, and
51
+ // folding them into Binary/Utf8 put a different type on the wire than the
52
+ // one declared (arrow-js writes LargeBinary/LargeUtf8). InitRequest
53
+ // declares `pushdown_filters` large_binary, so a flechette worker or
54
+ // client wrote that field as binary.
50
55
  case Type.Binary:
51
- case Type.LargeBinary:
52
56
  return binary();
57
+ case Type.LargeBinary:
58
+ return largeBinary();
53
59
  case Type.Utf8:
54
- case Type.LargeUtf8:
55
60
  return utf8();
61
+ case Type.LargeUtf8:
62
+ return largeUtf8();
56
63
  case Type.FixedSizeBinary:
57
64
  return fixedSizeBinary(type.byteWidth ?? type.stride);
58
65
  case Type.Decimal: