@query-farm/vgi 0.22.0 → 0.23.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/index.js +16 -10
- package/dist/index.js.map +4 -4
- package/dist/serve-entry.js +16 -10
- package/dist/serve-entry.js.map +4 -4
- package/dist/worker-cf-entry.js +16 -10
- package/dist/worker-cf-entry.js.map +4 -4
- package/package.json +1 -1
- package/src/protocol/handlers/aggregate.ts +18 -6
- package/src/protocol/handlers/table-buffering.ts +10 -2
package/dist/index.js
CHANGED
|
@@ -9424,8 +9424,13 @@ function registerFunctionMethods(protocol, config) {
|
|
|
9424
9424
|
// src/protocol/handlers/aggregate.ts
|
|
9425
9425
|
init_arrow();
|
|
9426
9426
|
function registerAggregateMethods(protocol, registry) {
|
|
9427
|
-
function resolveAggregate(name) {
|
|
9428
|
-
const func = registry.get(name, {
|
|
9427
|
+
function resolveAggregate(name, schemaName) {
|
|
9428
|
+
const func = registry.get(name, {
|
|
9429
|
+
arguments: new Arguments,
|
|
9430
|
+
inputSchema: null,
|
|
9431
|
+
isScalar: false,
|
|
9432
|
+
schemaName: schemaName ?? null
|
|
9433
|
+
});
|
|
9429
9434
|
if (!func || func.kind !== "aggregate") {
|
|
9430
9435
|
throw new Error(`Function '${name}' is not an aggregate function`);
|
|
9431
9436
|
}
|
|
@@ -9437,7 +9442,7 @@ function registerAggregateMethods(protocol, registry) {
|
|
|
9437
9442
|
handler: async (params) => {
|
|
9438
9443
|
const innerParams = unwrapRequest(params.request);
|
|
9439
9444
|
const functionName = innerParams.function_name;
|
|
9440
|
-
const cfg = resolveAggregate(functionName);
|
|
9445
|
+
const cfg = resolveAggregate(functionName, innerParams.schema_name ?? null);
|
|
9441
9446
|
const argBytes = toUint8Array(innerParams.arguments);
|
|
9442
9447
|
const args = deserializeArguments(argBytes);
|
|
9443
9448
|
const inputSchema = innerParams.input_schema ? deserializeSchema(toUint8Array(innerParams.input_schema)) : null;
|
|
@@ -9470,7 +9475,7 @@ function registerAggregateMethods(protocol, registry) {
|
|
|
9470
9475
|
const innerParams = unwrapRequest(params.request);
|
|
9471
9476
|
const functionName = innerParams.function_name;
|
|
9472
9477
|
const executionId = toUint8Array(innerParams.execution_id);
|
|
9473
|
-
const cfg = resolveAggregate(functionName);
|
|
9478
|
+
const cfg = resolveAggregate(functionName, innerParams.schema_name ?? null);
|
|
9474
9479
|
const batch = readSingleBatch(toUint8Array(innerParams.input_batch));
|
|
9475
9480
|
if (!batch || batch.numRows === 0)
|
|
9476
9481
|
return wrapResult({}, schema2([]));
|
|
@@ -9523,7 +9528,7 @@ function registerAggregateMethods(protocol, registry) {
|
|
|
9523
9528
|
const innerParams = unwrapRequest(params.request);
|
|
9524
9529
|
const functionName = innerParams.function_name;
|
|
9525
9530
|
const executionId = toUint8Array(innerParams.execution_id);
|
|
9526
|
-
const cfg = resolveAggregate(functionName);
|
|
9531
|
+
const cfg = resolveAggregate(functionName, innerParams.schema_name ?? null);
|
|
9527
9532
|
const batch = readSingleBatch(toUint8Array(innerParams.merge_batch));
|
|
9528
9533
|
if (!batch || batch.numRows === 0)
|
|
9529
9534
|
return wrapResult({}, schema2([]));
|
|
@@ -9568,7 +9573,7 @@ function registerAggregateMethods(protocol, registry) {
|
|
|
9568
9573
|
const innerParams = unwrapRequest(params.request);
|
|
9569
9574
|
const functionName = innerParams.function_name;
|
|
9570
9575
|
const executionId = toUint8Array(innerParams.execution_id);
|
|
9571
|
-
const cfg = resolveAggregate(functionName);
|
|
9576
|
+
const cfg = resolveAggregate(functionName, innerParams.schema_name ?? null);
|
|
9572
9577
|
const outputSchema = deserializeSchema(toUint8Array(innerParams.output_schema));
|
|
9573
9578
|
const gidBatch = readSingleBatch(toUint8Array(innerParams.group_ids_batch));
|
|
9574
9579
|
const groupIds = [];
|
|
@@ -9682,11 +9687,12 @@ function serializeBatchWithSchema(batch) {
|
|
|
9682
9687
|
init_arrow();
|
|
9683
9688
|
init_storage();
|
|
9684
9689
|
function registerTableBufferingMethods(protocol, registry, signingKey) {
|
|
9685
|
-
function resolveBuffering(name) {
|
|
9690
|
+
function resolveBuffering(name, schemaName) {
|
|
9686
9691
|
const func = registry.get(name, {
|
|
9687
9692
|
arguments: new Arguments,
|
|
9688
9693
|
inputSchema: null,
|
|
9689
|
-
isScalar: false
|
|
9694
|
+
isScalar: false,
|
|
9695
|
+
schemaName: schemaName ?? null
|
|
9690
9696
|
});
|
|
9691
9697
|
if (!func || func.kind !== "table_buffering") {
|
|
9692
9698
|
throw new Error(`Function '${name}' is not a table_buffering function`);
|
|
@@ -9699,7 +9705,7 @@ function registerTableBufferingMethods(protocol, registry, signingKey) {
|
|
|
9699
9705
|
const rawAttach = inner.attach_opaque_data ? toUint8Array(inner.attach_opaque_data) : null;
|
|
9700
9706
|
const attach = rawAttach && rawAttach.length > 0 ? await openAttach(rawAttach, ctx?.auth, signingKey) : rawAttach;
|
|
9701
9707
|
const transactionId = inner.transaction_id ? toUint8Array(inner.transaction_id) : null;
|
|
9702
|
-
const func = resolveBuffering(functionName);
|
|
9708
|
+
const func = resolveBuffering(functionName, inner.schema_name ?? null);
|
|
9703
9709
|
const bound = new BoundStorage(storage, executionId);
|
|
9704
9710
|
const payload = await bound.stateGet(FrameworkNS.BUFFERING_INIT, BoundStorage.packIntKey(-1));
|
|
9705
9711
|
if (payload == null) {
|
|
@@ -12136,4 +12142,4 @@ export {
|
|
|
12136
12142
|
ArgumentValidationError
|
|
12137
12143
|
};
|
|
12138
12144
|
|
|
12139
|
-
//# debugId=
|
|
12145
|
+
//# debugId=08C7854CB5C380CC64756E2164756E21
|