@query-farm/vgi 0.33.0 → 0.35.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/dist/client/client.d.ts +1 -1
- package/dist/client/errors.d.ts +2 -1
- package/dist/client-entry.js +46 -2
- package/dist/client-entry.js.map +6 -6
- package/dist/index.js +46 -2
- package/dist/index.js.map +6 -6
- package/dist/serve-entry.js +45 -1
- package/dist/serve-entry.js.map +4 -4
- package/dist/worker-cf-entry.js +45 -1
- package/dist/worker-cf-entry.js.map +4 -4
- package/package.json +3 -3
- package/src/arguments/arguments.ts +9 -0
- package/src/arrow/impl-arrowjs/canonical.ts +50 -0
- package/src/arrow/impl-flechette/canonical.ts +21 -4
- package/src/client/client.ts +5 -1
- package/src/client/errors.ts +10 -1
package/dist/client/client.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type VgiBatch } from "../arrow/index.js";
|
|
2
|
-
import {
|
|
2
|
+
import type { RpcClient } from "@query-farm/vgi-rpc";
|
|
3
3
|
import { type SchemaInfo, type TableInfo, type ViewInfo, type FunctionInfo, type MacroInfo, type MacroType, type CatalogAttachResult, type AttachOpaqueData, type TransactionOpaqueData, type CatalogInfo, type ScanFunctionResult } from "../catalog/interface.js";
|
|
4
4
|
import { VgiClientError } from "./errors.js";
|
|
5
5
|
export { VgiClientError };
|
package/dist/client/errors.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { RpcError
|
|
1
|
+
import { RpcError } from "@query-farm/vgi-rpc/connect";
|
|
2
|
+
import type { RpcClient } from "@query-farm/vgi-rpc";
|
|
2
3
|
/** Error thrown by VgiClient when an RPC call fails or returns unexpected data. */
|
|
3
4
|
export declare class VgiClientError extends Error {
|
|
4
5
|
/** Remote traceback from the worker, when an RpcError carried one. */
|
package/dist/client-entry.js
CHANGED
|
@@ -999,6 +999,8 @@ function writeCanonicalColumn(type, canonical) {
|
|
|
999
999
|
function buildColumnData(values, type) {
|
|
1000
1000
|
if (DataType2.isList(type))
|
|
1001
1001
|
return buildListData(values, type);
|
|
1002
|
+
if (DataType2.isFixedSizeList(type))
|
|
1003
|
+
return buildFixedSizeListData(values, type);
|
|
1002
1004
|
if (DataType2.isMap(type))
|
|
1003
1005
|
return buildMapData(values, type);
|
|
1004
1006
|
if (DataType2.isStruct(type))
|
|
@@ -1146,6 +1148,38 @@ function buildListData(values, listType) {
|
|
|
1146
1148
|
valueOffsets: offsets
|
|
1147
1149
|
});
|
|
1148
1150
|
}
|
|
1151
|
+
function buildFixedSizeListData(values, type) {
|
|
1152
|
+
const childField = type.children[0];
|
|
1153
|
+
const listSize = type.listSize;
|
|
1154
|
+
const numRows = values.length;
|
|
1155
|
+
const allItems = [];
|
|
1156
|
+
const nullBitmap = new Uint8Array(Math.ceil(numRows / 8));
|
|
1157
|
+
let nullCount = 0;
|
|
1158
|
+
for (let i = 0;i < numRows; i++) {
|
|
1159
|
+
const row = values[i];
|
|
1160
|
+
if (row == null) {
|
|
1161
|
+
nullCount++;
|
|
1162
|
+
for (let j = 0;j < listSize; j++)
|
|
1163
|
+
allItems.push(null);
|
|
1164
|
+
continue;
|
|
1165
|
+
}
|
|
1166
|
+
nullBitmap[i >> 3] |= 1 << (i & 7);
|
|
1167
|
+
const items = Array.isArray(row) ? row : Array.from(row);
|
|
1168
|
+
if (items.length !== listSize) {
|
|
1169
|
+
throw new TypeError(`fixed_size_list[${listSize}]: row ${i} has ${items.length} items`);
|
|
1170
|
+
}
|
|
1171
|
+
for (const item of items)
|
|
1172
|
+
allItems.push(item);
|
|
1173
|
+
}
|
|
1174
|
+
const childData = allItems.length > 0 ? buildColumnData(allItems, childField.type) : emptyDataForType(childField.type);
|
|
1175
|
+
return makeData2({
|
|
1176
|
+
type,
|
|
1177
|
+
length: numRows,
|
|
1178
|
+
nullCount,
|
|
1179
|
+
nullBitmap: nullCount > 0 ? nullBitmap : undefined,
|
|
1180
|
+
child: childData
|
|
1181
|
+
});
|
|
1182
|
+
}
|
|
1149
1183
|
function buildMapData(values, mapType) {
|
|
1150
1184
|
const numRows = values.length;
|
|
1151
1185
|
const entriesField = mapType.children[0];
|
|
@@ -1237,6 +1271,14 @@ function emptyDataForType(type) {
|
|
|
1237
1271
|
valueOffsets: new Int32Array([0])
|
|
1238
1272
|
});
|
|
1239
1273
|
}
|
|
1274
|
+
if (DataType2.isFixedSizeList(type)) {
|
|
1275
|
+
return makeData2({
|
|
1276
|
+
type,
|
|
1277
|
+
length: 0,
|
|
1278
|
+
nullCount: 0,
|
|
1279
|
+
child: emptyDataForType(type.children[0].type)
|
|
1280
|
+
});
|
|
1281
|
+
}
|
|
1240
1282
|
if (DataType2.isStruct(type)) {
|
|
1241
1283
|
const children = type.children.map((cf) => emptyDataForType(cf.type));
|
|
1242
1284
|
return makeData2({ type, length: 0, nullCount: 0, children });
|
|
@@ -1888,6 +1930,8 @@ function unwrapScalar(val) {
|
|
|
1888
1930
|
return null;
|
|
1889
1931
|
if (typeof val !== "object")
|
|
1890
1932
|
return val;
|
|
1933
|
+
if (val instanceof Date)
|
|
1934
|
+
return val;
|
|
1891
1935
|
if (typeof val.valueOf === "function") {
|
|
1892
1936
|
let v;
|
|
1893
1937
|
try {
|
|
@@ -3363,7 +3407,7 @@ function serializeAttachOptions(options) {
|
|
|
3363
3407
|
}
|
|
3364
3408
|
|
|
3365
3409
|
// src/client/errors.ts
|
|
3366
|
-
import { RpcError } from "@query-farm/vgi-rpc";
|
|
3410
|
+
import { RpcError } from "@query-farm/vgi-rpc/connect";
|
|
3367
3411
|
|
|
3368
3412
|
class VgiClientError extends Error {
|
|
3369
3413
|
remoteTraceback;
|
|
@@ -4362,4 +4406,4 @@ export {
|
|
|
4362
4406
|
typeSignature
|
|
4363
4407
|
};
|
|
4364
4408
|
|
|
4365
|
-
//# debugId=
|
|
4409
|
+
//# debugId=B3C7C03F0A3E9BD664756E2164756E21
|