@uwdata/mosaic-inputs 0.3.5 → 0.5.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 +3 -1
- package/dist/mosaic-inputs.js +754 -425
- package/dist/mosaic-inputs.min.js +5 -4
- package/package.json +4 -4
- package/src/Menu.js +1 -1
package/dist/mosaic-inputs.js
CHANGED
|
@@ -4,6 +4,149 @@ var __export = (target, all2) => {
|
|
|
4
4
|
__defProp(target, name, { get: all2[name], enumerable: true });
|
|
5
5
|
};
|
|
6
6
|
|
|
7
|
+
// ../core/src/util/throttle.js
|
|
8
|
+
var NIL = {};
|
|
9
|
+
function throttle(callback, debounce = false) {
|
|
10
|
+
let curr;
|
|
11
|
+
let next;
|
|
12
|
+
let pending = NIL;
|
|
13
|
+
function invoke(event) {
|
|
14
|
+
curr = callback(event).then(() => {
|
|
15
|
+
if (next) {
|
|
16
|
+
const { value } = next;
|
|
17
|
+
next = null;
|
|
18
|
+
invoke(value);
|
|
19
|
+
} else {
|
|
20
|
+
curr = null;
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
function enqueue(event) {
|
|
25
|
+
next = { event };
|
|
26
|
+
}
|
|
27
|
+
function process(event) {
|
|
28
|
+
curr ? enqueue(event) : invoke(event);
|
|
29
|
+
}
|
|
30
|
+
function delay(event) {
|
|
31
|
+
if (pending !== event) {
|
|
32
|
+
requestAnimationFrame(() => {
|
|
33
|
+
const e = pending;
|
|
34
|
+
pending = NIL;
|
|
35
|
+
process(e);
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
pending = event;
|
|
39
|
+
}
|
|
40
|
+
return debounce ? delay : process;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
// ../core/src/MosaicClient.js
|
|
44
|
+
var MosaicClient = class {
|
|
45
|
+
/**
|
|
46
|
+
* Constructor.
|
|
47
|
+
* @param {*} filterSelection An optional selection to interactively filter
|
|
48
|
+
* this client's data. If provided, a coordinator will re-query and update
|
|
49
|
+
* the client when the selection updates.
|
|
50
|
+
*/
|
|
51
|
+
constructor(filterSelection) {
|
|
52
|
+
this._filterBy = filterSelection;
|
|
53
|
+
this._requestUpdate = throttle(() => this.requestQuery(), true);
|
|
54
|
+
this._coordinator = null;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Return this client's connected coordinator.
|
|
58
|
+
*/
|
|
59
|
+
get coordinator() {
|
|
60
|
+
return this._coordinator;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Set this client's connected coordinator.
|
|
64
|
+
*/
|
|
65
|
+
set coordinator(coordinator2) {
|
|
66
|
+
this._coordinator = coordinator2;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Return this client's filter selection.
|
|
70
|
+
*/
|
|
71
|
+
get filterBy() {
|
|
72
|
+
return this._filterBy;
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Return a boolean indicating if the client query can be indexed. Should
|
|
76
|
+
* return true if changes to the filterBy selection does not change the
|
|
77
|
+
* groupby domain of the client query.
|
|
78
|
+
*/
|
|
79
|
+
get filterIndexable() {
|
|
80
|
+
return true;
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Return an array of fields queried by this client.
|
|
84
|
+
*/
|
|
85
|
+
fields() {
|
|
86
|
+
return null;
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Called by the coordinator to set the field info for this client.
|
|
90
|
+
* @returns {this}
|
|
91
|
+
*/
|
|
92
|
+
fieldInfo() {
|
|
93
|
+
return this;
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Return a query specifying the data needed by this client.
|
|
97
|
+
*/
|
|
98
|
+
query() {
|
|
99
|
+
return null;
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Called by the coordinator to inform the client that a query is pending.
|
|
103
|
+
*/
|
|
104
|
+
queryPending() {
|
|
105
|
+
return this;
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Called by the coordinator to return a query result.
|
|
109
|
+
*
|
|
110
|
+
* @param {*} data the query result
|
|
111
|
+
* @returns {this}
|
|
112
|
+
*/
|
|
113
|
+
queryResult() {
|
|
114
|
+
return this;
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* Called by the coordinator to report a query execution error.
|
|
118
|
+
*/
|
|
119
|
+
queryError(error) {
|
|
120
|
+
console.error(error);
|
|
121
|
+
return this;
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* Request the coordinator to execute a query for this client.
|
|
125
|
+
* If an explicit query is not provided, the client query method will
|
|
126
|
+
* be called, filtered by the current filterBy selection.
|
|
127
|
+
*/
|
|
128
|
+
requestQuery(query) {
|
|
129
|
+
const q = query || this.query(this.filterBy?.predicate(this));
|
|
130
|
+
return this._coordinator.requestQuery(this, q);
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* Request that the coordinator perform a throttled update of this client
|
|
134
|
+
* using the default query. Unlike requestQuery, for which every call will
|
|
135
|
+
* result in an executed query, multiple calls to requestUpdate may be
|
|
136
|
+
* consolidated into a single update.
|
|
137
|
+
*/
|
|
138
|
+
requestUpdate() {
|
|
139
|
+
this._requestUpdate();
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* Requests a client update.
|
|
143
|
+
* For example to (re-)render an interface component.
|
|
144
|
+
*/
|
|
145
|
+
update() {
|
|
146
|
+
return this;
|
|
147
|
+
}
|
|
148
|
+
};
|
|
149
|
+
|
|
7
150
|
// ../../node_modules/apache-arrow/node_modules/tslib/tslib.es6.mjs
|
|
8
151
|
function __rest(s, e) {
|
|
9
152
|
var t = {};
|
|
@@ -179,46 +322,46 @@ var encoder = new TextEncoder();
|
|
|
179
322
|
var encodeUtf8 = (value) => encoder.encode(value);
|
|
180
323
|
|
|
181
324
|
// ../../node_modules/apache-arrow/util/compat.mjs
|
|
182
|
-
var isNumber = (
|
|
183
|
-
var isBoolean = (
|
|
184
|
-
var isFunction = (
|
|
185
|
-
var isObject = (
|
|
186
|
-
var isPromise = (
|
|
187
|
-
return isObject(
|
|
325
|
+
var isNumber = (x2) => typeof x2 === "number";
|
|
326
|
+
var isBoolean = (x2) => typeof x2 === "boolean";
|
|
327
|
+
var isFunction = (x2) => typeof x2 === "function";
|
|
328
|
+
var isObject = (x2) => x2 != null && Object(x2) === x2;
|
|
329
|
+
var isPromise = (x2) => {
|
|
330
|
+
return isObject(x2) && isFunction(x2.then);
|
|
188
331
|
};
|
|
189
|
-
var isIterable = (
|
|
190
|
-
return isObject(
|
|
332
|
+
var isIterable = (x2) => {
|
|
333
|
+
return isObject(x2) && isFunction(x2[Symbol.iterator]);
|
|
191
334
|
};
|
|
192
|
-
var isAsyncIterable = (
|
|
193
|
-
return isObject(
|
|
335
|
+
var isAsyncIterable = (x2) => {
|
|
336
|
+
return isObject(x2) && isFunction(x2[Symbol.asyncIterator]);
|
|
194
337
|
};
|
|
195
|
-
var isArrowJSON = (
|
|
196
|
-
return isObject(
|
|
338
|
+
var isArrowJSON = (x2) => {
|
|
339
|
+
return isObject(x2) && isObject(x2["schema"]);
|
|
197
340
|
};
|
|
198
|
-
var isIteratorResult = (
|
|
199
|
-
return isObject(
|
|
341
|
+
var isIteratorResult = (x2) => {
|
|
342
|
+
return isObject(x2) && "done" in x2 && "value" in x2;
|
|
200
343
|
};
|
|
201
|
-
var isFileHandle = (
|
|
202
|
-
return isObject(
|
|
344
|
+
var isFileHandle = (x2) => {
|
|
345
|
+
return isObject(x2) && isFunction(x2["stat"]) && isNumber(x2["fd"]);
|
|
203
346
|
};
|
|
204
|
-
var isFetchResponse = (
|
|
205
|
-
return isObject(
|
|
347
|
+
var isFetchResponse = (x2) => {
|
|
348
|
+
return isObject(x2) && isReadableDOMStream(x2["body"]);
|
|
206
349
|
};
|
|
207
|
-
var isReadableInterop = (
|
|
208
|
-
var isWritableDOMStream = (
|
|
209
|
-
return isObject(
|
|
350
|
+
var isReadableInterop = (x2) => "_getDOMStream" in x2 && "_getNodeStream" in x2;
|
|
351
|
+
var isWritableDOMStream = (x2) => {
|
|
352
|
+
return isObject(x2) && isFunction(x2["abort"]) && isFunction(x2["getWriter"]) && !isReadableInterop(x2);
|
|
210
353
|
};
|
|
211
|
-
var isReadableDOMStream = (
|
|
212
|
-
return isObject(
|
|
354
|
+
var isReadableDOMStream = (x2) => {
|
|
355
|
+
return isObject(x2) && isFunction(x2["cancel"]) && isFunction(x2["getReader"]) && !isReadableInterop(x2);
|
|
213
356
|
};
|
|
214
|
-
var isWritableNodeStream = (
|
|
215
|
-
return isObject(
|
|
357
|
+
var isWritableNodeStream = (x2) => {
|
|
358
|
+
return isObject(x2) && isFunction(x2["end"]) && isFunction(x2["write"]) && isBoolean(x2["writable"]) && !isReadableInterop(x2);
|
|
216
359
|
};
|
|
217
|
-
var isReadableNodeStream = (
|
|
218
|
-
return isObject(
|
|
360
|
+
var isReadableNodeStream = (x2) => {
|
|
361
|
+
return isObject(x2) && isFunction(x2["read"]) && isFunction(x2["pipe"]) && isBoolean(x2["readable"]) && !isReadableInterop(x2);
|
|
219
362
|
};
|
|
220
|
-
var isFlatbuffersByteBuffer = (
|
|
221
|
-
return isObject(
|
|
363
|
+
var isFlatbuffersByteBuffer = (x2) => {
|
|
364
|
+
return isObject(x2) && isFunction(x2["clear"]) && isFunction(x2["bytes"]) && isFunction(x2["position"]) && isFunction(x2["setPosition"]) && isFunction(x2["capacity"]) && isFunction(x2["getBufferIdentifier"]) && isFunction(x2["createLong"]);
|
|
222
365
|
};
|
|
223
366
|
|
|
224
367
|
// ../../node_modules/apache-arrow/util/buffer.mjs
|
|
@@ -226,20 +369,20 @@ var SharedArrayBuf = typeof SharedArrayBuffer !== "undefined" ? SharedArrayBuffe
|
|
|
226
369
|
function collapseContiguousByteRanges(chunks) {
|
|
227
370
|
const result = chunks[0] ? [chunks[0]] : [];
|
|
228
371
|
let xOffset, yOffset, xLen, yLen;
|
|
229
|
-
for (let
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
if (!
|
|
233
|
-
|
|
372
|
+
for (let x2, y2, i = 0, j = 0, n = chunks.length; ++i < n; ) {
|
|
373
|
+
x2 = result[j];
|
|
374
|
+
y2 = chunks[i];
|
|
375
|
+
if (!x2 || !y2 || x2.buffer !== y2.buffer || y2.byteOffset < x2.byteOffset) {
|
|
376
|
+
y2 && (result[++j] = y2);
|
|
234
377
|
continue;
|
|
235
378
|
}
|
|
236
|
-
({ byteOffset: xOffset, byteLength: xLen } =
|
|
237
|
-
({ byteOffset: yOffset, byteLength: yLen } =
|
|
379
|
+
({ byteOffset: xOffset, byteLength: xLen } = x2);
|
|
380
|
+
({ byteOffset: yOffset, byteLength: yLen } = y2);
|
|
238
381
|
if (xOffset + xLen < yOffset || yOffset + yLen < xOffset) {
|
|
239
|
-
|
|
382
|
+
y2 && (result[++j] = y2);
|
|
240
383
|
continue;
|
|
241
384
|
}
|
|
242
|
-
result[j] = new Uint8Array(
|
|
385
|
+
result[j] = new Uint8Array(x2.buffer, xOffset, yOffset - xOffset + yLen);
|
|
243
386
|
}
|
|
244
387
|
return result;
|
|
245
388
|
}
|
|
@@ -252,7 +395,7 @@ function memcpy(target, source, targetByteOffset = 0, sourceByteLength = source.
|
|
|
252
395
|
}
|
|
253
396
|
function joinUint8Arrays(chunks, size) {
|
|
254
397
|
const result = collapseContiguousByteRanges(chunks);
|
|
255
|
-
const byteLength = result.reduce((
|
|
398
|
+
const byteLength = result.reduce((x2, b) => x2 + b.byteLength, 0);
|
|
256
399
|
let source, sliced, buffer;
|
|
257
400
|
let offset = 0, index = -1;
|
|
258
401
|
const length2 = Math.min(size || Number.POSITIVE_INFINITY, byteLength);
|
|
@@ -314,8 +457,8 @@ var pump = (iterator) => {
|
|
|
314
457
|
return iterator;
|
|
315
458
|
};
|
|
316
459
|
function* toArrayBufferViewIterator(ArrayCtor, source) {
|
|
317
|
-
const wrap = function* (
|
|
318
|
-
yield
|
|
460
|
+
const wrap = function* (x2) {
|
|
461
|
+
yield x2;
|
|
319
462
|
};
|
|
320
463
|
const buffers = typeof source === "string" ? wrap(source) : ArrayBuffer.isView(source) ? wrap(source) : source instanceof ArrayBuffer ? wrap(source) : source instanceof SharedArrayBuf ? wrap(source) : !isIterable(source) ? wrap(source) : source;
|
|
321
464
|
yield* pump(function* (it) {
|
|
@@ -340,9 +483,9 @@ function toArrayBufferViewAsyncIterator(ArrayCtor, source) {
|
|
|
340
483
|
if (isPromise(source)) {
|
|
341
484
|
return yield __await(yield __await(yield* __asyncDelegator(__asyncValues(toArrayBufferViewAsyncIterator(ArrayCtor, yield __await(source))))));
|
|
342
485
|
}
|
|
343
|
-
const wrap = function(
|
|
486
|
+
const wrap = function(x2) {
|
|
344
487
|
return __asyncGenerator(this, arguments, function* () {
|
|
345
|
-
yield yield __await(yield __await(
|
|
488
|
+
yield yield __await(yield __await(x2));
|
|
346
489
|
});
|
|
347
490
|
};
|
|
348
491
|
const emit = function(source2) {
|
|
@@ -381,12 +524,12 @@ var toFloat64ArrayAsyncIterator = (input2) => toArrayBufferViewAsyncIterator(Flo
|
|
|
381
524
|
var toUint8ClampedArrayAsyncIterator = (input2) => toArrayBufferViewAsyncIterator(Uint8ClampedArray, input2);
|
|
382
525
|
function rebaseValueOffsets(offset, length2, valueOffsets) {
|
|
383
526
|
if (offset !== 0) {
|
|
384
|
-
valueOffsets = valueOffsets.slice(0, length2
|
|
385
|
-
for (let i = -1; ++i
|
|
527
|
+
valueOffsets = valueOffsets.slice(0, length2);
|
|
528
|
+
for (let i = -1, n = valueOffsets.length; ++i < n; ) {
|
|
386
529
|
valueOffsets[i] += offset;
|
|
387
530
|
}
|
|
388
531
|
}
|
|
389
|
-
return valueOffsets;
|
|
532
|
+
return valueOffsets.subarray(0, length2);
|
|
390
533
|
}
|
|
391
534
|
function compareArrayLike(a, b) {
|
|
392
535
|
let i = 0;
|
|
@@ -600,7 +743,7 @@ function fromNodeStream(stream) {
|
|
|
600
743
|
events[1] = onEvent(stream, "error");
|
|
601
744
|
do {
|
|
602
745
|
events[2] = onEvent(stream, "readable");
|
|
603
|
-
[event, err] = yield __await(Promise.race(events.map((
|
|
746
|
+
[event, err] = yield __await(Promise.race(events.map((x2) => x2[2])));
|
|
604
747
|
if (event === "error") {
|
|
605
748
|
break;
|
|
606
749
|
}
|
|
@@ -715,6 +858,7 @@ var Type;
|
|
|
715
858
|
Type3[Type3["FixedSizeBinary"] = 15] = "FixedSizeBinary";
|
|
716
859
|
Type3[Type3["FixedSizeList"] = 16] = "FixedSizeList";
|
|
717
860
|
Type3[Type3["Map"] = 17] = "Map";
|
|
861
|
+
Type3[Type3["Duration"] = 18] = "Duration";
|
|
718
862
|
Type3[Type3["Dictionary"] = -1] = "Dictionary";
|
|
719
863
|
Type3[Type3["Int8"] = -2] = "Int8";
|
|
720
864
|
Type3[Type3["Int16"] = -3] = "Int16";
|
|
@@ -741,6 +885,10 @@ var Type;
|
|
|
741
885
|
Type3[Type3["SparseUnion"] = -24] = "SparseUnion";
|
|
742
886
|
Type3[Type3["IntervalDayTime"] = -25] = "IntervalDayTime";
|
|
743
887
|
Type3[Type3["IntervalYearMonth"] = -26] = "IntervalYearMonth";
|
|
888
|
+
Type3[Type3["DurationSecond"] = -27] = "DurationSecond";
|
|
889
|
+
Type3[Type3["DurationMillisecond"] = -28] = "DurationMillisecond";
|
|
890
|
+
Type3[Type3["DurationMicrosecond"] = -29] = "DurationMicrosecond";
|
|
891
|
+
Type3[Type3["DurationNanosecond"] = -30] = "DurationNanosecond";
|
|
744
892
|
})(Type || (Type = {}));
|
|
745
893
|
var BufferType;
|
|
746
894
|
(function(BufferType2) {
|
|
@@ -759,32 +907,36 @@ __export(vector_exports, {
|
|
|
759
907
|
});
|
|
760
908
|
|
|
761
909
|
// ../../node_modules/apache-arrow/util/pretty.mjs
|
|
910
|
+
var pretty_exports = {};
|
|
911
|
+
__export(pretty_exports, {
|
|
912
|
+
valueToString: () => valueToString
|
|
913
|
+
});
|
|
762
914
|
var undf = void 0;
|
|
763
|
-
function valueToString(
|
|
764
|
-
if (
|
|
915
|
+
function valueToString(x2) {
|
|
916
|
+
if (x2 === null) {
|
|
765
917
|
return "null";
|
|
766
918
|
}
|
|
767
|
-
if (
|
|
919
|
+
if (x2 === undf) {
|
|
768
920
|
return "undefined";
|
|
769
921
|
}
|
|
770
|
-
switch (typeof
|
|
922
|
+
switch (typeof x2) {
|
|
771
923
|
case "number":
|
|
772
|
-
return `${
|
|
924
|
+
return `${x2}`;
|
|
773
925
|
case "bigint":
|
|
774
|
-
return `${
|
|
926
|
+
return `${x2}`;
|
|
775
927
|
case "string":
|
|
776
|
-
return `"${
|
|
928
|
+
return `"${x2}"`;
|
|
777
929
|
}
|
|
778
|
-
if (typeof
|
|
779
|
-
return
|
|
930
|
+
if (typeof x2[Symbol.toPrimitive] === "function") {
|
|
931
|
+
return x2[Symbol.toPrimitive]("string");
|
|
780
932
|
}
|
|
781
|
-
if (ArrayBuffer.isView(
|
|
782
|
-
if (
|
|
783
|
-
return `[${[...
|
|
933
|
+
if (ArrayBuffer.isView(x2)) {
|
|
934
|
+
if (x2 instanceof BigInt64Array || x2 instanceof BigUint64Array) {
|
|
935
|
+
return `[${[...x2].map((x3) => valueToString(x3))}]`;
|
|
784
936
|
}
|
|
785
|
-
return `[${
|
|
937
|
+
return `[${x2}]`;
|
|
786
938
|
}
|
|
787
|
-
return ArrayBuffer.isView(
|
|
939
|
+
return ArrayBuffer.isView(x2) ? `[${x2}]` : JSON.stringify(x2, (_, y2) => typeof y2 === "bigint" ? `${y2}` : y2);
|
|
788
940
|
}
|
|
789
941
|
|
|
790
942
|
// ../../node_modules/apache-arrow/util/bn.mjs
|
|
@@ -796,11 +948,11 @@ __export(bn_exports, {
|
|
|
796
948
|
isArrowBigNumSymbol: () => isArrowBigNumSymbol
|
|
797
949
|
});
|
|
798
950
|
var isArrowBigNumSymbol = Symbol.for("isArrowBigNum");
|
|
799
|
-
function BigNum(
|
|
951
|
+
function BigNum(x2, ...xs) {
|
|
800
952
|
if (xs.length === 0) {
|
|
801
|
-
return Object.setPrototypeOf(toArrayBufferView(this["TypedArray"],
|
|
953
|
+
return Object.setPrototypeOf(toArrayBufferView(this["TypedArray"], x2), this.constructor.prototype);
|
|
802
954
|
}
|
|
803
|
-
return Object.setPrototypeOf(new this["TypedArray"](
|
|
955
|
+
return Object.setPrototypeOf(new this["TypedArray"](x2, ...xs), this.constructor.prototype);
|
|
804
956
|
}
|
|
805
957
|
BigNum.prototype[isArrowBigNumSymbol] = true;
|
|
806
958
|
BigNum.prototype.toJSON = function() {
|
|
@@ -972,86 +1124,91 @@ var _r;
|
|
|
972
1124
|
var _s;
|
|
973
1125
|
var _t;
|
|
974
1126
|
var _u;
|
|
1127
|
+
var _v;
|
|
975
1128
|
var DataType = class _DataType {
|
|
976
1129
|
/** @nocollapse */
|
|
977
|
-
static isNull(
|
|
978
|
-
return (
|
|
1130
|
+
static isNull(x2) {
|
|
1131
|
+
return (x2 === null || x2 === void 0 ? void 0 : x2.typeId) === Type.Null;
|
|
979
1132
|
}
|
|
980
1133
|
/** @nocollapse */
|
|
981
|
-
static isInt(
|
|
982
|
-
return (
|
|
1134
|
+
static isInt(x2) {
|
|
1135
|
+
return (x2 === null || x2 === void 0 ? void 0 : x2.typeId) === Type.Int;
|
|
983
1136
|
}
|
|
984
1137
|
/** @nocollapse */
|
|
985
|
-
static isFloat(
|
|
986
|
-
return (
|
|
1138
|
+
static isFloat(x2) {
|
|
1139
|
+
return (x2 === null || x2 === void 0 ? void 0 : x2.typeId) === Type.Float;
|
|
987
1140
|
}
|
|
988
1141
|
/** @nocollapse */
|
|
989
|
-
static isBinary(
|
|
990
|
-
return (
|
|
1142
|
+
static isBinary(x2) {
|
|
1143
|
+
return (x2 === null || x2 === void 0 ? void 0 : x2.typeId) === Type.Binary;
|
|
991
1144
|
}
|
|
992
1145
|
/** @nocollapse */
|
|
993
|
-
static isUtf8(
|
|
994
|
-
return (
|
|
1146
|
+
static isUtf8(x2) {
|
|
1147
|
+
return (x2 === null || x2 === void 0 ? void 0 : x2.typeId) === Type.Utf8;
|
|
995
1148
|
}
|
|
996
1149
|
/** @nocollapse */
|
|
997
|
-
static isBool(
|
|
998
|
-
return (
|
|
1150
|
+
static isBool(x2) {
|
|
1151
|
+
return (x2 === null || x2 === void 0 ? void 0 : x2.typeId) === Type.Bool;
|
|
999
1152
|
}
|
|
1000
1153
|
/** @nocollapse */
|
|
1001
|
-
static isDecimal(
|
|
1002
|
-
return (
|
|
1154
|
+
static isDecimal(x2) {
|
|
1155
|
+
return (x2 === null || x2 === void 0 ? void 0 : x2.typeId) === Type.Decimal;
|
|
1003
1156
|
}
|
|
1004
1157
|
/** @nocollapse */
|
|
1005
|
-
static isDate(
|
|
1006
|
-
return (
|
|
1158
|
+
static isDate(x2) {
|
|
1159
|
+
return (x2 === null || x2 === void 0 ? void 0 : x2.typeId) === Type.Date;
|
|
1007
1160
|
}
|
|
1008
1161
|
/** @nocollapse */
|
|
1009
|
-
static isTime(
|
|
1010
|
-
return (
|
|
1162
|
+
static isTime(x2) {
|
|
1163
|
+
return (x2 === null || x2 === void 0 ? void 0 : x2.typeId) === Type.Time;
|
|
1011
1164
|
}
|
|
1012
1165
|
/** @nocollapse */
|
|
1013
|
-
static isTimestamp(
|
|
1014
|
-
return (
|
|
1166
|
+
static isTimestamp(x2) {
|
|
1167
|
+
return (x2 === null || x2 === void 0 ? void 0 : x2.typeId) === Type.Timestamp;
|
|
1015
1168
|
}
|
|
1016
1169
|
/** @nocollapse */
|
|
1017
|
-
static isInterval(
|
|
1018
|
-
return (
|
|
1170
|
+
static isInterval(x2) {
|
|
1171
|
+
return (x2 === null || x2 === void 0 ? void 0 : x2.typeId) === Type.Interval;
|
|
1019
1172
|
}
|
|
1020
1173
|
/** @nocollapse */
|
|
1021
|
-
static
|
|
1022
|
-
return (
|
|
1174
|
+
static isDuration(x2) {
|
|
1175
|
+
return (x2 === null || x2 === void 0 ? void 0 : x2.typeId) === Type.Duration;
|
|
1023
1176
|
}
|
|
1024
1177
|
/** @nocollapse */
|
|
1025
|
-
static
|
|
1026
|
-
return (
|
|
1178
|
+
static isList(x2) {
|
|
1179
|
+
return (x2 === null || x2 === void 0 ? void 0 : x2.typeId) === Type.List;
|
|
1027
1180
|
}
|
|
1028
1181
|
/** @nocollapse */
|
|
1029
|
-
static
|
|
1030
|
-
return (
|
|
1182
|
+
static isStruct(x2) {
|
|
1183
|
+
return (x2 === null || x2 === void 0 ? void 0 : x2.typeId) === Type.Struct;
|
|
1031
1184
|
}
|
|
1032
1185
|
/** @nocollapse */
|
|
1033
|
-
static
|
|
1034
|
-
return (
|
|
1186
|
+
static isUnion(x2) {
|
|
1187
|
+
return (x2 === null || x2 === void 0 ? void 0 : x2.typeId) === Type.Union;
|
|
1035
1188
|
}
|
|
1036
1189
|
/** @nocollapse */
|
|
1037
|
-
static
|
|
1038
|
-
return (
|
|
1190
|
+
static isFixedSizeBinary(x2) {
|
|
1191
|
+
return (x2 === null || x2 === void 0 ? void 0 : x2.typeId) === Type.FixedSizeBinary;
|
|
1039
1192
|
}
|
|
1040
1193
|
/** @nocollapse */
|
|
1041
|
-
static
|
|
1042
|
-
return (
|
|
1194
|
+
static isFixedSizeList(x2) {
|
|
1195
|
+
return (x2 === null || x2 === void 0 ? void 0 : x2.typeId) === Type.FixedSizeList;
|
|
1043
1196
|
}
|
|
1044
1197
|
/** @nocollapse */
|
|
1045
|
-
static
|
|
1046
|
-
return (
|
|
1198
|
+
static isMap(x2) {
|
|
1199
|
+
return (x2 === null || x2 === void 0 ? void 0 : x2.typeId) === Type.Map;
|
|
1047
1200
|
}
|
|
1048
1201
|
/** @nocollapse */
|
|
1049
|
-
static
|
|
1050
|
-
return
|
|
1202
|
+
static isDictionary(x2) {
|
|
1203
|
+
return (x2 === null || x2 === void 0 ? void 0 : x2.typeId) === Type.Dictionary;
|
|
1051
1204
|
}
|
|
1052
1205
|
/** @nocollapse */
|
|
1053
|
-
static
|
|
1054
|
-
return _DataType.isUnion(
|
|
1206
|
+
static isDenseUnion(x2) {
|
|
1207
|
+
return _DataType.isUnion(x2) && x2.mode === UnionMode.Dense;
|
|
1208
|
+
}
|
|
1209
|
+
/** @nocollapse */
|
|
1210
|
+
static isSparseUnion(x2) {
|
|
1211
|
+
return _DataType.isUnion(x2) && x2.mode === UnionMode.Sparse;
|
|
1055
1212
|
}
|
|
1056
1213
|
get typeId() {
|
|
1057
1214
|
return Type.NONE;
|
|
@@ -1376,6 +1533,24 @@ Interval_[_m] = ((proto) => {
|
|
|
1376
1533
|
proto.ArrayType = Int32Array;
|
|
1377
1534
|
return proto[Symbol.toStringTag] = "Interval";
|
|
1378
1535
|
})(Interval_.prototype);
|
|
1536
|
+
var Duration = class extends DataType {
|
|
1537
|
+
constructor(unit) {
|
|
1538
|
+
super();
|
|
1539
|
+
this.unit = unit;
|
|
1540
|
+
}
|
|
1541
|
+
get typeId() {
|
|
1542
|
+
return Type.Duration;
|
|
1543
|
+
}
|
|
1544
|
+
toString() {
|
|
1545
|
+
return `Duration<${TimeUnit[this.unit]}>`;
|
|
1546
|
+
}
|
|
1547
|
+
};
|
|
1548
|
+
_o = Symbol.toStringTag;
|
|
1549
|
+
Duration[_o] = ((proto) => {
|
|
1550
|
+
proto.unit = null;
|
|
1551
|
+
proto.ArrayType = BigInt64Array;
|
|
1552
|
+
return proto[Symbol.toStringTag] = "Duration";
|
|
1553
|
+
})(Duration.prototype);
|
|
1379
1554
|
var List = class extends DataType {
|
|
1380
1555
|
constructor(child) {
|
|
1381
1556
|
super();
|
|
@@ -1397,8 +1572,8 @@ var List = class extends DataType {
|
|
|
1397
1572
|
return this.valueType.ArrayType;
|
|
1398
1573
|
}
|
|
1399
1574
|
};
|
|
1400
|
-
|
|
1401
|
-
List[
|
|
1575
|
+
_p = Symbol.toStringTag;
|
|
1576
|
+
List[_p] = ((proto) => {
|
|
1402
1577
|
proto.children = null;
|
|
1403
1578
|
return proto[Symbol.toStringTag] = "List";
|
|
1404
1579
|
})(List.prototype);
|
|
@@ -1414,8 +1589,8 @@ var Struct = class extends DataType {
|
|
|
1414
1589
|
return `Struct<{${this.children.map((f) => `${f.name}:${f.type}`).join(`, `)}}>`;
|
|
1415
1590
|
}
|
|
1416
1591
|
};
|
|
1417
|
-
|
|
1418
|
-
Struct[
|
|
1592
|
+
_q = Symbol.toStringTag;
|
|
1593
|
+
Struct[_q] = ((proto) => {
|
|
1419
1594
|
proto.children = null;
|
|
1420
1595
|
return proto[Symbol.toStringTag] = "Struct";
|
|
1421
1596
|
})(Struct.prototype);
|
|
@@ -1431,11 +1606,11 @@ var Union_ = class extends DataType {
|
|
|
1431
1606
|
return Type.Union;
|
|
1432
1607
|
}
|
|
1433
1608
|
toString() {
|
|
1434
|
-
return `${this[Symbol.toStringTag]}<${this.children.map((
|
|
1609
|
+
return `${this[Symbol.toStringTag]}<${this.children.map((x2) => `${x2.type}`).join(` | `)}>`;
|
|
1435
1610
|
}
|
|
1436
1611
|
};
|
|
1437
|
-
|
|
1438
|
-
Union_[
|
|
1612
|
+
_r = Symbol.toStringTag;
|
|
1613
|
+
Union_[_r] = ((proto) => {
|
|
1439
1614
|
proto.mode = null;
|
|
1440
1615
|
proto.typeIds = null;
|
|
1441
1616
|
proto.children = null;
|
|
@@ -1455,8 +1630,8 @@ var FixedSizeBinary = class extends DataType {
|
|
|
1455
1630
|
return `FixedSizeBinary[${this.byteWidth}]`;
|
|
1456
1631
|
}
|
|
1457
1632
|
};
|
|
1458
|
-
|
|
1459
|
-
FixedSizeBinary[
|
|
1633
|
+
_s = Symbol.toStringTag;
|
|
1634
|
+
FixedSizeBinary[_s] = ((proto) => {
|
|
1460
1635
|
proto.byteWidth = null;
|
|
1461
1636
|
proto.ArrayType = Uint8Array;
|
|
1462
1637
|
return proto[Symbol.toStringTag] = "FixedSizeBinary";
|
|
@@ -1483,17 +1658,31 @@ var FixedSizeList = class extends DataType {
|
|
|
1483
1658
|
return `FixedSizeList[${this.listSize}]<${this.valueType}>`;
|
|
1484
1659
|
}
|
|
1485
1660
|
};
|
|
1486
|
-
|
|
1487
|
-
FixedSizeList[
|
|
1661
|
+
_t = Symbol.toStringTag;
|
|
1662
|
+
FixedSizeList[_t] = ((proto) => {
|
|
1488
1663
|
proto.children = null;
|
|
1489
1664
|
proto.listSize = null;
|
|
1490
1665
|
return proto[Symbol.toStringTag] = "FixedSizeList";
|
|
1491
1666
|
})(FixedSizeList.prototype);
|
|
1492
1667
|
var Map_ = class extends DataType {
|
|
1493
|
-
constructor(
|
|
1668
|
+
constructor(entries, keysSorted = false) {
|
|
1669
|
+
var _w, _x, _y;
|
|
1494
1670
|
super();
|
|
1495
|
-
this.children = [
|
|
1671
|
+
this.children = [entries];
|
|
1496
1672
|
this.keysSorted = keysSorted;
|
|
1673
|
+
if (entries) {
|
|
1674
|
+
entries["name"] = "entries";
|
|
1675
|
+
if ((_w = entries === null || entries === void 0 ? void 0 : entries.type) === null || _w === void 0 ? void 0 : _w.children) {
|
|
1676
|
+
const key = (_x = entries === null || entries === void 0 ? void 0 : entries.type) === null || _x === void 0 ? void 0 : _x.children[0];
|
|
1677
|
+
if (key) {
|
|
1678
|
+
key["name"] = "key";
|
|
1679
|
+
}
|
|
1680
|
+
const val = (_y = entries === null || entries === void 0 ? void 0 : entries.type) === null || _y === void 0 ? void 0 : _y.children[1];
|
|
1681
|
+
if (val) {
|
|
1682
|
+
val["name"] = "value";
|
|
1683
|
+
}
|
|
1684
|
+
}
|
|
1685
|
+
}
|
|
1497
1686
|
}
|
|
1498
1687
|
get typeId() {
|
|
1499
1688
|
return Type.Map;
|
|
@@ -1511,8 +1700,8 @@ var Map_ = class extends DataType {
|
|
|
1511
1700
|
return `Map<{${this.children[0].type.children.map((f) => `${f.name}:${f.type}`).join(`, `)}}>`;
|
|
1512
1701
|
}
|
|
1513
1702
|
};
|
|
1514
|
-
|
|
1515
|
-
Map_[
|
|
1703
|
+
_u = Symbol.toStringTag;
|
|
1704
|
+
Map_[_u] = ((proto) => {
|
|
1516
1705
|
proto.children = null;
|
|
1517
1706
|
proto.keysSorted = null;
|
|
1518
1707
|
return proto[Symbol.toStringTag] = "Map_";
|
|
@@ -1542,8 +1731,8 @@ var Dictionary = class extends DataType {
|
|
|
1542
1731
|
return `Dictionary<${this.indices}, ${this.dictionary}>`;
|
|
1543
1732
|
}
|
|
1544
1733
|
};
|
|
1545
|
-
|
|
1546
|
-
Dictionary[
|
|
1734
|
+
_v = Symbol.toStringTag;
|
|
1735
|
+
Dictionary[_v] = ((proto) => {
|
|
1547
1736
|
proto.id = null;
|
|
1548
1737
|
proto.indices = null;
|
|
1549
1738
|
proto.isOrdered = null;
|
|
@@ -1573,7 +1762,7 @@ function strideForType(type) {
|
|
|
1573
1762
|
// ../../node_modules/apache-arrow/visitor.mjs
|
|
1574
1763
|
var Visitor = class {
|
|
1575
1764
|
visitMany(nodes, ...args) {
|
|
1576
|
-
return nodes.map((node, i) => this.visit(node, ...args.map((
|
|
1765
|
+
return nodes.map((node, i) => this.visit(node, ...args.map((x2) => x2[i])));
|
|
1577
1766
|
}
|
|
1578
1767
|
visit(...args) {
|
|
1579
1768
|
return this.getVisitFn(args[0], false).apply(this, args);
|
|
@@ -1632,6 +1821,9 @@ var Visitor = class {
|
|
|
1632
1821
|
visitInterval(_node, ..._args) {
|
|
1633
1822
|
return null;
|
|
1634
1823
|
}
|
|
1824
|
+
visitDuration(_node, ..._args) {
|
|
1825
|
+
return null;
|
|
1826
|
+
}
|
|
1635
1827
|
visitFixedSizeList(_node, ..._args) {
|
|
1636
1828
|
return null;
|
|
1637
1829
|
}
|
|
@@ -1780,6 +1972,21 @@ function getVisitFnByTypeId(visitor, dtype, throwIfNotFound = true) {
|
|
|
1780
1972
|
case Type.IntervalYearMonth:
|
|
1781
1973
|
fn = visitor.visitIntervalYearMonth || visitor.visitInterval;
|
|
1782
1974
|
break;
|
|
1975
|
+
case Type.Duration:
|
|
1976
|
+
fn = visitor.visitDuration;
|
|
1977
|
+
break;
|
|
1978
|
+
case Type.DurationSecond:
|
|
1979
|
+
fn = visitor.visitDurationSecond || visitor.visitDuration;
|
|
1980
|
+
break;
|
|
1981
|
+
case Type.DurationMillisecond:
|
|
1982
|
+
fn = visitor.visitDurationMillisecond || visitor.visitDuration;
|
|
1983
|
+
break;
|
|
1984
|
+
case Type.DurationMicrosecond:
|
|
1985
|
+
fn = visitor.visitDurationMicrosecond || visitor.visitDuration;
|
|
1986
|
+
break;
|
|
1987
|
+
case Type.DurationNanosecond:
|
|
1988
|
+
fn = visitor.visitDurationNanosecond || visitor.visitDuration;
|
|
1989
|
+
break;
|
|
1783
1990
|
case Type.FixedSizeList:
|
|
1784
1991
|
fn = visitor.visitFixedSizeList;
|
|
1785
1992
|
break;
|
|
@@ -1869,6 +2076,18 @@ function inferDType(type) {
|
|
|
1869
2076
|
return Type.IntervalYearMonth;
|
|
1870
2077
|
}
|
|
1871
2078
|
return Type.Interval;
|
|
2079
|
+
case Type.Duration:
|
|
2080
|
+
switch (type.unit) {
|
|
2081
|
+
case TimeUnit.SECOND:
|
|
2082
|
+
return Type.DurationSecond;
|
|
2083
|
+
case TimeUnit.MILLISECOND:
|
|
2084
|
+
return Type.DurationMillisecond;
|
|
2085
|
+
case TimeUnit.MICROSECOND:
|
|
2086
|
+
return Type.DurationMicrosecond;
|
|
2087
|
+
case TimeUnit.NANOSECOND:
|
|
2088
|
+
return Type.DurationNanosecond;
|
|
2089
|
+
}
|
|
2090
|
+
return Type.Duration;
|
|
1872
2091
|
case Type.Map:
|
|
1873
2092
|
return Type.Map;
|
|
1874
2093
|
case Type.List:
|
|
@@ -1917,6 +2136,11 @@ Visitor.prototype.visitDenseUnion = null;
|
|
|
1917
2136
|
Visitor.prototype.visitSparseUnion = null;
|
|
1918
2137
|
Visitor.prototype.visitIntervalDayTime = null;
|
|
1919
2138
|
Visitor.prototype.visitIntervalYearMonth = null;
|
|
2139
|
+
Visitor.prototype.visitDuration = null;
|
|
2140
|
+
Visitor.prototype.visitDurationSecond = null;
|
|
2141
|
+
Visitor.prototype.visitDurationMillisecond = null;
|
|
2142
|
+
Visitor.prototype.visitDurationMicrosecond = null;
|
|
2143
|
+
Visitor.prototype.visitDurationNanosecond = null;
|
|
1920
2144
|
|
|
1921
2145
|
// ../../node_modules/apache-arrow/util/math.mjs
|
|
1922
2146
|
var math_exports = {};
|
|
@@ -1990,8 +2214,8 @@ var setEpochMsToNanosecondsLong = (data, index, epochMs) => {
|
|
|
1990
2214
|
};
|
|
1991
2215
|
var setVariableWidthBytes = (values, valueOffsets, index, value) => {
|
|
1992
2216
|
if (index + 1 < valueOffsets.length) {
|
|
1993
|
-
const { [index]:
|
|
1994
|
-
values.set(value.subarray(0,
|
|
2217
|
+
const { [index]: x2, [index + 1]: y2 } = valueOffsets;
|
|
2218
|
+
values.set(value.subarray(0, y2 - x2), x2);
|
|
1995
2219
|
}
|
|
1996
2220
|
};
|
|
1997
2221
|
var setBool = ({ offset, values }, index, val) => {
|
|
@@ -2136,6 +2360,30 @@ var setIntervalDayTime = ({ values }, index, value) => {
|
|
|
2136
2360
|
var setIntervalYearMonth = ({ values }, index, value) => {
|
|
2137
2361
|
values[index] = value[0] * 12 + value[1] % 12;
|
|
2138
2362
|
};
|
|
2363
|
+
var setDurationSecond = ({ values }, index, value) => {
|
|
2364
|
+
values[index] = value;
|
|
2365
|
+
};
|
|
2366
|
+
var setDurationMillisecond = ({ values }, index, value) => {
|
|
2367
|
+
values[index] = value;
|
|
2368
|
+
};
|
|
2369
|
+
var setDurationMicrosecond = ({ values }, index, value) => {
|
|
2370
|
+
values[index] = value;
|
|
2371
|
+
};
|
|
2372
|
+
var setDurationNanosecond = ({ values }, index, value) => {
|
|
2373
|
+
values[index] = value;
|
|
2374
|
+
};
|
|
2375
|
+
var setDuration = (data, index, value) => {
|
|
2376
|
+
switch (data.type.unit) {
|
|
2377
|
+
case TimeUnit.SECOND:
|
|
2378
|
+
return setDurationSecond(data, index, value);
|
|
2379
|
+
case TimeUnit.MILLISECOND:
|
|
2380
|
+
return setDurationMillisecond(data, index, value);
|
|
2381
|
+
case TimeUnit.MICROSECOND:
|
|
2382
|
+
return setDurationMicrosecond(data, index, value);
|
|
2383
|
+
case TimeUnit.NANOSECOND:
|
|
2384
|
+
return setDurationNanosecond(data, index, value);
|
|
2385
|
+
}
|
|
2386
|
+
};
|
|
2139
2387
|
var setFixedSizeList = (data, index, value) => {
|
|
2140
2388
|
const { stride } = data;
|
|
2141
2389
|
const child = data.children[0];
|
|
@@ -2190,6 +2438,11 @@ SetVisitor.prototype.visitDictionary = wrapSet(setDictionary);
|
|
|
2190
2438
|
SetVisitor.prototype.visitInterval = wrapSet(setIntervalValue);
|
|
2191
2439
|
SetVisitor.prototype.visitIntervalDayTime = wrapSet(setIntervalDayTime);
|
|
2192
2440
|
SetVisitor.prototype.visitIntervalYearMonth = wrapSet(setIntervalYearMonth);
|
|
2441
|
+
SetVisitor.prototype.visitDuration = wrapSet(setDuration);
|
|
2442
|
+
SetVisitor.prototype.visitDurationSecond = wrapSet(setDurationSecond);
|
|
2443
|
+
SetVisitor.prototype.visitDurationMillisecond = wrapSet(setDurationMillisecond);
|
|
2444
|
+
SetVisitor.prototype.visitDurationMicrosecond = wrapSet(setDurationMicrosecond);
|
|
2445
|
+
SetVisitor.prototype.visitDurationNanosecond = wrapSet(setDurationNanosecond);
|
|
2193
2446
|
SetVisitor.prototype.visitFixedSizeList = wrapSet(setFixedSizeList);
|
|
2194
2447
|
SetVisitor.prototype.visitMap = wrapSet(setMap);
|
|
2195
2448
|
var instance = new SetVisitor();
|
|
@@ -2320,9 +2573,9 @@ var getVariableWidthBytes = (values, valueOffsets, index) => {
|
|
|
2320
2573
|
if (index + 1 >= valueOffsets.length) {
|
|
2321
2574
|
return null;
|
|
2322
2575
|
}
|
|
2323
|
-
const
|
|
2324
|
-
const
|
|
2325
|
-
return values.subarray(
|
|
2576
|
+
const x2 = valueOffsets[index];
|
|
2577
|
+
const y2 = valueOffsets[index + 1];
|
|
2578
|
+
return values.subarray(x2, y2);
|
|
2326
2579
|
};
|
|
2327
2580
|
var getBool = ({ offset, values }, index) => {
|
|
2328
2581
|
const idx = offset + index;
|
|
@@ -2418,6 +2671,22 @@ var getIntervalYearMonth = ({ values }, index) => {
|
|
|
2418
2671
|
int32s[1] = Math.trunc(interval % 12);
|
|
2419
2672
|
return int32s;
|
|
2420
2673
|
};
|
|
2674
|
+
var getDurationSecond = ({ values }, index) => values[index];
|
|
2675
|
+
var getDurationMillisecond = ({ values }, index) => values[index];
|
|
2676
|
+
var getDurationMicrosecond = ({ values }, index) => values[index];
|
|
2677
|
+
var getDurationNanosecond = ({ values }, index) => values[index];
|
|
2678
|
+
var getDuration = (data, index) => {
|
|
2679
|
+
switch (data.type.unit) {
|
|
2680
|
+
case TimeUnit.SECOND:
|
|
2681
|
+
return getDurationSecond(data, index);
|
|
2682
|
+
case TimeUnit.MILLISECOND:
|
|
2683
|
+
return getDurationMillisecond(data, index);
|
|
2684
|
+
case TimeUnit.MICROSECOND:
|
|
2685
|
+
return getDurationMicrosecond(data, index);
|
|
2686
|
+
case TimeUnit.NANOSECOND:
|
|
2687
|
+
return getDurationNanosecond(data, index);
|
|
2688
|
+
}
|
|
2689
|
+
};
|
|
2421
2690
|
var getFixedSizeList = (data, index) => {
|
|
2422
2691
|
const { stride, children } = data;
|
|
2423
2692
|
const child = children[0];
|
|
@@ -2465,6 +2734,11 @@ GetVisitor.prototype.visitDictionary = wrapGet(getDictionary);
|
|
|
2465
2734
|
GetVisitor.prototype.visitInterval = wrapGet(getInterval);
|
|
2466
2735
|
GetVisitor.prototype.visitIntervalDayTime = wrapGet(getIntervalDayTime);
|
|
2467
2736
|
GetVisitor.prototype.visitIntervalYearMonth = wrapGet(getIntervalYearMonth);
|
|
2737
|
+
GetVisitor.prototype.visitDuration = wrapGet(getDuration);
|
|
2738
|
+
GetVisitor.prototype.visitDurationSecond = wrapGet(getDurationSecond);
|
|
2739
|
+
GetVisitor.prototype.visitDurationMillisecond = wrapGet(getDurationMillisecond);
|
|
2740
|
+
GetVisitor.prototype.visitDurationMicrosecond = wrapGet(getDurationMicrosecond);
|
|
2741
|
+
GetVisitor.prototype.visitDurationNanosecond = wrapGet(getDurationNanosecond);
|
|
2468
2742
|
GetVisitor.prototype.visitFixedSizeList = wrapGet(getFixedSizeList);
|
|
2469
2743
|
GetVisitor.prototype.visitMap = wrapGet(getMap);
|
|
2470
2744
|
var instance2 = new GetVisitor();
|
|
@@ -2856,6 +3130,18 @@ var Data = class _Data {
|
|
|
2856
3130
|
get buffers() {
|
|
2857
3131
|
return [this.valueOffsets, this.values, this.nullBitmap, this.typeIds];
|
|
2858
3132
|
}
|
|
3133
|
+
get nullable() {
|
|
3134
|
+
if (this._nullCount !== 0) {
|
|
3135
|
+
const { type } = this;
|
|
3136
|
+
if (DataType.isSparseUnion(type)) {
|
|
3137
|
+
return this.children.some((child) => child.nullable);
|
|
3138
|
+
} else if (DataType.isDenseUnion(type)) {
|
|
3139
|
+
return this.children.some((child) => child.nullable);
|
|
3140
|
+
}
|
|
3141
|
+
return this.nullBitmap && this.nullBitmap.byteLength > 0;
|
|
3142
|
+
}
|
|
3143
|
+
return true;
|
|
3144
|
+
}
|
|
2859
3145
|
get byteLength() {
|
|
2860
3146
|
let byteLength = 0;
|
|
2861
3147
|
const { valueOffsets, values, nullBitmap, typeIds } = this;
|
|
@@ -2866,6 +3152,9 @@ var Data = class _Data {
|
|
|
2866
3152
|
return this.children.reduce((byteLength2, child) => byteLength2 + child.byteLength, byteLength);
|
|
2867
3153
|
}
|
|
2868
3154
|
get nullCount() {
|
|
3155
|
+
if (DataType.isUnion(this.type)) {
|
|
3156
|
+
return this.children.reduce((nullCount2, child) => nullCount2 + child.nullCount, 0);
|
|
3157
|
+
}
|
|
2869
3158
|
let nullCount = this._nullCount;
|
|
2870
3159
|
let nullBitmap;
|
|
2871
3160
|
if (nullCount <= kUnknownNullCount && (nullBitmap = this.nullBitmap)) {
|
|
@@ -2896,9 +3185,15 @@ var Data = class _Data {
|
|
|
2896
3185
|
(buffer = buffers[3]) && (this.typeIds = buffer);
|
|
2897
3186
|
}
|
|
2898
3187
|
}
|
|
2899
|
-
this.nullable = this._nullCount !== 0 && this.nullBitmap && this.nullBitmap.byteLength > 0;
|
|
2900
3188
|
}
|
|
2901
3189
|
getValid(index) {
|
|
3190
|
+
const { type } = this;
|
|
3191
|
+
if (DataType.isUnion(type)) {
|
|
3192
|
+
const union = type;
|
|
3193
|
+
const child = this.children[union.typeIdToChildIndex[this.typeIds[index]]];
|
|
3194
|
+
const indexInChild = union.mode === UnionMode.Dense ? this.valueOffsets[index] : index;
|
|
3195
|
+
return child.getValid(indexInChild);
|
|
3196
|
+
}
|
|
2902
3197
|
if (this.nullable && this.nullCount > 0) {
|
|
2903
3198
|
const pos = this.offset + index;
|
|
2904
3199
|
const val = this.nullBitmap[pos >> 3];
|
|
@@ -2907,18 +3202,34 @@ var Data = class _Data {
|
|
|
2907
3202
|
return true;
|
|
2908
3203
|
}
|
|
2909
3204
|
setValid(index, value) {
|
|
2910
|
-
|
|
2911
|
-
|
|
3205
|
+
let prev;
|
|
3206
|
+
const { type } = this;
|
|
3207
|
+
if (DataType.isUnion(type)) {
|
|
3208
|
+
const union = type;
|
|
3209
|
+
const child = this.children[union.typeIdToChildIndex[this.typeIds[index]]];
|
|
3210
|
+
const indexInChild = union.mode === UnionMode.Dense ? this.valueOffsets[index] : index;
|
|
3211
|
+
prev = child.getValid(indexInChild);
|
|
3212
|
+
child.setValid(indexInChild, value);
|
|
3213
|
+
} else {
|
|
3214
|
+
let { nullBitmap } = this;
|
|
3215
|
+
const { offset, length: length2 } = this;
|
|
3216
|
+
const idx = offset + index;
|
|
3217
|
+
const mask = 1 << idx % 8;
|
|
3218
|
+
const byteOffset = idx >> 3;
|
|
3219
|
+
if (!nullBitmap || nullBitmap.byteLength <= byteOffset) {
|
|
3220
|
+
nullBitmap = new Uint8Array((offset + length2 + 63 & ~63) >> 3).fill(255);
|
|
3221
|
+
if (this.nullCount > 0) {
|
|
3222
|
+
nullBitmap.set(truncateBitmap(offset, length2, this.nullBitmap), 0);
|
|
3223
|
+
}
|
|
3224
|
+
Object.assign(this, { nullBitmap, _nullCount: -1 });
|
|
3225
|
+
}
|
|
3226
|
+
const byte = nullBitmap[byteOffset];
|
|
3227
|
+
prev = (byte & mask) !== 0;
|
|
3228
|
+
value ? nullBitmap[byteOffset] = byte | mask : nullBitmap[byteOffset] = byte & ~mask;
|
|
2912
3229
|
}
|
|
2913
|
-
if (
|
|
2914
|
-
|
|
2915
|
-
Object.assign(this, { nullBitmap: nullBitmap2, _nullCount: 0 });
|
|
3230
|
+
if (prev !== !!value) {
|
|
3231
|
+
this._nullCount = this.nullCount + (value ? -1 : 1);
|
|
2916
3232
|
}
|
|
2917
|
-
const { nullBitmap, offset } = this;
|
|
2918
|
-
const pos = offset + index >> 3;
|
|
2919
|
-
const bit = (offset + index) % 8;
|
|
2920
|
-
const val = nullBitmap[pos] >> bit & 1;
|
|
2921
|
-
value ? val === 0 && (nullBitmap[pos] |= 1 << bit, this._nullCount = this.nullCount + 1) : val === 1 && (nullBitmap[pos] &= ~(1 << bit), this._nullCount = this.nullCount - 1);
|
|
2922
3233
|
return value;
|
|
2923
3234
|
}
|
|
2924
3235
|
clone(type = this.type, offset = this.offset, length2 = this.length, nullCount = this._nullCount, buffers = this, children = this.children) {
|
|
@@ -2972,7 +3283,7 @@ var MakeDataVisitor = class _MakeDataVisitor extends Visitor {
|
|
|
2972
3283
|
}
|
|
2973
3284
|
visitNull(props) {
|
|
2974
3285
|
const { ["type"]: type, ["offset"]: offset = 0, ["length"]: length2 = 0 } = props;
|
|
2975
|
-
return new Data(type, offset, length2,
|
|
3286
|
+
return new Data(type, offset, length2, length2);
|
|
2976
3287
|
}
|
|
2977
3288
|
visitBool(props) {
|
|
2978
3289
|
const { ["type"]: type, ["offset"]: offset = 0 } = props;
|
|
@@ -3061,14 +3372,13 @@ var MakeDataVisitor = class _MakeDataVisitor extends Visitor {
|
|
|
3061
3372
|
}
|
|
3062
3373
|
visitUnion(props) {
|
|
3063
3374
|
const { ["type"]: type, ["offset"]: offset = 0, ["children"]: children = [] } = props;
|
|
3064
|
-
const nullBitmap = toUint8Array(props["nullBitmap"]);
|
|
3065
3375
|
const typeIds = toArrayBufferView(type.ArrayType, props["typeIds"]);
|
|
3066
|
-
const { ["length"]: length2 = typeIds.length, ["nullCount"]: nullCount =
|
|
3376
|
+
const { ["length"]: length2 = typeIds.length, ["nullCount"]: nullCount = -1 } = props;
|
|
3067
3377
|
if (DataType.isSparseUnion(type)) {
|
|
3068
|
-
return new Data(type, offset, length2, nullCount, [void 0, void 0,
|
|
3378
|
+
return new Data(type, offset, length2, nullCount, [void 0, void 0, void 0, typeIds], children);
|
|
3069
3379
|
}
|
|
3070
3380
|
const valueOffsets = toInt32Array(props["valueOffsets"]);
|
|
3071
|
-
return new Data(type, offset, length2, nullCount, [valueOffsets, void 0,
|
|
3381
|
+
return new Data(type, offset, length2, nullCount, [valueOffsets, void 0, void 0, typeIds], children);
|
|
3072
3382
|
}
|
|
3073
3383
|
visitDictionary(props) {
|
|
3074
3384
|
const { ["type"]: type, ["offset"]: offset = 0 } = props;
|
|
@@ -3085,6 +3395,13 @@ var MakeDataVisitor = class _MakeDataVisitor extends Visitor {
|
|
|
3085
3395
|
const { ["length"]: length2 = data.length / strideForType(type), ["nullCount"]: nullCount = props["nullBitmap"] ? -1 : 0 } = props;
|
|
3086
3396
|
return new Data(type, offset, length2, nullCount, [void 0, data, nullBitmap]);
|
|
3087
3397
|
}
|
|
3398
|
+
visitDuration(props) {
|
|
3399
|
+
const { ["type"]: type, ["offset"]: offset = 0 } = props;
|
|
3400
|
+
const nullBitmap = toUint8Array(props["nullBitmap"]);
|
|
3401
|
+
const data = toArrayBufferView(type.ArrayType, props["data"]);
|
|
3402
|
+
const { ["length"]: length2 = data.length, ["nullCount"]: nullCount = props["nullBitmap"] ? -1 : 0 } = props;
|
|
3403
|
+
return new Data(type, offset, length2, nullCount, [void 0, data, nullBitmap]);
|
|
3404
|
+
}
|
|
3088
3405
|
visitFixedSizeList(props) {
|
|
3089
3406
|
const { ["type"]: type, ["offset"]: offset = 0, ["child"]: child = new _MakeDataVisitor().visit({ type: type.valueType }) } = props;
|
|
3090
3407
|
const nullBitmap = toUint8Array(props["nullBitmap"]);
|
|
@@ -3099,8 +3416,9 @@ var MakeDataVisitor = class _MakeDataVisitor extends Visitor {
|
|
|
3099
3416
|
return new Data(type, offset, length2, nullCount, [valueOffsets, void 0, nullBitmap], [child]);
|
|
3100
3417
|
}
|
|
3101
3418
|
};
|
|
3419
|
+
var makeDataVisitor = new MakeDataVisitor();
|
|
3102
3420
|
function makeData(props) {
|
|
3103
|
-
return
|
|
3421
|
+
return makeDataVisitor.visit(props);
|
|
3104
3422
|
}
|
|
3105
3423
|
|
|
3106
3424
|
// ../../node_modules/apache-arrow/util/chunk.mjs
|
|
@@ -3244,7 +3562,14 @@ function indexOfValue(data, searchElement, fromIndex) {
|
|
|
3244
3562
|
return -1;
|
|
3245
3563
|
}
|
|
3246
3564
|
if (searchElement === null) {
|
|
3247
|
-
|
|
3565
|
+
switch (data.typeId) {
|
|
3566
|
+
case Type.Union:
|
|
3567
|
+
break;
|
|
3568
|
+
case Type.Dictionary:
|
|
3569
|
+
break;
|
|
3570
|
+
default:
|
|
3571
|
+
return indexOfNull(data, fromIndex);
|
|
3572
|
+
}
|
|
3248
3573
|
}
|
|
3249
3574
|
const get = instance2.getVisitFn(data);
|
|
3250
3575
|
const compare = createElementComparator(searchElement);
|
|
@@ -3306,6 +3631,11 @@ IndexOfVisitor.prototype.visitDictionary = indexOfValue;
|
|
|
3306
3631
|
IndexOfVisitor.prototype.visitInterval = indexOfValue;
|
|
3307
3632
|
IndexOfVisitor.prototype.visitIntervalDayTime = indexOfValue;
|
|
3308
3633
|
IndexOfVisitor.prototype.visitIntervalYearMonth = indexOfValue;
|
|
3634
|
+
IndexOfVisitor.prototype.visitDuration = indexOfValue;
|
|
3635
|
+
IndexOfVisitor.prototype.visitDurationSecond = indexOfValue;
|
|
3636
|
+
IndexOfVisitor.prototype.visitDurationMillisecond = indexOfValue;
|
|
3637
|
+
IndexOfVisitor.prototype.visitDurationMicrosecond = indexOfValue;
|
|
3638
|
+
IndexOfVisitor.prototype.visitDurationNanosecond = indexOfValue;
|
|
3309
3639
|
IndexOfVisitor.prototype.visitFixedSizeList = indexOfValue;
|
|
3310
3640
|
IndexOfVisitor.prototype.visitMap = indexOfValue;
|
|
3311
3641
|
var instance3 = new IndexOfVisitor();
|
|
@@ -3388,12 +3718,17 @@ IteratorVisitor.prototype.visitDictionary = vectorIterator;
|
|
|
3388
3718
|
IteratorVisitor.prototype.visitInterval = vectorIterator;
|
|
3389
3719
|
IteratorVisitor.prototype.visitIntervalDayTime = vectorIterator;
|
|
3390
3720
|
IteratorVisitor.prototype.visitIntervalYearMonth = vectorIterator;
|
|
3721
|
+
IteratorVisitor.prototype.visitDuration = vectorIterator;
|
|
3722
|
+
IteratorVisitor.prototype.visitDurationSecond = vectorIterator;
|
|
3723
|
+
IteratorVisitor.prototype.visitDurationMillisecond = vectorIterator;
|
|
3724
|
+
IteratorVisitor.prototype.visitDurationMicrosecond = vectorIterator;
|
|
3725
|
+
IteratorVisitor.prototype.visitDurationNanosecond = vectorIterator;
|
|
3391
3726
|
IteratorVisitor.prototype.visitFixedSizeList = vectorIterator;
|
|
3392
3727
|
IteratorVisitor.prototype.visitMap = vectorIterator;
|
|
3393
3728
|
var instance4 = new IteratorVisitor();
|
|
3394
3729
|
|
|
3395
3730
|
// ../../node_modules/apache-arrow/visitor/bytelength.mjs
|
|
3396
|
-
var sum = (
|
|
3731
|
+
var sum = (x2, y2) => x2 + y2;
|
|
3397
3732
|
var GetByteLengthVisitor = class extends Visitor {
|
|
3398
3733
|
visitNull(____, _) {
|
|
3399
3734
|
return 0;
|
|
@@ -3422,6 +3757,9 @@ var GetByteLengthVisitor = class extends Visitor {
|
|
|
3422
3757
|
visitInterval(data, _) {
|
|
3423
3758
|
return (data.type.unit + 1) * 4;
|
|
3424
3759
|
}
|
|
3760
|
+
visitDuration(____, _) {
|
|
3761
|
+
return 8;
|
|
3762
|
+
}
|
|
3425
3763
|
visitStruct(data, i) {
|
|
3426
3764
|
return data.children.reduce((total, child) => total + instance5.visit(child, i), 0);
|
|
3427
3765
|
}
|
|
@@ -3490,8 +3828,8 @@ var vectorPrototypesByTypeId = {};
|
|
|
3490
3828
|
var Vector = class _Vector {
|
|
3491
3829
|
constructor(input2) {
|
|
3492
3830
|
var _b2, _c2, _d2;
|
|
3493
|
-
const data = input2[0] instanceof _Vector ? input2.flatMap((
|
|
3494
|
-
if (data.length === 0 || data.some((
|
|
3831
|
+
const data = input2[0] instanceof _Vector ? input2.flatMap((x2) => x2.data) : input2;
|
|
3832
|
+
if (data.length === 0 || data.some((x2) => !(x2 instanceof Data))) {
|
|
3495
3833
|
throw new TypeError("Vector constructor expects an Array of Data instances.");
|
|
3496
3834
|
}
|
|
3497
3835
|
const type = (_b2 = data[0]) === null || _b2 === void 0 ? void 0 : _b2.type;
|
|
@@ -3525,19 +3863,13 @@ var Vector = class _Vector {
|
|
|
3525
3863
|
* The aggregate size (in bytes) of this Vector's buffers and/or child Vectors.
|
|
3526
3864
|
*/
|
|
3527
3865
|
get byteLength() {
|
|
3528
|
-
|
|
3529
|
-
this._byteLength = this.data.reduce((byteLength, data) => byteLength + data.byteLength, 0);
|
|
3530
|
-
}
|
|
3531
|
-
return this._byteLength;
|
|
3866
|
+
return this.data.reduce((byteLength, data) => byteLength + data.byteLength, 0);
|
|
3532
3867
|
}
|
|
3533
3868
|
/**
|
|
3534
3869
|
* The number of null elements in this Vector.
|
|
3535
3870
|
*/
|
|
3536
3871
|
get nullCount() {
|
|
3537
|
-
|
|
3538
|
-
this._nullCount = computeChunkNullCounts(this.data);
|
|
3539
|
-
}
|
|
3540
|
-
return this._nullCount;
|
|
3872
|
+
return computeChunkNullCounts(this.data);
|
|
3541
3873
|
}
|
|
3542
3874
|
/**
|
|
3543
3875
|
* The Array or TypedArray constructor used for the JS representation
|
|
@@ -3593,7 +3925,7 @@ var Vector = class _Vector {
|
|
|
3593
3925
|
return -1;
|
|
3594
3926
|
}
|
|
3595
3927
|
includes(element, offset) {
|
|
3596
|
-
return this.indexOf(element, offset) >
|
|
3928
|
+
return this.indexOf(element, offset) > -1;
|
|
3597
3929
|
}
|
|
3598
3930
|
/**
|
|
3599
3931
|
* Get the size in bytes of an element by index.
|
|
@@ -3614,7 +3946,7 @@ var Vector = class _Vector {
|
|
|
3614
3946
|
* @param others Additional Vectors to add to the end of this Vector.
|
|
3615
3947
|
*/
|
|
3616
3948
|
concat(...others) {
|
|
3617
|
-
return new _Vector(this.data.concat(others.flatMap((
|
|
3949
|
+
return new _Vector(this.data.concat(others.flatMap((x2) => x2.data).flat(Number.POSITIVE_INFINITY)));
|
|
3618
3950
|
}
|
|
3619
3951
|
/**
|
|
3620
3952
|
* Return a zero-copy sub-section of this Vector.
|
|
@@ -3742,8 +4074,6 @@ Vector[_a2] = ((proto) => {
|
|
|
3742
4074
|
proto.length = 0;
|
|
3743
4075
|
proto.stride = 1;
|
|
3744
4076
|
proto.numChildren = 0;
|
|
3745
|
-
proto._nullCount = -1;
|
|
3746
|
-
proto._byteLength = -1;
|
|
3747
4077
|
proto._offsets = new Uint32Array([0]);
|
|
3748
4078
|
proto[Symbol.isConcatSpreadable] = true;
|
|
3749
4079
|
const typeIds = Object.keys(Type).map((T) => Type[T]).filter((T) => typeof T === "number" && T !== Type.NONE);
|
|
@@ -3808,11 +4138,11 @@ function createIsValidFunction(nullValues) {
|
|
|
3808
4138
|
};
|
|
3809
4139
|
}
|
|
3810
4140
|
let fnBody = "";
|
|
3811
|
-
const noNaNs = nullValues.filter((
|
|
4141
|
+
const noNaNs = nullValues.filter((x2) => x2 === x2);
|
|
3812
4142
|
if (noNaNs.length > 0) {
|
|
3813
4143
|
fnBody = `
|
|
3814
|
-
switch (x) {${noNaNs.map((
|
|
3815
|
-
case ${valueToCase(
|
|
4144
|
+
switch (x) {${noNaNs.map((x2) => `
|
|
4145
|
+
case ${valueToCase(x2)}:`).join("")}
|
|
3816
4146
|
return false;
|
|
3817
4147
|
}`;
|
|
3818
4148
|
}
|
|
@@ -3823,11 +4153,11 @@ ${fnBody}`;
|
|
|
3823
4153
|
return new Function(`x`, `${fnBody}
|
|
3824
4154
|
return true;`);
|
|
3825
4155
|
}
|
|
3826
|
-
function valueToCase(
|
|
3827
|
-
if (typeof
|
|
3828
|
-
return valueToString(
|
|
4156
|
+
function valueToCase(x2) {
|
|
4157
|
+
if (typeof x2 !== "bigint") {
|
|
4158
|
+
return valueToString(x2);
|
|
3829
4159
|
}
|
|
3830
|
-
return `${valueToString(
|
|
4160
|
+
return `${valueToString(x2)}n`;
|
|
3831
4161
|
}
|
|
3832
4162
|
|
|
3833
4163
|
// ../../node_modules/apache-arrow/builder/buffer.mjs
|
|
@@ -5374,6 +5704,45 @@ var TimeUnit2;
|
|
|
5374
5704
|
TimeUnit3[TimeUnit3["NANOSECOND"] = 3] = "NANOSECOND";
|
|
5375
5705
|
})(TimeUnit2 || (TimeUnit2 = {}));
|
|
5376
5706
|
|
|
5707
|
+
// ../../node_modules/apache-arrow/fb/duration.mjs
|
|
5708
|
+
var Duration2 = class _Duration {
|
|
5709
|
+
constructor() {
|
|
5710
|
+
this.bb = null;
|
|
5711
|
+
this.bb_pos = 0;
|
|
5712
|
+
}
|
|
5713
|
+
__init(i, bb) {
|
|
5714
|
+
this.bb_pos = i;
|
|
5715
|
+
this.bb = bb;
|
|
5716
|
+
return this;
|
|
5717
|
+
}
|
|
5718
|
+
static getRootAsDuration(bb, obj) {
|
|
5719
|
+
return (obj || new _Duration()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
|
5720
|
+
}
|
|
5721
|
+
static getSizePrefixedRootAsDuration(bb, obj) {
|
|
5722
|
+
bb.setPosition(bb.position() + SIZE_PREFIX_LENGTH);
|
|
5723
|
+
return (obj || new _Duration()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
|
5724
|
+
}
|
|
5725
|
+
unit() {
|
|
5726
|
+
const offset = this.bb.__offset(this.bb_pos, 4);
|
|
5727
|
+
return offset ? this.bb.readInt16(this.bb_pos + offset) : TimeUnit2.MILLISECOND;
|
|
5728
|
+
}
|
|
5729
|
+
static startDuration(builder) {
|
|
5730
|
+
builder.startObject(1);
|
|
5731
|
+
}
|
|
5732
|
+
static addUnit(builder, unit) {
|
|
5733
|
+
builder.addFieldInt16(0, unit, TimeUnit2.MILLISECOND);
|
|
5734
|
+
}
|
|
5735
|
+
static endDuration(builder) {
|
|
5736
|
+
const offset = builder.endObject();
|
|
5737
|
+
return offset;
|
|
5738
|
+
}
|
|
5739
|
+
static createDuration(builder, unit) {
|
|
5740
|
+
_Duration.startDuration(builder);
|
|
5741
|
+
_Duration.addUnit(builder, unit);
|
|
5742
|
+
return _Duration.endDuration(builder);
|
|
5743
|
+
}
|
|
5744
|
+
};
|
|
5745
|
+
|
|
5377
5746
|
// ../../node_modules/apache-arrow/fb/fixed-size-binary.mjs
|
|
5378
5747
|
var FixedSizeBinary2 = class _FixedSizeBinary {
|
|
5379
5748
|
constructor() {
|
|
@@ -6252,13 +6621,14 @@ var Footer = class _Footer {
|
|
|
6252
6621
|
|
|
6253
6622
|
// ../../node_modules/apache-arrow/schema.mjs
|
|
6254
6623
|
var Schema2 = class _Schema {
|
|
6255
|
-
constructor(fields = [], metadata, dictionaries) {
|
|
6624
|
+
constructor(fields = [], metadata, dictionaries, metadataVersion = MetadataVersion.V5) {
|
|
6256
6625
|
this.fields = fields || [];
|
|
6257
6626
|
this.metadata = metadata || /* @__PURE__ */ new Map();
|
|
6258
6627
|
if (!dictionaries) {
|
|
6259
6628
|
dictionaries = generateDictionaryMap(fields);
|
|
6260
6629
|
}
|
|
6261
6630
|
this.dictionaries = dictionaries;
|
|
6631
|
+
this.metadataVersion = metadataVersion;
|
|
6262
6632
|
}
|
|
6263
6633
|
get [Symbol.toStringTag]() {
|
|
6264
6634
|
return "Schema";
|
|
@@ -6373,7 +6743,7 @@ var Footer_ = class {
|
|
|
6373
6743
|
static decode(buf) {
|
|
6374
6744
|
buf = new ByteBuffer2(toUint8Array(buf));
|
|
6375
6745
|
const footer = Footer.getRootAsFooter(buf);
|
|
6376
|
-
const schema = Schema2.decode(footer.schema());
|
|
6746
|
+
const schema = Schema2.decode(footer.schema(), /* @__PURE__ */ new Map(), footer.version());
|
|
6377
6747
|
return new OffHeapFooter(schema, footer);
|
|
6378
6748
|
}
|
|
6379
6749
|
/** @nocollapse */
|
|
@@ -6392,7 +6762,7 @@ var Footer_ = class {
|
|
|
6392
6762
|
const dictionaryBatchesOffset = b.endVector();
|
|
6393
6763
|
Footer.startFooter(b);
|
|
6394
6764
|
Footer.addSchema(b, schemaOffset);
|
|
6395
|
-
Footer.addVersion(b, MetadataVersion.
|
|
6765
|
+
Footer.addVersion(b, MetadataVersion.V5);
|
|
6396
6766
|
Footer.addRecordBatches(b, recordBatchesOffset);
|
|
6397
6767
|
Footer.addDictionaries(b, dictionaryBatchesOffset);
|
|
6398
6768
|
Footer.finishFooterBuffer(b, Footer.endFooter(b));
|
|
@@ -6404,7 +6774,7 @@ var Footer_ = class {
|
|
|
6404
6774
|
get numDictionaries() {
|
|
6405
6775
|
return this._dictionaryBatches.length;
|
|
6406
6776
|
}
|
|
6407
|
-
constructor(schema, version = MetadataVersion.
|
|
6777
|
+
constructor(schema, version = MetadataVersion.V5, recordBatches, dictionaryBatches) {
|
|
6408
6778
|
this.schema = schema;
|
|
6409
6779
|
this.version = version;
|
|
6410
6780
|
recordBatches && (this._recordBatches = recordBatches);
|
|
@@ -7221,7 +7591,7 @@ var Int128 = class _Int128 {
|
|
|
7221
7591
|
|
|
7222
7592
|
// ../../node_modules/apache-arrow/visitor/vectorloader.mjs
|
|
7223
7593
|
var VectorLoader = class extends Visitor {
|
|
7224
|
-
constructor(bytes, nodes, buffers, dictionaries) {
|
|
7594
|
+
constructor(bytes, nodes, buffers, dictionaries, metadataVersion = MetadataVersion.V5) {
|
|
7225
7595
|
super();
|
|
7226
7596
|
this.nodesIndex = -1;
|
|
7227
7597
|
this.buffersIndex = -1;
|
|
@@ -7229,6 +7599,7 @@ var VectorLoader = class extends Visitor {
|
|
|
7229
7599
|
this.nodes = nodes;
|
|
7230
7600
|
this.buffers = buffers;
|
|
7231
7601
|
this.dictionaries = dictionaries;
|
|
7602
|
+
this.metadataVersion = metadataVersion;
|
|
7232
7603
|
}
|
|
7233
7604
|
visit(node) {
|
|
7234
7605
|
return super.visit(node instanceof Field2 ? node.type : node);
|
|
@@ -7272,14 +7643,17 @@ var VectorLoader = class extends Visitor {
|
|
|
7272
7643
|
visitStruct(type, { length: length2, nullCount } = this.nextFieldNode()) {
|
|
7273
7644
|
return makeData({ type, length: length2, nullCount, nullBitmap: this.readNullBitmap(type, nullCount), children: this.visitMany(type.children) });
|
|
7274
7645
|
}
|
|
7275
|
-
visitUnion(type) {
|
|
7276
|
-
|
|
7646
|
+
visitUnion(type, { length: length2, nullCount } = this.nextFieldNode()) {
|
|
7647
|
+
if (this.metadataVersion < MetadataVersion.V5) {
|
|
7648
|
+
this.readNullBitmap(type, nullCount);
|
|
7649
|
+
}
|
|
7650
|
+
return type.mode === UnionMode.Sparse ? this.visitSparseUnion(type, { length: length2, nullCount }) : this.visitDenseUnion(type, { length: length2, nullCount });
|
|
7277
7651
|
}
|
|
7278
7652
|
visitDenseUnion(type, { length: length2, nullCount } = this.nextFieldNode()) {
|
|
7279
|
-
return makeData({ type, length: length2, nullCount,
|
|
7653
|
+
return makeData({ type, length: length2, nullCount, typeIds: this.readTypeIds(type), valueOffsets: this.readOffsets(type), children: this.visitMany(type.children) });
|
|
7280
7654
|
}
|
|
7281
7655
|
visitSparseUnion(type, { length: length2, nullCount } = this.nextFieldNode()) {
|
|
7282
|
-
return makeData({ type, length: length2, nullCount,
|
|
7656
|
+
return makeData({ type, length: length2, nullCount, typeIds: this.readTypeIds(type), children: this.visitMany(type.children) });
|
|
7283
7657
|
}
|
|
7284
7658
|
visitDictionary(type, { length: length2, nullCount } = this.nextFieldNode()) {
|
|
7285
7659
|
return makeData({ type, length: length2, nullCount, nullBitmap: this.readNullBitmap(type, nullCount), data: this.readData(type.indices), dictionary: this.readDictionary(type) });
|
|
@@ -7287,6 +7661,9 @@ var VectorLoader = class extends Visitor {
|
|
|
7287
7661
|
visitInterval(type, { length: length2, nullCount } = this.nextFieldNode()) {
|
|
7288
7662
|
return makeData({ type, length: length2, nullCount, nullBitmap: this.readNullBitmap(type, nullCount), data: this.readData(type) });
|
|
7289
7663
|
}
|
|
7664
|
+
visitDuration(type, { length: length2, nullCount } = this.nextFieldNode()) {
|
|
7665
|
+
return makeData({ type, length: length2, nullCount, nullBitmap: this.readNullBitmap(type, nullCount), data: this.readData(type) });
|
|
7666
|
+
}
|
|
7290
7667
|
visitFixedSizeList(type, { length: length2, nullCount } = this.nextFieldNode()) {
|
|
7291
7668
|
return makeData({ type, length: length2, nullCount, nullBitmap: this.readNullBitmap(type, nullCount), "child": this.visit(type.children[0]) });
|
|
7292
7669
|
}
|
|
@@ -7316,8 +7693,8 @@ var VectorLoader = class extends Visitor {
|
|
|
7316
7693
|
}
|
|
7317
7694
|
};
|
|
7318
7695
|
var JSONVectorLoader = class extends VectorLoader {
|
|
7319
|
-
constructor(sources, nodes, buffers, dictionaries) {
|
|
7320
|
-
super(new Uint8Array(0), nodes, buffers, dictionaries);
|
|
7696
|
+
constructor(sources, nodes, buffers, dictionaries, metadataVersion) {
|
|
7697
|
+
super(new Uint8Array(0), nodes, buffers, dictionaries, metadataVersion);
|
|
7321
7698
|
this.sources = sources;
|
|
7322
7699
|
}
|
|
7323
7700
|
readNullBitmap(_type, nullCount, { offset } = this.nextBufferRange()) {
|
|
@@ -7333,7 +7710,7 @@ var JSONVectorLoader = class extends VectorLoader {
|
|
|
7333
7710
|
const { sources } = this;
|
|
7334
7711
|
if (DataType.isTimestamp(type)) {
|
|
7335
7712
|
return toArrayBufferView(Uint8Array, Int642.convertArray(sources[offset]));
|
|
7336
|
-
} else if ((DataType.isInt(type) || DataType.isTime(type)) && type.bitWidth === 64) {
|
|
7713
|
+
} else if ((DataType.isInt(type) || DataType.isTime(type)) && type.bitWidth === 64 || DataType.isDuration(type)) {
|
|
7337
7714
|
return toArrayBufferView(Uint8Array, Int642.convertArray(sources[offset]));
|
|
7338
7715
|
} else if (DataType.isDate(type) && type.unit === DateUnit.MILLISECOND) {
|
|
7339
7716
|
return toArrayBufferView(Uint8Array, Int642.convertArray(sources[offset]));
|
|
@@ -7346,7 +7723,7 @@ var JSONVectorLoader = class extends VectorLoader {
|
|
|
7346
7723
|
} else if (DataType.isUtf8(type)) {
|
|
7347
7724
|
return encodeUtf8(sources[offset].join(""));
|
|
7348
7725
|
}
|
|
7349
|
-
return toArrayBufferView(Uint8Array, toArrayBufferView(type.ArrayType, sources[offset].map((
|
|
7726
|
+
return toArrayBufferView(Uint8Array, toArrayBufferView(type.ArrayType, sources[offset].map((x2) => +x2)));
|
|
7350
7727
|
}
|
|
7351
7728
|
};
|
|
7352
7729
|
function binaryDataFromJSON(values) {
|
|
@@ -7546,6 +7923,23 @@ var IntervalYearMonthBuilder = class extends IntervalBuilder {
|
|
|
7546
7923
|
};
|
|
7547
7924
|
IntervalYearMonthBuilder.prototype._setValue = setIntervalYearMonth;
|
|
7548
7925
|
|
|
7926
|
+
// ../../node_modules/apache-arrow/builder/duration.mjs
|
|
7927
|
+
var DurationBuilder = class extends FixedWidthBuilder {
|
|
7928
|
+
};
|
|
7929
|
+
DurationBuilder.prototype._setValue = setDuration;
|
|
7930
|
+
var DurationSecondBuilder = class extends DurationBuilder {
|
|
7931
|
+
};
|
|
7932
|
+
DurationSecondBuilder.prototype._setValue = setDurationSecond;
|
|
7933
|
+
var DurationMillisecondBuilder = class extends DurationBuilder {
|
|
7934
|
+
};
|
|
7935
|
+
DurationMillisecondBuilder.prototype._setValue = setDurationMillisecond;
|
|
7936
|
+
var DurationMicrosecondBuilder = class extends DurationBuilder {
|
|
7937
|
+
};
|
|
7938
|
+
DurationMicrosecondBuilder.prototype._setValue = setDurationMicrosecond;
|
|
7939
|
+
var DurationNanosecondBuilder = class extends DurationBuilder {
|
|
7940
|
+
};
|
|
7941
|
+
DurationNanosecondBuilder.prototype._setValue = setDurationNanosecond;
|
|
7942
|
+
|
|
7549
7943
|
// ../../node_modules/apache-arrow/builder/int.mjs
|
|
7550
7944
|
var IntBuilder = class extends FixedWidthBuilder {
|
|
7551
7945
|
setValue(index, value) {
|
|
@@ -7731,9 +8125,7 @@ var UnionBuilder = class extends Builder {
|
|
|
7731
8125
|
if (childTypeId === void 0) {
|
|
7732
8126
|
childTypeId = this._valueToChildTypeId(this, value, index);
|
|
7733
8127
|
}
|
|
7734
|
-
|
|
7735
|
-
this.setValue(index, value, childTypeId);
|
|
7736
|
-
}
|
|
8128
|
+
this.setValue(index, value, childTypeId);
|
|
7737
8129
|
return this;
|
|
7738
8130
|
}
|
|
7739
8131
|
setValue(index, value, childTypeId) {
|
|
@@ -7918,6 +8310,21 @@ var GetBuilderCtor = class extends Visitor {
|
|
|
7918
8310
|
visitIntervalYearMonth() {
|
|
7919
8311
|
return IntervalYearMonthBuilder;
|
|
7920
8312
|
}
|
|
8313
|
+
visitDuration() {
|
|
8314
|
+
return DurationBuilder;
|
|
8315
|
+
}
|
|
8316
|
+
visitDurationSecond() {
|
|
8317
|
+
return DurationSecondBuilder;
|
|
8318
|
+
}
|
|
8319
|
+
visitDurationMillisecond() {
|
|
8320
|
+
return DurationMillisecondBuilder;
|
|
8321
|
+
}
|
|
8322
|
+
visitDurationMicrosecond() {
|
|
8323
|
+
return DurationMicrosecondBuilder;
|
|
8324
|
+
}
|
|
8325
|
+
visistDurationNanosecond() {
|
|
8326
|
+
return DurationNanosecondBuilder;
|
|
8327
|
+
}
|
|
7921
8328
|
visitFixedSizeList() {
|
|
7922
8329
|
return FixedSizeListBuilder;
|
|
7923
8330
|
}
|
|
@@ -7970,7 +8377,7 @@ function compareStruct(type, other) {
|
|
|
7970
8377
|
return type === other || compareConstructor(type, other) && type.children.length === other.children.length && instance7.compareManyFields(type.children, other.children);
|
|
7971
8378
|
}
|
|
7972
8379
|
function compareUnion(type, other) {
|
|
7973
|
-
return type === other || compareConstructor(type, other) && type.mode === other.mode && type.typeIds.every((
|
|
8380
|
+
return type === other || compareConstructor(type, other) && type.mode === other.mode && type.typeIds.every((x2, i) => x2 === other.typeIds[i]) && instance7.compareManyFields(type.children, other.children);
|
|
7974
8381
|
}
|
|
7975
8382
|
function compareDictionary(type, other) {
|
|
7976
8383
|
return type === other || compareConstructor(type, other) && type.id === other.id && type.isOrdered === other.isOrdered && instance7.visit(type.indices, other.indices) && instance7.visit(type.dictionary, other.dictionary);
|
|
@@ -7978,6 +8385,9 @@ function compareDictionary(type, other) {
|
|
|
7978
8385
|
function compareInterval(type, other) {
|
|
7979
8386
|
return type === other || compareConstructor(type, other) && type.unit === other.unit;
|
|
7980
8387
|
}
|
|
8388
|
+
function compareDuration(type, other) {
|
|
8389
|
+
return type === other || compareConstructor(type, other) && type.unit === other.unit;
|
|
8390
|
+
}
|
|
7981
8391
|
function compareFixedSizeList(type, other) {
|
|
7982
8392
|
return type === other || compareConstructor(type, other) && type.listSize === other.listSize && type.children.length === other.children.length && instance7.compareManyFields(type.children, other.children);
|
|
7983
8393
|
}
|
|
@@ -8025,6 +8435,11 @@ TypeComparator.prototype.visitDictionary = compareDictionary;
|
|
|
8025
8435
|
TypeComparator.prototype.visitInterval = compareInterval;
|
|
8026
8436
|
TypeComparator.prototype.visitIntervalDayTime = compareInterval;
|
|
8027
8437
|
TypeComparator.prototype.visitIntervalYearMonth = compareInterval;
|
|
8438
|
+
TypeComparator.prototype.visitDuration = compareDuration;
|
|
8439
|
+
TypeComparator.prototype.visitDurationSecond = compareDuration;
|
|
8440
|
+
TypeComparator.prototype.visitDurationMillisecond = compareDuration;
|
|
8441
|
+
TypeComparator.prototype.visitDurationMicrosecond = compareDuration;
|
|
8442
|
+
TypeComparator.prototype.visitDurationNanosecond = compareDuration;
|
|
8028
8443
|
TypeComparator.prototype.visitFixedSizeList = compareFixedSizeList;
|
|
8029
8444
|
TypeComparator.prototype.visitMap = compareMap;
|
|
8030
8445
|
var instance7 = new TypeComparator();
|
|
@@ -8135,26 +8550,26 @@ var Table = class _Table {
|
|
|
8135
8550
|
if (args.at(-1) instanceof Uint32Array) {
|
|
8136
8551
|
offsets = args.pop();
|
|
8137
8552
|
}
|
|
8138
|
-
const unwrap = (
|
|
8139
|
-
if (
|
|
8140
|
-
if (
|
|
8141
|
-
return [
|
|
8142
|
-
} else if (
|
|
8143
|
-
return
|
|
8144
|
-
} else if (
|
|
8145
|
-
if (
|
|
8146
|
-
return [new RecordBatch(new Schema2(
|
|
8553
|
+
const unwrap = (x2) => {
|
|
8554
|
+
if (x2) {
|
|
8555
|
+
if (x2 instanceof RecordBatch) {
|
|
8556
|
+
return [x2];
|
|
8557
|
+
} else if (x2 instanceof _Table) {
|
|
8558
|
+
return x2.batches;
|
|
8559
|
+
} else if (x2 instanceof Data) {
|
|
8560
|
+
if (x2.type instanceof Struct) {
|
|
8561
|
+
return [new RecordBatch(new Schema2(x2.type.children), x2)];
|
|
8147
8562
|
}
|
|
8148
|
-
} else if (Array.isArray(
|
|
8149
|
-
return
|
|
8150
|
-
} else if (typeof
|
|
8151
|
-
return [...
|
|
8152
|
-
} else if (typeof
|
|
8153
|
-
const keys = Object.keys(
|
|
8154
|
-
const vecs = keys.map((k) => new Vector([
|
|
8563
|
+
} else if (Array.isArray(x2)) {
|
|
8564
|
+
return x2.flatMap((v) => unwrap(v));
|
|
8565
|
+
} else if (typeof x2[Symbol.iterator] === "function") {
|
|
8566
|
+
return [...x2].flatMap((v) => unwrap(v));
|
|
8567
|
+
} else if (typeof x2 === "object") {
|
|
8568
|
+
const keys = Object.keys(x2);
|
|
8569
|
+
const vecs = keys.map((k) => new Vector([x2[k]]));
|
|
8155
8570
|
const schema2 = new Schema2(keys.map((k, i) => new Field2(String(k), vecs[i].type)));
|
|
8156
8571
|
const [, batches2] = distributeVectorsIntoRecordBatches(schema2, vecs);
|
|
8157
|
-
return batches2.length === 0 ? [new RecordBatch(
|
|
8572
|
+
return batches2.length === 0 ? [new RecordBatch(x2)] : batches2;
|
|
8158
8573
|
}
|
|
8159
8574
|
}
|
|
8160
8575
|
return [];
|
|
@@ -8356,7 +8771,7 @@ var Table = class _Table {
|
|
|
8356
8771
|
*/
|
|
8357
8772
|
select(columnNames) {
|
|
8358
8773
|
const nameToIndex = this.schema.fields.reduce((m, f, i) => m.set(f.name, i), /* @__PURE__ */ new Map());
|
|
8359
|
-
return this.selectAt(columnNames.map((columnName) => nameToIndex.get(columnName)).filter((
|
|
8774
|
+
return this.selectAt(columnNames.map((columnName) => nameToIndex.get(columnName)).filter((x2) => x2 > -1));
|
|
8360
8775
|
}
|
|
8361
8776
|
/**
|
|
8362
8777
|
* Construct a new Table containing only columns at the specified indices.
|
|
@@ -8635,22 +9050,25 @@ function ensureSameLengthData(schema, chunks, maxLength = chunks.reduce((max2, c
|
|
|
8635
9050
|
];
|
|
8636
9051
|
}
|
|
8637
9052
|
function collectDictionaries(fields, children, dictionaries = /* @__PURE__ */ new Map()) {
|
|
8638
|
-
|
|
8639
|
-
|
|
8640
|
-
|
|
8641
|
-
|
|
8642
|
-
|
|
8643
|
-
|
|
8644
|
-
|
|
8645
|
-
|
|
9053
|
+
var _b2, _c2;
|
|
9054
|
+
if (((_b2 = fields === null || fields === void 0 ? void 0 : fields.length) !== null && _b2 !== void 0 ? _b2 : 0) > 0 && (fields === null || fields === void 0 ? void 0 : fields.length) === (children === null || children === void 0 ? void 0 : children.length)) {
|
|
9055
|
+
for (let i = -1, n = fields.length; ++i < n; ) {
|
|
9056
|
+
const { type } = fields[i];
|
|
9057
|
+
const data = children[i];
|
|
9058
|
+
for (const next of [data, ...((_c2 = data === null || data === void 0 ? void 0 : data.dictionary) === null || _c2 === void 0 ? void 0 : _c2.data) || []]) {
|
|
9059
|
+
collectDictionaries(type.children, next === null || next === void 0 ? void 0 : next.children, dictionaries);
|
|
9060
|
+
}
|
|
9061
|
+
if (DataType.isDictionary(type)) {
|
|
9062
|
+
const { id } = type;
|
|
9063
|
+
if (!dictionaries.has(id)) {
|
|
9064
|
+
if (data === null || data === void 0 ? void 0 : data.dictionary) {
|
|
9065
|
+
dictionaries.set(id, data.dictionary);
|
|
9066
|
+
}
|
|
9067
|
+
} else if (dictionaries.get(id) !== data.dictionary) {
|
|
9068
|
+
throw new Error(`Cannot create Schema containing two different dictionaries with the same Id`);
|
|
8646
9069
|
}
|
|
8647
|
-
} else if (dictionaries.get(type.id) !== data.dictionary) {
|
|
8648
|
-
throw new Error(`Cannot create Schema containing two different dictionaries with the same Id`);
|
|
8649
9070
|
}
|
|
8650
9071
|
}
|
|
8651
|
-
if (type.children && type.children.length > 0) {
|
|
8652
|
-
collectDictionaries(type.children, data.children, dictionaries);
|
|
8653
|
-
}
|
|
8654
9072
|
}
|
|
8655
9073
|
return dictionaries;
|
|
8656
9074
|
}
|
|
@@ -9111,6 +9529,11 @@ var TypeAssembler = class extends Visitor {
|
|
|
9111
9529
|
Interval.addUnit(b, node.unit);
|
|
9112
9530
|
return Interval.endInterval(b);
|
|
9113
9531
|
}
|
|
9532
|
+
visitDuration(node, b) {
|
|
9533
|
+
Duration2.startDuration(b);
|
|
9534
|
+
Duration2.addUnit(b, node.unit);
|
|
9535
|
+
return Duration2.endDuration(b);
|
|
9536
|
+
}
|
|
9114
9537
|
visitList(_node, b) {
|
|
9115
9538
|
List2.startList(b);
|
|
9116
9539
|
return List2.endList(b);
|
|
@@ -9157,7 +9580,7 @@ var instance8 = new TypeAssembler();
|
|
|
9157
9580
|
|
|
9158
9581
|
// ../../node_modules/apache-arrow/ipc/metadata/json.mjs
|
|
9159
9582
|
function schemaFromJSON(_schema, dictionaries = /* @__PURE__ */ new Map()) {
|
|
9160
|
-
return new Schema2(schemaFieldsFromJSON(_schema, dictionaries), customMetadataFromJSON(_schema["
|
|
9583
|
+
return new Schema2(schemaFieldsFromJSON(_schema, dictionaries), customMetadataFromJSON(_schema["metadata"]), dictionaries);
|
|
9161
9584
|
}
|
|
9162
9585
|
function recordBatchFromJSON(b) {
|
|
9163
9586
|
return new RecordBatch3(b["count"], fieldNodesFromJSON(b["columns"]), buffersFromJSON(b["columns"]));
|
|
@@ -9182,7 +9605,7 @@ function buffersFromJSON(xs, buffers = []) {
|
|
|
9182
9605
|
for (let i = -1, n = (xs || []).length; ++i < n; ) {
|
|
9183
9606
|
const column2 = xs[i];
|
|
9184
9607
|
column2["VALIDITY"] && buffers.push(new BufferRegion(buffers.length, column2["VALIDITY"].length));
|
|
9185
|
-
column2["
|
|
9608
|
+
column2["TYPE_ID"] && buffers.push(new BufferRegion(buffers.length, column2["TYPE_ID"].length));
|
|
9186
9609
|
column2["OFFSET"] && buffers.push(new BufferRegion(buffers.length, column2["OFFSET"].length));
|
|
9187
9610
|
column2["DATA"] && buffers.push(new BufferRegion(buffers.length, column2["DATA"].length));
|
|
9188
9611
|
buffers = buffersFromJSON(column2["children"], buffers);
|
|
@@ -9201,21 +9624,21 @@ function fieldFromJSON(_field, dictionaries) {
|
|
|
9201
9624
|
let dictType;
|
|
9202
9625
|
if (!dictionaries || !(dictMeta = _field["dictionary"])) {
|
|
9203
9626
|
type = typeFromJSON(_field, fieldChildrenFromJSON(_field, dictionaries));
|
|
9204
|
-
field = new Field2(_field["name"], type, _field["nullable"], customMetadataFromJSON(_field["
|
|
9627
|
+
field = new Field2(_field["name"], type, _field["nullable"], customMetadataFromJSON(_field["metadata"]));
|
|
9205
9628
|
} else if (!dictionaries.has(id = dictMeta["id"])) {
|
|
9206
9629
|
keys = (keys = dictMeta["indexType"]) ? indexTypeFromJSON(keys) : new Int32();
|
|
9207
9630
|
dictionaries.set(id, type = typeFromJSON(_field, fieldChildrenFromJSON(_field, dictionaries)));
|
|
9208
9631
|
dictType = new Dictionary(type, keys, id, dictMeta["isOrdered"]);
|
|
9209
|
-
field = new Field2(_field["name"], dictType, _field["nullable"], customMetadataFromJSON(_field["
|
|
9632
|
+
field = new Field2(_field["name"], dictType, _field["nullable"], customMetadataFromJSON(_field["metadata"]));
|
|
9210
9633
|
} else {
|
|
9211
9634
|
keys = (keys = dictMeta["indexType"]) ? indexTypeFromJSON(keys) : new Int32();
|
|
9212
9635
|
dictType = new Dictionary(dictionaries.get(id), keys, id, dictMeta["isOrdered"]);
|
|
9213
|
-
field = new Field2(_field["name"], dictType, _field["nullable"], customMetadataFromJSON(_field["
|
|
9636
|
+
field = new Field2(_field["name"], dictType, _field["nullable"], customMetadataFromJSON(_field["metadata"]));
|
|
9214
9637
|
}
|
|
9215
9638
|
return field || null;
|
|
9216
9639
|
}
|
|
9217
|
-
function customMetadataFromJSON(
|
|
9218
|
-
return new Map(
|
|
9640
|
+
function customMetadataFromJSON(metadata = []) {
|
|
9641
|
+
return new Map(metadata.map(({ key, value }) => [key, value]));
|
|
9219
9642
|
}
|
|
9220
9643
|
function indexTypeFromJSON(_type) {
|
|
9221
9644
|
return new Int_(_type["isSigned"], _type["bitWidth"]);
|
|
@@ -9269,9 +9692,15 @@ function typeFromJSON(f, children) {
|
|
|
9269
9692
|
const t = f["type"];
|
|
9270
9693
|
return new Interval_(IntervalUnit[t["unit"]]);
|
|
9271
9694
|
}
|
|
9695
|
+
case "duration": {
|
|
9696
|
+
const t = f["type"];
|
|
9697
|
+
return new Duration(TimeUnit[t["unit"]]);
|
|
9698
|
+
}
|
|
9272
9699
|
case "union": {
|
|
9273
9700
|
const t = f["type"];
|
|
9274
|
-
|
|
9701
|
+
const [m, ...ms] = (t["mode"] + "").toLowerCase();
|
|
9702
|
+
const mode2 = m.toUpperCase() + ms.join("");
|
|
9703
|
+
return new Union_(UnionMode[mode2], t["typeIds"] || [], children || []);
|
|
9275
9704
|
}
|
|
9276
9705
|
case "fixedsizebinary": {
|
|
9277
9706
|
const t = f["type"];
|
|
@@ -9295,7 +9724,7 @@ var ByteBuffer3 = ByteBuffer;
|
|
|
9295
9724
|
var Message2 = class _Message {
|
|
9296
9725
|
/** @nocollapse */
|
|
9297
9726
|
static fromJSON(msg, headerType) {
|
|
9298
|
-
const message = new _Message(0, MetadataVersion.
|
|
9727
|
+
const message = new _Message(0, MetadataVersion.V5, headerType);
|
|
9299
9728
|
message._createHeader = messageHeaderFromJSON(msg, headerType);
|
|
9300
9729
|
return message;
|
|
9301
9730
|
}
|
|
@@ -9322,7 +9751,7 @@ var Message2 = class _Message {
|
|
|
9322
9751
|
headerOffset = DictionaryBatch2.encode(b, message.header());
|
|
9323
9752
|
}
|
|
9324
9753
|
Message.startMessage(b);
|
|
9325
|
-
Message.addVersion(b, MetadataVersion.
|
|
9754
|
+
Message.addVersion(b, MetadataVersion.V5);
|
|
9326
9755
|
Message.addHeader(b, headerOffset);
|
|
9327
9756
|
Message.addHeaderType(b, message.headerType);
|
|
9328
9757
|
Message.addBodyLength(b, BigInt(message.bodyLength));
|
|
@@ -9332,13 +9761,13 @@ var Message2 = class _Message {
|
|
|
9332
9761
|
/** @nocollapse */
|
|
9333
9762
|
static from(header, bodyLength = 0) {
|
|
9334
9763
|
if (header instanceof Schema2) {
|
|
9335
|
-
return new _Message(0, MetadataVersion.
|
|
9764
|
+
return new _Message(0, MetadataVersion.V5, MessageHeader.Schema, header);
|
|
9336
9765
|
}
|
|
9337
9766
|
if (header instanceof RecordBatch3) {
|
|
9338
|
-
return new _Message(bodyLength, MetadataVersion.
|
|
9767
|
+
return new _Message(bodyLength, MetadataVersion.V5, MessageHeader.RecordBatch, header);
|
|
9339
9768
|
}
|
|
9340
9769
|
if (header instanceof DictionaryBatch2) {
|
|
9341
|
-
return new _Message(bodyLength, MetadataVersion.
|
|
9770
|
+
return new _Message(bodyLength, MetadataVersion.V5, MessageHeader.DictionaryBatch, header);
|
|
9342
9771
|
}
|
|
9343
9772
|
throw new Error(`Unrecognized Message header: ${header}`);
|
|
9344
9773
|
}
|
|
@@ -9444,7 +9873,7 @@ function decodeMessageHeader(message, type) {
|
|
|
9444
9873
|
return () => {
|
|
9445
9874
|
switch (type) {
|
|
9446
9875
|
case MessageHeader.Schema:
|
|
9447
|
-
return Schema2.decode(message.header(new Schema()));
|
|
9876
|
+
return Schema2.decode(message.header(new Schema()), /* @__PURE__ */ new Map(), message.version());
|
|
9448
9877
|
case MessageHeader.RecordBatch:
|
|
9449
9878
|
return RecordBatch3.decode(message.header(new RecordBatch2()), message.version());
|
|
9450
9879
|
case MessageHeader.DictionaryBatch:
|
|
@@ -9469,17 +9898,17 @@ FieldNode2["encode"] = encodeFieldNode;
|
|
|
9469
9898
|
FieldNode2["decode"] = decodeFieldNode;
|
|
9470
9899
|
BufferRegion["encode"] = encodeBufferRegion;
|
|
9471
9900
|
BufferRegion["decode"] = decodeBufferRegion;
|
|
9472
|
-
function decodeSchema(_schema, dictionaries = /* @__PURE__ */ new Map()) {
|
|
9901
|
+
function decodeSchema(_schema, dictionaries = /* @__PURE__ */ new Map(), version = MetadataVersion.V5) {
|
|
9473
9902
|
const fields = decodeSchemaFields(_schema, dictionaries);
|
|
9474
|
-
return new Schema2(fields, decodeCustomMetadata(_schema), dictionaries);
|
|
9903
|
+
return new Schema2(fields, decodeCustomMetadata(_schema), dictionaries, version);
|
|
9475
9904
|
}
|
|
9476
|
-
function decodeRecordBatch(batch, version = MetadataVersion.
|
|
9905
|
+
function decodeRecordBatch(batch, version = MetadataVersion.V5) {
|
|
9477
9906
|
if (batch.compression() !== null) {
|
|
9478
9907
|
throw new Error("Record batch compression not implemented");
|
|
9479
9908
|
}
|
|
9480
9909
|
return new RecordBatch3(batch.length(), decodeFieldNodes(batch), decodeBuffers(batch, version));
|
|
9481
9910
|
}
|
|
9482
|
-
function decodeDictionaryBatch(batch, version = MetadataVersion.
|
|
9911
|
+
function decodeDictionaryBatch(batch, version = MetadataVersion.V5) {
|
|
9483
9912
|
return new DictionaryBatch2(RecordBatch3.decode(batch.data(), version), batch.id(), batch.isDelta());
|
|
9484
9913
|
}
|
|
9485
9914
|
function decodeBufferRegion(b) {
|
|
@@ -9610,6 +10039,10 @@ function decodeFieldType(f, children) {
|
|
|
9610
10039
|
const t = f.type(new Interval());
|
|
9611
10040
|
return new Interval_(t.unit());
|
|
9612
10041
|
}
|
|
10042
|
+
case Type2["Duration"]: {
|
|
10043
|
+
const t = f.type(new Duration2());
|
|
10044
|
+
return new Duration(t.unit());
|
|
10045
|
+
}
|
|
9613
10046
|
case Type2["Union"]: {
|
|
9614
10047
|
const t = f.type(new Union());
|
|
9615
10048
|
return new Union_(t.mode(), t.typeIdsArray() || [], children || []);
|
|
@@ -9943,7 +10376,7 @@ var JSONMessageReader = class extends MessageReader {
|
|
|
9943
10376
|
return (xs || []).reduce((buffers, column2) => [
|
|
9944
10377
|
...buffers,
|
|
9945
10378
|
...column2["VALIDITY"] && [column2["VALIDITY"]] || [],
|
|
9946
|
-
...column2["
|
|
10379
|
+
...column2["TYPE_ID"] && [column2["TYPE_ID"]] || [],
|
|
9947
10380
|
...column2["OFFSET"] && [column2["OFFSET"]] || [],
|
|
9948
10381
|
...column2["DATA"] && [column2["DATA"]] || [],
|
|
9949
10382
|
...flattenDataSources(column2["children"])
|
|
@@ -10216,7 +10649,7 @@ var RecordBatchReaderImpl = class {
|
|
|
10216
10649
|
return dictionary.memoize();
|
|
10217
10650
|
}
|
|
10218
10651
|
_loadVectors(header, body, types) {
|
|
10219
|
-
return new VectorLoader(body, header.nodes, header.buffers, this.dictionaries).visitMany(types);
|
|
10652
|
+
return new VectorLoader(body, header.nodes, header.buffers, this.dictionaries, this.schema.metadataVersion).visitMany(types);
|
|
10220
10653
|
}
|
|
10221
10654
|
};
|
|
10222
10655
|
var RecordBatchStreamReaderImpl = class extends RecordBatchReaderImpl {
|
|
@@ -10565,7 +10998,7 @@ var RecordBatchJSONReaderImpl = class extends RecordBatchStreamReaderImpl {
|
|
|
10565
10998
|
super(source, dictionaries);
|
|
10566
10999
|
}
|
|
10567
11000
|
_loadVectors(header, body, types) {
|
|
10568
|
-
return new JSONVectorLoader(body, header.nodes, header.buffers, this.dictionaries).visitMany(types);
|
|
11001
|
+
return new JSONVectorLoader(body, header.nodes, header.buffers, this.dictionaries, this.schema.metadataVersion).visitMany(types);
|
|
10569
11002
|
}
|
|
10570
11003
|
};
|
|
10571
11004
|
function shouldAutoDestroy(self, options) {
|
|
@@ -10648,14 +11081,19 @@ var VectorAssembler = class _VectorAssembler extends Visitor {
|
|
|
10648
11081
|
}
|
|
10649
11082
|
const { type } = data;
|
|
10650
11083
|
if (!DataType.isDictionary(type)) {
|
|
10651
|
-
const { length: length2
|
|
11084
|
+
const { length: length2 } = data;
|
|
10652
11085
|
if (length2 > 2147483647) {
|
|
10653
11086
|
throw new RangeError("Cannot write arrays larger than 2^31 - 1 in length");
|
|
10654
11087
|
}
|
|
10655
|
-
if (
|
|
10656
|
-
|
|
11088
|
+
if (DataType.isUnion(type)) {
|
|
11089
|
+
this.nodes.push(new FieldNode2(length2, 0));
|
|
11090
|
+
} else {
|
|
11091
|
+
const { nullCount } = data;
|
|
11092
|
+
if (!DataType.isNull(type)) {
|
|
11093
|
+
addBuffer.call(this, nullCount <= 0 ? new Uint8Array(0) : truncateBitmap(data.offset, length2, data.nullBitmap));
|
|
11094
|
+
}
|
|
11095
|
+
this.nodes.push(new FieldNode2(length2, nullCount));
|
|
10657
11096
|
}
|
|
10658
|
-
this.nodes.push(new FieldNode2(length2, nullCount));
|
|
10659
11097
|
}
|
|
10660
11098
|
return super.visit(data);
|
|
10661
11099
|
}
|
|
@@ -10686,6 +11124,7 @@ function addBuffer(values) {
|
|
|
10686
11124
|
return this;
|
|
10687
11125
|
}
|
|
10688
11126
|
function assembleUnion(data) {
|
|
11127
|
+
var _a5;
|
|
10689
11128
|
const { type, length: length2, typeIds, valueOffsets } = data;
|
|
10690
11129
|
addBuffer.call(this, typeIds);
|
|
10691
11130
|
if (type.mode === UnionMode.Sparse) {
|
|
@@ -10695,26 +11134,26 @@ function assembleUnion(data) {
|
|
|
10695
11134
|
addBuffer.call(this, valueOffsets);
|
|
10696
11135
|
return assembleNestedVector.call(this, data);
|
|
10697
11136
|
} else {
|
|
10698
|
-
const maxChildTypeId = typeIds.reduce((x, y) => Math.max(x, y), typeIds[0]);
|
|
10699
|
-
const childLengths = new Int32Array(maxChildTypeId + 1);
|
|
10700
|
-
const childOffsets = new Int32Array(maxChildTypeId + 1).fill(-1);
|
|
10701
11137
|
const shiftedOffsets = new Int32Array(length2);
|
|
10702
|
-
const
|
|
11138
|
+
const childOffsets = /* @__PURE__ */ Object.create(null);
|
|
11139
|
+
const childLengths = /* @__PURE__ */ Object.create(null);
|
|
10703
11140
|
for (let typeId, shift, index = -1; ++index < length2; ) {
|
|
10704
|
-
if ((
|
|
10705
|
-
|
|
11141
|
+
if ((typeId = typeIds[index]) === void 0) {
|
|
11142
|
+
continue;
|
|
10706
11143
|
}
|
|
10707
|
-
|
|
10708
|
-
|
|
10709
|
-
}
|
|
10710
|
-
addBuffer.call(this, shiftedOffsets);
|
|
10711
|
-
for (let child, childIndex = -1, numChildren = type.children.length; ++childIndex < numChildren; ) {
|
|
10712
|
-
if (child = data.children[childIndex]) {
|
|
10713
|
-
const typeId = type.typeIds[childIndex];
|
|
10714
|
-
const childLength = Math.min(length2, childLengths[typeId]);
|
|
10715
|
-
this.visit(child.slice(childOffsets[typeId], childLength));
|
|
11144
|
+
if ((shift = childOffsets[typeId]) === void 0) {
|
|
11145
|
+
shift = childOffsets[typeId] = valueOffsets[index];
|
|
10716
11146
|
}
|
|
11147
|
+
shiftedOffsets[index] = valueOffsets[index] - shift;
|
|
11148
|
+
childLengths[typeId] = ((_a5 = childLengths[typeId]) !== null && _a5 !== void 0 ? _a5 : 0) + 1;
|
|
10717
11149
|
}
|
|
11150
|
+
addBuffer.call(this, shiftedOffsets);
|
|
11151
|
+
this.visitMany(data.children.map((child, childIndex) => {
|
|
11152
|
+
const typeId = type.typeIds[childIndex];
|
|
11153
|
+
const childOffset = childOffsets[typeId];
|
|
11154
|
+
const childLength = childLengths[typeId];
|
|
11155
|
+
return child.slice(childOffset, Math.min(length2, childLength));
|
|
11156
|
+
}));
|
|
10718
11157
|
}
|
|
10719
11158
|
}
|
|
10720
11159
|
return this;
|
|
@@ -10733,17 +11172,18 @@ function assembleFlatVector(data) {
|
|
|
10733
11172
|
}
|
|
10734
11173
|
function assembleFlatListVector(data) {
|
|
10735
11174
|
const { length: length2, values, valueOffsets } = data;
|
|
10736
|
-
const
|
|
10737
|
-
const
|
|
10738
|
-
|
|
10739
|
-
addBuffer.call(this,
|
|
10740
|
-
addBuffer.call(this, values.subarray(firstOffset, firstOffset + byteLength));
|
|
11175
|
+
const { [0]: begin, [length2]: end } = valueOffsets;
|
|
11176
|
+
const byteLength = Math.min(end - begin, values.byteLength - begin);
|
|
11177
|
+
addBuffer.call(this, rebaseValueOffsets(-begin, length2 + 1, valueOffsets));
|
|
11178
|
+
addBuffer.call(this, values.subarray(begin, begin + byteLength));
|
|
10741
11179
|
return this;
|
|
10742
11180
|
}
|
|
10743
11181
|
function assembleListVector(data) {
|
|
10744
11182
|
const { length: length2, valueOffsets } = data;
|
|
10745
11183
|
if (valueOffsets) {
|
|
10746
|
-
|
|
11184
|
+
const { [0]: begin, [length2]: end } = valueOffsets;
|
|
11185
|
+
addBuffer.call(this, rebaseValueOffsets(-begin, length2 + 1, valueOffsets));
|
|
11186
|
+
return this.visit(data.children[0].slice(begin, end - begin));
|
|
10747
11187
|
}
|
|
10748
11188
|
return this.visit(data.children[0]);
|
|
10749
11189
|
}
|
|
@@ -10764,6 +11204,7 @@ VectorAssembler.prototype.visitList = assembleListVector;
|
|
|
10764
11204
|
VectorAssembler.prototype.visitStruct = assembleNestedVector;
|
|
10765
11205
|
VectorAssembler.prototype.visitUnion = assembleUnion;
|
|
10766
11206
|
VectorAssembler.prototype.visitInterval = assembleFlatVector;
|
|
11207
|
+
VectorAssembler.prototype.visitDuration = assembleFlatVector;
|
|
10767
11208
|
VectorAssembler.prototype.visitFixedSizeList = assembleListVector;
|
|
10768
11209
|
VectorAssembler.prototype.visitMap = assembleListVector;
|
|
10769
11210
|
|
|
@@ -10799,7 +11240,7 @@ var RecordBatchWriter = class extends ReadableInterop {
|
|
|
10799
11240
|
}
|
|
10800
11241
|
writeAll(input2) {
|
|
10801
11242
|
if (isPromise(input2)) {
|
|
10802
|
-
return input2.then((
|
|
11243
|
+
return input2.then((x2) => this.writeAll(x2));
|
|
10803
11244
|
} else if (isAsyncIterable(input2)) {
|
|
10804
11245
|
return writeAllAsync(this, input2);
|
|
10805
11246
|
}
|
|
@@ -10973,7 +11414,7 @@ var RecordBatchStreamWriter = class _RecordBatchStreamWriter extends RecordBatch
|
|
|
10973
11414
|
static writeAll(input2, options) {
|
|
10974
11415
|
const writer = new _RecordBatchStreamWriter(options);
|
|
10975
11416
|
if (isPromise(input2)) {
|
|
10976
|
-
return input2.then((
|
|
11417
|
+
return input2.then((x2) => writer.writeAll(x2));
|
|
10977
11418
|
} else if (isAsyncIterable(input2)) {
|
|
10978
11419
|
return writeAllAsync(writer, input2);
|
|
10979
11420
|
}
|
|
@@ -10985,7 +11426,7 @@ var RecordBatchFileWriter = class _RecordBatchFileWriter extends RecordBatchWrit
|
|
|
10985
11426
|
static writeAll(input2) {
|
|
10986
11427
|
const writer = new _RecordBatchFileWriter();
|
|
10987
11428
|
if (isPromise(input2)) {
|
|
10988
|
-
return input2.then((
|
|
11429
|
+
return input2.then((x2) => writer.writeAll(x2));
|
|
10989
11430
|
} else if (isAsyncIterable(input2)) {
|
|
10990
11431
|
return writeAllAsync(writer, input2);
|
|
10991
11432
|
}
|
|
@@ -11000,7 +11441,7 @@ var RecordBatchFileWriter = class _RecordBatchFileWriter extends RecordBatchWrit
|
|
|
11000
11441
|
return this._writeMagic()._writePadding(2);
|
|
11001
11442
|
}
|
|
11002
11443
|
_writeFooter(schema) {
|
|
11003
|
-
const buffer = Footer_.encode(new Footer_(schema, MetadataVersion.
|
|
11444
|
+
const buffer = Footer_.encode(new Footer_(schema, MetadataVersion.V5, this._recordBatchBlocks, this._dictionaryBlocks));
|
|
11004
11445
|
return super._writeFooter(schema)._write(buffer)._write(Int32Array.of(buffer.byteLength))._writeMagic();
|
|
11005
11446
|
}
|
|
11006
11447
|
};
|
|
@@ -11297,7 +11738,7 @@ function tableFromIPC(input2) {
|
|
|
11297
11738
|
}
|
|
11298
11739
|
|
|
11299
11740
|
// ../../node_modules/apache-arrow/Arrow.mjs
|
|
11300
|
-
var util = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, bn_exports), int_exports), bit_exports), math_exports), buffer_exports), vector_exports), {
|
|
11741
|
+
var util = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, bn_exports), int_exports), bit_exports), math_exports), buffer_exports), vector_exports), pretty_exports), {
|
|
11301
11742
|
compareSchemas,
|
|
11302
11743
|
compareFields,
|
|
11303
11744
|
compareTypes
|
|
@@ -11467,10 +11908,10 @@ function literalToSQL(value) {
|
|
|
11467
11908
|
const ts = +value;
|
|
11468
11909
|
if (Number.isNaN(ts))
|
|
11469
11910
|
return "NULL";
|
|
11470
|
-
const
|
|
11911
|
+
const y2 = value.getUTCFullYear();
|
|
11471
11912
|
const m = value.getUTCMonth();
|
|
11472
11913
|
const d = value.getUTCDate();
|
|
11473
|
-
return ts === Date.UTC(
|
|
11914
|
+
return ts === Date.UTC(y2, m, d) ? `MAKE_DATE(${y2}, ${m + 1}, ${d})` : `EPOCH_MS(${ts})`;
|
|
11474
11915
|
} else if (value instanceof RegExp) {
|
|
11475
11916
|
return `'${value.source}'`;
|
|
11476
11917
|
} else {
|
|
@@ -11617,7 +12058,7 @@ function visit(callback) {
|
|
|
11617
12058
|
this.children?.forEach((v) => v.visit(callback));
|
|
11618
12059
|
}
|
|
11619
12060
|
function logical(op, clauses) {
|
|
11620
|
-
const children = clauses.filter((
|
|
12061
|
+
const children = clauses.filter((x2) => x2 != null).map(asColumn);
|
|
11621
12062
|
const strings = children.map((c, i) => i ? ` ${op} ` : "");
|
|
11622
12063
|
if (children.length === 1) {
|
|
11623
12064
|
strings.push("");
|
|
@@ -11706,7 +12147,7 @@ var WindowFunction = class _WindowFunction extends SQLExpression {
|
|
|
11706
12147
|
return new _WindowFunction(op, func, type, name, group, order, frame);
|
|
11707
12148
|
}
|
|
11708
12149
|
partitionby(...expr) {
|
|
11709
|
-
const exprs = expr.flat().filter((
|
|
12150
|
+
const exprs = expr.flat().filter((x2) => x2).map(asColumn);
|
|
11710
12151
|
const group = sql(
|
|
11711
12152
|
["PARTITION BY ", repeat(exprs.length - 1, ", "), ""],
|
|
11712
12153
|
...exprs
|
|
@@ -11715,7 +12156,7 @@ var WindowFunction = class _WindowFunction extends SQLExpression {
|
|
|
11715
12156
|
return new _WindowFunction(op, func, type, name, group, order, frame);
|
|
11716
12157
|
}
|
|
11717
12158
|
orderby(...expr) {
|
|
11718
|
-
const exprs = expr.flat().filter((
|
|
12159
|
+
const exprs = expr.flat().filter((x2) => x2).map(asColumn);
|
|
11719
12160
|
const order = sql(
|
|
11720
12161
|
["ORDER BY ", repeat(exprs.length - 1, ", "), ""],
|
|
11721
12162
|
...exprs
|
|
@@ -11874,6 +12315,12 @@ var epoch_ms = (expr) => {
|
|
|
11874
12315
|
return sql`(1000 * (epoch(${d}) - second(${d})) + millisecond(${d}))::DOUBLE`;
|
|
11875
12316
|
};
|
|
11876
12317
|
|
|
12318
|
+
// ../sql/src/spatial.js
|
|
12319
|
+
var geojson = functionCall("ST_AsGeoJSON");
|
|
12320
|
+
var x = functionCall("ST_X");
|
|
12321
|
+
var y = functionCall("ST_Y");
|
|
12322
|
+
var centroid = functionCall("ST_CENTROID");
|
|
12323
|
+
|
|
11877
12324
|
// ../sql/src/Query.js
|
|
11878
12325
|
var Query = class _Query {
|
|
11879
12326
|
static select(...expr) {
|
|
@@ -12021,7 +12468,7 @@ var Query = class _Query {
|
|
|
12021
12468
|
return query.where;
|
|
12022
12469
|
} else {
|
|
12023
12470
|
query.where = query.where.concat(
|
|
12024
|
-
expr.flat().filter((
|
|
12471
|
+
expr.flat().filter((x2) => x2)
|
|
12025
12472
|
);
|
|
12026
12473
|
return this;
|
|
12027
12474
|
}
|
|
@@ -12036,7 +12483,7 @@ var Query = class _Query {
|
|
|
12036
12483
|
return query.groupby;
|
|
12037
12484
|
} else {
|
|
12038
12485
|
query.groupby = query.groupby.concat(
|
|
12039
|
-
expr.flat().filter((
|
|
12486
|
+
expr.flat().filter((x2) => x2).map(asColumn)
|
|
12040
12487
|
);
|
|
12041
12488
|
return this;
|
|
12042
12489
|
}
|
|
@@ -12051,7 +12498,7 @@ var Query = class _Query {
|
|
|
12051
12498
|
return query.having;
|
|
12052
12499
|
} else {
|
|
12053
12500
|
query.having = query.having.concat(
|
|
12054
|
-
expr.flat().filter((
|
|
12501
|
+
expr.flat().filter((x2) => x2)
|
|
12055
12502
|
);
|
|
12056
12503
|
return this;
|
|
12057
12504
|
}
|
|
@@ -12080,7 +12527,7 @@ var Query = class _Query {
|
|
|
12080
12527
|
return query.qualify;
|
|
12081
12528
|
} else {
|
|
12082
12529
|
query.qualify = query.qualify.concat(
|
|
12083
|
-
expr.flat().filter((
|
|
12530
|
+
expr.flat().filter((x2) => x2)
|
|
12084
12531
|
);
|
|
12085
12532
|
return this;
|
|
12086
12533
|
}
|
|
@@ -12091,7 +12538,7 @@ var Query = class _Query {
|
|
|
12091
12538
|
return query.orderby;
|
|
12092
12539
|
} else {
|
|
12093
12540
|
query.orderby = query.orderby.concat(
|
|
12094
|
-
expr.flat().filter((
|
|
12541
|
+
expr.flat().filter((x2) => x2).map(asColumn)
|
|
12095
12542
|
);
|
|
12096
12543
|
return this;
|
|
12097
12544
|
}
|
|
@@ -12162,7 +12609,7 @@ var Query = class _Query {
|
|
|
12162
12609
|
sql2.push(`FROM ${rels.join(", ")}`);
|
|
12163
12610
|
}
|
|
12164
12611
|
if (where.length) {
|
|
12165
|
-
const clauses = where.map(String).filter((
|
|
12612
|
+
const clauses = where.map(String).filter((x2) => x2).join(" AND ");
|
|
12166
12613
|
if (clauses)
|
|
12167
12614
|
sql2.push(`WHERE ${clauses}`);
|
|
12168
12615
|
}
|
|
@@ -12176,7 +12623,7 @@ var Query = class _Query {
|
|
|
12176
12623
|
sql2.push(`GROUP BY ${groupby.join(", ")}`);
|
|
12177
12624
|
}
|
|
12178
12625
|
if (having.length) {
|
|
12179
|
-
const clauses = having.map(String).filter((
|
|
12626
|
+
const clauses = having.map(String).filter((x2) => x2).join(" AND ");
|
|
12180
12627
|
if (clauses)
|
|
12181
12628
|
sql2.push(`HAVING ${clauses}`);
|
|
12182
12629
|
}
|
|
@@ -12185,7 +12632,7 @@ var Query = class _Query {
|
|
|
12185
12632
|
sql2.push(`WINDOW ${windows.join(", ")}`);
|
|
12186
12633
|
}
|
|
12187
12634
|
if (qualify.length) {
|
|
12188
|
-
const clauses = qualify.map(String).filter((
|
|
12635
|
+
const clauses = qualify.map(String).filter((x2) => x2).join(" AND ");
|
|
12189
12636
|
if (clauses)
|
|
12190
12637
|
sql2.push(`QUALIFY ${clauses}`);
|
|
12191
12638
|
}
|
|
@@ -12218,7 +12665,7 @@ var SetOperation = class _SetOperation {
|
|
|
12218
12665
|
return query.orderby;
|
|
12219
12666
|
} else {
|
|
12220
12667
|
query.orderby = query.orderby.concat(
|
|
12221
|
-
expr.flat().filter((
|
|
12668
|
+
expr.flat().filter((x2) => x2).map(asColumn)
|
|
12222
12669
|
);
|
|
12223
12670
|
return this;
|
|
12224
12671
|
}
|
|
@@ -12303,6 +12750,7 @@ function jsType(type) {
|
|
|
12303
12750
|
case "TIMESTAMPTZ":
|
|
12304
12751
|
case "TIMESTAMP WITH TIME ZONE":
|
|
12305
12752
|
case "TIME":
|
|
12753
|
+
case "TIMESTAMP_NS":
|
|
12306
12754
|
return "date";
|
|
12307
12755
|
case "BOOLEAN":
|
|
12308
12756
|
return "boolean";
|
|
@@ -12381,7 +12829,7 @@ var Catalog = class {
|
|
|
12381
12829
|
async queryFields(fields) {
|
|
12382
12830
|
const list = await resolveFields(this, fields);
|
|
12383
12831
|
const data = await Promise.all(list.map((f) => this.fieldInfo(f)));
|
|
12384
|
-
return data.filter((
|
|
12832
|
+
return data.filter((x2) => x2);
|
|
12385
12833
|
}
|
|
12386
12834
|
};
|
|
12387
12835
|
async function getTableInfo(mc, table2) {
|
|
@@ -12430,7 +12878,7 @@ function fnv_mix(a) {
|
|
|
12430
12878
|
}
|
|
12431
12879
|
|
|
12432
12880
|
// ../core/src/DataCubeIndexer.js
|
|
12433
|
-
var identity = (
|
|
12881
|
+
var identity = (x2) => x2;
|
|
12434
12882
|
var DataCubeIndexer = class {
|
|
12435
12883
|
/**
|
|
12436
12884
|
*
|
|
@@ -12559,7 +13007,7 @@ function binInterval(scale, pixelSize) {
|
|
|
12559
13007
|
toSql = (c) => sql`LN(${asColumn(c)})`;
|
|
12560
13008
|
break;
|
|
12561
13009
|
case "symlog":
|
|
12562
|
-
lift = (
|
|
13010
|
+
lift = (x2) => Math.sign(x2) * Math.log1p(Math.abs(x2));
|
|
12563
13011
|
toSql = (c) => (c = asColumn(c), sql`SIGN(${c}) * LN(1 + ABS(${c}))`);
|
|
12564
13012
|
break;
|
|
12565
13013
|
case "sqrt":
|
|
@@ -12568,7 +13016,7 @@ function binInterval(scale, pixelSize) {
|
|
|
12568
13016
|
break;
|
|
12569
13017
|
case "utc":
|
|
12570
13018
|
case "time":
|
|
12571
|
-
lift = (
|
|
13019
|
+
lift = (x2) => +x2;
|
|
12572
13020
|
toSql = (c) => c instanceof Date ? +c : epoch_ms(asColumn(c));
|
|
12573
13021
|
break;
|
|
12574
13022
|
}
|
|
@@ -12594,7 +13042,7 @@ function getIndexColumns(client) {
|
|
|
12594
13042
|
const dims = [];
|
|
12595
13043
|
let count2;
|
|
12596
13044
|
for (const { as, expr: { aggregate } } of q.select()) {
|
|
12597
|
-
switch (aggregate?.toUpperCase()) {
|
|
13045
|
+
switch (aggregate?.toUpperCase?.()) {
|
|
12598
13046
|
case "COUNT":
|
|
12599
13047
|
case "SUM":
|
|
12600
13048
|
aggr.push({ [as]: sql`SUM("${as}")::DOUBLE` });
|
|
@@ -12722,6 +13170,10 @@ function queryResult() {
|
|
|
12722
13170
|
}
|
|
12723
13171
|
|
|
12724
13172
|
// ../core/src/QueryConsolidator.js
|
|
13173
|
+
function wait(callback) {
|
|
13174
|
+
const method = typeof requestAnimationFrame !== "undefined" ? requestAnimationFrame : typeof setImmediate !== "undefined" ? setImmediate : setTimeout;
|
|
13175
|
+
return method(callback);
|
|
13176
|
+
}
|
|
12725
13177
|
function consolidator(enqueue, cache, record) {
|
|
12726
13178
|
let pending = [];
|
|
12727
13179
|
let id = 0;
|
|
@@ -12737,7 +13189,7 @@ function consolidator(enqueue, cache, record) {
|
|
|
12737
13189
|
return {
|
|
12738
13190
|
add(entry, priority) {
|
|
12739
13191
|
if (entry.request.type === "arrow") {
|
|
12740
|
-
id = id ||
|
|
13192
|
+
id = id || wait(() => run());
|
|
12741
13193
|
pending.push({ entry, priority, index: pending.length });
|
|
12742
13194
|
} else {
|
|
12743
13195
|
enqueue(entry, priority);
|
|
@@ -13100,7 +13552,7 @@ function QueryManager() {
|
|
|
13100
13552
|
return state.slice();
|
|
13101
13553
|
},
|
|
13102
13554
|
stop() {
|
|
13103
|
-
recorders = recorders.filter((
|
|
13555
|
+
recorders = recorders.filter((x2) => x2 !== recorder);
|
|
13104
13556
|
return state;
|
|
13105
13557
|
}
|
|
13106
13558
|
};
|
|
@@ -13138,9 +13590,13 @@ function coordinator(instance9) {
|
|
|
13138
13590
|
}
|
|
13139
13591
|
var Coordinator = class {
|
|
13140
13592
|
constructor(db = socketConnector(), options = {}) {
|
|
13593
|
+
const {
|
|
13594
|
+
logger = console,
|
|
13595
|
+
manager = QueryManager()
|
|
13596
|
+
} = options;
|
|
13141
13597
|
this.catalog = new Catalog(this);
|
|
13142
|
-
this.manager =
|
|
13143
|
-
this.logger(
|
|
13598
|
+
this.manager = manager;
|
|
13599
|
+
this.logger(logger);
|
|
13144
13600
|
this.configure(options);
|
|
13145
13601
|
this.databaseConnector(db);
|
|
13146
13602
|
this.clear();
|
|
@@ -13178,6 +13634,7 @@ var Coordinator = class {
|
|
|
13178
13634
|
this.manager.cancel(requests);
|
|
13179
13635
|
}
|
|
13180
13636
|
exec(query, { priority = Priority.Normal } = {}) {
|
|
13637
|
+
query = Array.isArray(query) ? query.join(";\n") : query;
|
|
13181
13638
|
return this.manager.request({ type: "exec", query }, priority);
|
|
13182
13639
|
}
|
|
13183
13640
|
query(query, {
|
|
@@ -13225,6 +13682,7 @@ var Coordinator = class {
|
|
|
13225
13682
|
throw new Error("Client already connected.");
|
|
13226
13683
|
}
|
|
13227
13684
|
clients.add(client);
|
|
13685
|
+
client.coordinator = this;
|
|
13228
13686
|
const fields = client.fields();
|
|
13229
13687
|
if (fields?.length) {
|
|
13230
13688
|
client.fieldInfo(await catalog.queryFields(fields));
|
|
@@ -13251,136 +13709,7 @@ var Coordinator = class {
|
|
|
13251
13709
|
return;
|
|
13252
13710
|
clients.delete(client);
|
|
13253
13711
|
filterGroups.get(client.filterBy)?.remove(client);
|
|
13254
|
-
|
|
13255
|
-
};
|
|
13256
|
-
|
|
13257
|
-
// ../core/src/util/throttle.js
|
|
13258
|
-
var NIL = {};
|
|
13259
|
-
function throttle(callback, debounce = false) {
|
|
13260
|
-
let curr;
|
|
13261
|
-
let next;
|
|
13262
|
-
let pending = NIL;
|
|
13263
|
-
function invoke(event) {
|
|
13264
|
-
curr = callback(event).then(() => {
|
|
13265
|
-
if (next) {
|
|
13266
|
-
const { value } = next;
|
|
13267
|
-
next = null;
|
|
13268
|
-
invoke(value);
|
|
13269
|
-
} else {
|
|
13270
|
-
curr = null;
|
|
13271
|
-
}
|
|
13272
|
-
});
|
|
13273
|
-
}
|
|
13274
|
-
function enqueue(event) {
|
|
13275
|
-
next = { event };
|
|
13276
|
-
}
|
|
13277
|
-
function process(event) {
|
|
13278
|
-
curr ? enqueue(event) : invoke(event);
|
|
13279
|
-
}
|
|
13280
|
-
function delay(event) {
|
|
13281
|
-
if (pending !== event) {
|
|
13282
|
-
requestAnimationFrame(() => {
|
|
13283
|
-
const e = pending;
|
|
13284
|
-
pending = NIL;
|
|
13285
|
-
process(e);
|
|
13286
|
-
});
|
|
13287
|
-
}
|
|
13288
|
-
pending = event;
|
|
13289
|
-
}
|
|
13290
|
-
return debounce ? delay : process;
|
|
13291
|
-
}
|
|
13292
|
-
|
|
13293
|
-
// ../core/src/MosaicClient.js
|
|
13294
|
-
var MosaicClient = class {
|
|
13295
|
-
/**
|
|
13296
|
-
* Constructor.
|
|
13297
|
-
* @param {*} filterSelection An optional selection to interactively filter
|
|
13298
|
-
* this client's data. If provided, a coordinator will re-query and update
|
|
13299
|
-
* the client when the selection updates.
|
|
13300
|
-
*/
|
|
13301
|
-
constructor(filterSelection) {
|
|
13302
|
-
this._filterBy = filterSelection;
|
|
13303
|
-
this._requestUpdate = throttle(() => this.requestQuery(), true);
|
|
13304
|
-
}
|
|
13305
|
-
/**
|
|
13306
|
-
* Return this client's filter selection.
|
|
13307
|
-
*/
|
|
13308
|
-
get filterBy() {
|
|
13309
|
-
return this._filterBy;
|
|
13310
|
-
}
|
|
13311
|
-
/**
|
|
13312
|
-
* Return a boolean indicating if the client query can be indexed. Should
|
|
13313
|
-
* return true if changes to the filterBy selection does not change the
|
|
13314
|
-
* groupby domain of the client query.
|
|
13315
|
-
*/
|
|
13316
|
-
get filterIndexable() {
|
|
13317
|
-
return true;
|
|
13318
|
-
}
|
|
13319
|
-
/**
|
|
13320
|
-
* Return an array of fields queried by this client.
|
|
13321
|
-
*/
|
|
13322
|
-
fields() {
|
|
13323
|
-
return null;
|
|
13324
|
-
}
|
|
13325
|
-
/**
|
|
13326
|
-
* Called by the coordinator to set the field info for this client.
|
|
13327
|
-
* @returns {this}
|
|
13328
|
-
*/
|
|
13329
|
-
fieldInfo() {
|
|
13330
|
-
return this;
|
|
13331
|
-
}
|
|
13332
|
-
/**
|
|
13333
|
-
* Return a query specifying the data needed by this client.
|
|
13334
|
-
*/
|
|
13335
|
-
query() {
|
|
13336
|
-
return null;
|
|
13337
|
-
}
|
|
13338
|
-
/**
|
|
13339
|
-
* Called by the coordinator to inform the client that a query is pending.
|
|
13340
|
-
*/
|
|
13341
|
-
queryPending() {
|
|
13342
|
-
return this;
|
|
13343
|
-
}
|
|
13344
|
-
/**
|
|
13345
|
-
* Called by the coordinator to return a query result.
|
|
13346
|
-
*
|
|
13347
|
-
* @param {*} data the query result
|
|
13348
|
-
* @returns {this}
|
|
13349
|
-
*/
|
|
13350
|
-
queryResult() {
|
|
13351
|
-
return this;
|
|
13352
|
-
}
|
|
13353
|
-
/**
|
|
13354
|
-
* Called by the coordinator to report a query execution error.
|
|
13355
|
-
*/
|
|
13356
|
-
queryError(error) {
|
|
13357
|
-
console.error(error);
|
|
13358
|
-
return this;
|
|
13359
|
-
}
|
|
13360
|
-
/**
|
|
13361
|
-
* Request the coordinator to execute a query for this client.
|
|
13362
|
-
* If an explicit query is not provided, the client query method will
|
|
13363
|
-
* be called, filtered by the current filterBy selection.
|
|
13364
|
-
*/
|
|
13365
|
-
requestQuery(query) {
|
|
13366
|
-
const q = query || this.query(this.filterBy?.predicate(this));
|
|
13367
|
-
return coordinator().requestQuery(this, q);
|
|
13368
|
-
}
|
|
13369
|
-
/**
|
|
13370
|
-
* Request that the coordinator perform a throttled update of this client
|
|
13371
|
-
* using the default query. Unlike requestQuery, for which every call will
|
|
13372
|
-
* result in an executed query, multiple calls to requestUpdate may be
|
|
13373
|
-
* consolidated into a single update.
|
|
13374
|
-
*/
|
|
13375
|
-
requestUpdate() {
|
|
13376
|
-
this._requestUpdate();
|
|
13377
|
-
}
|
|
13378
|
-
/**
|
|
13379
|
-
* Requests a client update.
|
|
13380
|
-
* For example to (re-)render an interface component.
|
|
13381
|
-
*/
|
|
13382
|
-
update() {
|
|
13383
|
-
return this;
|
|
13712
|
+
client.coordinator = null;
|
|
13384
13713
|
}
|
|
13385
13714
|
};
|
|
13386
13715
|
|
|
@@ -13556,8 +13885,8 @@ function distinctArray(a, b) {
|
|
|
13556
13885
|
}
|
|
13557
13886
|
|
|
13558
13887
|
// ../core/src/Param.js
|
|
13559
|
-
function isParam(
|
|
13560
|
-
return
|
|
13888
|
+
function isParam(x2) {
|
|
13889
|
+
return x2 instanceof Param;
|
|
13561
13890
|
}
|
|
13562
13891
|
var Param = class _Param extends AsyncDispatch {
|
|
13563
13892
|
/**
|
|
@@ -13631,8 +13960,8 @@ var Param = class _Param extends AsyncDispatch {
|
|
|
13631
13960
|
};
|
|
13632
13961
|
|
|
13633
13962
|
// ../core/src/Selection.js
|
|
13634
|
-
function isSelection(
|
|
13635
|
-
return
|
|
13963
|
+
function isSelection(x2) {
|
|
13964
|
+
return x2 instanceof Selection;
|
|
13636
13965
|
}
|
|
13637
13966
|
var Selection = class _Selection extends Param {
|
|
13638
13967
|
/**
|
|
@@ -13891,7 +14220,7 @@ var Menu = class extends MosaicClient {
|
|
|
13891
14220
|
from,
|
|
13892
14221
|
column: column2,
|
|
13893
14222
|
label = column2,
|
|
13894
|
-
format: format2 = (
|
|
14223
|
+
format: format2 = (x2) => x2,
|
|
13895
14224
|
// TODO
|
|
13896
14225
|
options,
|
|
13897
14226
|
value,
|
|
@@ -13953,7 +14282,7 @@ var Menu = class extends MosaicClient {
|
|
|
13953
14282
|
source: this,
|
|
13954
14283
|
schema: { type: "point" },
|
|
13955
14284
|
value,
|
|
13956
|
-
predicate: value ? eq(column2, literal(value)) : null
|
|
14285
|
+
predicate: value !== "" && value !== void 0 ? eq(column2, literal(value)) : null
|
|
13957
14286
|
});
|
|
13958
14287
|
} else if (isParam(selection)) {
|
|
13959
14288
|
selection.update(value);
|