@loaders.gl/schema 3.1.0-alpha.2 → 3.1.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bundle.d.ts +2 -0
- package/dist/bundle.d.ts.map +1 -0
- package/dist/bundle.js +16157 -5
- package/dist/category/common.d.ts +19 -0
- package/dist/category/common.d.ts.map +1 -0
- package/dist/category/common.js +10 -2
- package/dist/category/gis.d.ts +50 -0
- package/dist/category/gis.d.ts.map +1 -0
- package/dist/category/gis.js +2 -2
- package/dist/category/mesh/convert-mesh.d.ts +15 -0
- package/dist/category/mesh/convert-mesh.d.ts.map +1 -0
- package/dist/category/mesh/convert-mesh.js +38 -31
- package/dist/category/mesh/deduce-mesh-schema.d.ts +24 -0
- package/dist/category/mesh/deduce-mesh-schema.d.ts.map +1 -0
- package/dist/category/mesh/deduce-mesh-schema.js +57 -37
- package/dist/category/mesh/mesh-to-arrow-table.d.ts +11 -0
- package/dist/category/mesh/mesh-to-arrow-table.d.ts.map +1 -0
- package/dist/category/mesh/mesh-to-arrow-table.js +33 -30
- package/dist/category/mesh/mesh-types.d.ts +50 -0
- package/dist/category/mesh/mesh-types.d.ts.map +1 -0
- package/dist/category/mesh/mesh-types.js +2 -2
- package/dist/category/mesh/mesh-utils.d.ts +23 -0
- package/dist/category/mesh/mesh-utils.d.ts.map +1 -0
- package/dist/category/mesh/mesh-utils.js +48 -35
- package/dist/category/table/deduce-table-schema.d.ts +9 -0
- package/dist/category/table/deduce-table-schema.d.ts.map +1 -0
- package/dist/category/table/deduce-table-schema.js +94 -39
- package/dist/category/table/table-types.d.ts +76 -0
- package/dist/category/table/table-types.d.ts.map +1 -0
- package/dist/category/table/table-types.js +2 -2
- package/dist/es5/bundle.js +7 -0
- package/dist/es5/bundle.js.map +1 -0
- package/dist/es5/category/common.js +2 -0
- package/dist/{category → es5/category}/common.js.map +0 -0
- package/dist/es5/category/gis.js +2 -0
- package/dist/{category → es5/category}/gis.js.map +0 -0
- package/dist/es5/category/mesh/convert-mesh.js +43 -0
- package/dist/{category → es5/category}/mesh/convert-mesh.js.map +1 -1
- package/dist/es5/category/mesh/deduce-mesh-schema.js +54 -0
- package/dist/es5/category/mesh/deduce-mesh-schema.js.map +1 -0
- package/dist/es5/category/mesh/mesh-to-arrow-table.js +41 -0
- package/dist/es5/category/mesh/mesh-to-arrow-table.js.map +1 -0
- package/dist/es5/category/mesh/mesh-types.js +2 -0
- package/dist/{category → es5/category}/mesh/mesh-types.js.map +0 -0
- package/dist/es5/category/mesh/mesh-utils.js +47 -0
- package/dist/es5/category/mesh/mesh-utils.js.map +1 -0
- package/dist/es5/category/table/deduce-table-schema.js +58 -0
- package/dist/es5/category/table/deduce-table-schema.js.map +1 -0
- package/dist/es5/category/table/table-types.js +2 -0
- package/dist/{category → es5/category}/table/table-types.js.map +0 -0
- package/dist/es5/index.js +344 -0
- package/dist/es5/index.js.map +1 -0
- package/dist/es5/lib/arrow/arrow-like-type-utils.js +40 -0
- package/dist/es5/lib/arrow/arrow-like-type-utils.js.map +1 -0
- package/dist/es5/lib/arrow/arrow-type-utils.js +72 -0
- package/dist/es5/lib/arrow/arrow-type-utils.js.map +1 -0
- package/dist/es5/lib/arrow/get-type-info.js +33 -0
- package/dist/es5/lib/arrow/get-type-info.js.map +1 -0
- package/dist/es5/lib/batches/base-table-batch-aggregator.js +81 -0
- package/dist/es5/lib/batches/base-table-batch-aggregator.js.map +1 -0
- package/dist/es5/lib/batches/columnar-table-batch-aggregator.js +109 -0
- package/dist/es5/lib/batches/columnar-table-batch-aggregator.js.map +1 -0
- package/dist/es5/lib/batches/row-table-batch-aggregator.js +102 -0
- package/dist/es5/lib/batches/row-table-batch-aggregator.js.map +1 -0
- package/dist/es5/lib/batches/table-batch-aggregator.js +2 -0
- package/dist/{lib → es5/lib}/batches/table-batch-aggregator.js.map +0 -0
- package/dist/es5/lib/batches/table-batch-builder.js +187 -0
- package/dist/es5/lib/batches/table-batch-builder.js.map +1 -0
- package/dist/es5/lib/schema/impl/enum.js +56 -0
- package/dist/es5/lib/schema/impl/enum.js.map +1 -0
- package/dist/es5/lib/schema/impl/field.js +43 -0
- package/dist/es5/lib/schema/impl/field.js.map +1 -0
- package/dist/es5/lib/schema/impl/schema.js +103 -0
- package/dist/es5/lib/schema/impl/schema.js.map +1 -0
- package/dist/es5/lib/schema/impl/type.js +594 -0
- package/dist/es5/lib/schema/impl/type.js.map +1 -0
- package/dist/es5/lib/schema/schema.js +236 -0
- package/dist/es5/lib/schema/schema.js.map +1 -0
- package/dist/es5/lib/schema-utils/deduce-column-type.js +32 -0
- package/dist/es5/lib/schema-utils/deduce-column-type.js.map +1 -0
- package/dist/es5/lib/utils/assert.js +13 -0
- package/dist/es5/lib/utils/assert.js.map +1 -0
- package/dist/es5/lib/utils/async-queue.js +130 -0
- package/dist/es5/lib/utils/async-queue.js.map +1 -0
- package/dist/es5/lib/utils/row-utils.js +44 -0
- package/dist/es5/lib/utils/row-utils.js.map +1 -0
- package/dist/es5/types.js +2 -0
- package/dist/{types.js.map → es5/types.js.map} +0 -0
- package/dist/esm/bundle.js +5 -0
- package/dist/esm/bundle.js.map +1 -0
- package/dist/esm/category/common.js +2 -0
- package/dist/esm/category/common.js.map +1 -0
- package/dist/esm/category/gis.js +2 -0
- package/dist/esm/category/gis.js.map +1 -0
- package/dist/esm/category/mesh/convert-mesh.js +33 -0
- package/dist/esm/category/mesh/convert-mesh.js.map +1 -0
- package/dist/esm/category/mesh/deduce-mesh-schema.js +42 -0
- package/dist/esm/category/mesh/deduce-mesh-schema.js.map +1 -0
- package/dist/esm/category/mesh/mesh-to-arrow-table.js +31 -0
- package/dist/esm/category/mesh/mesh-to-arrow-table.js.map +1 -0
- package/dist/esm/category/mesh/mesh-types.js +2 -0
- package/dist/esm/category/mesh/mesh-types.js.map +1 -0
- package/dist/esm/category/mesh/mesh-utils.js +38 -0
- package/dist/esm/category/mesh/mesh-utils.js.map +1 -0
- package/dist/esm/category/table/deduce-table-schema.js +51 -0
- package/dist/esm/category/table/deduce-table-schema.js.map +1 -0
- package/dist/esm/category/table/table-types.js +2 -0
- package/dist/esm/category/table/table-types.js.map +1 -0
- package/dist/esm/index.js +13 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/lib/arrow/arrow-like-type-utils.js +32 -0
- package/dist/esm/lib/arrow/arrow-like-type-utils.js.map +1 -0
- package/dist/esm/lib/arrow/arrow-type-utils.js +62 -0
- package/dist/esm/lib/arrow/arrow-type-utils.js.map +1 -0
- package/dist/esm/lib/arrow/get-type-info.js +24 -0
- package/dist/esm/lib/arrow/get-type-info.js.map +1 -0
- package/dist/esm/lib/batches/base-table-batch-aggregator.js +74 -0
- package/dist/esm/lib/batches/base-table-batch-aggregator.js.map +1 -0
- package/dist/esm/lib/batches/columnar-table-batch-aggregator.js +100 -0
- package/dist/esm/lib/batches/columnar-table-batch-aggregator.js.map +1 -0
- package/dist/esm/lib/batches/row-table-batch-aggregator.js +95 -0
- package/dist/esm/lib/batches/row-table-batch-aggregator.js.map +1 -0
- package/dist/esm/lib/batches/table-batch-aggregator.js +2 -0
- package/dist/esm/lib/batches/table-batch-aggregator.js.map +1 -0
- package/dist/esm/lib/batches/table-batch-builder.js +182 -0
- package/dist/esm/lib/batches/table-batch-builder.js.map +1 -0
- package/dist/esm/lib/schema/impl/enum.js +49 -0
- package/dist/esm/lib/schema/impl/enum.js.map +1 -0
- package/dist/esm/lib/schema/impl/field.js +35 -0
- package/dist/esm/lib/schema/impl/field.js.map +1 -0
- package/dist/esm/lib/schema/impl/schema.js +92 -0
- package/dist/esm/lib/schema/impl/schema.js.map +1 -0
- package/dist/esm/lib/schema/impl/type.js +498 -0
- package/dist/esm/lib/schema/impl/type.js.map +1 -0
- package/dist/{lib/schema/index.js → esm/lib/schema/schema.js} +1 -1
- package/dist/esm/lib/schema/schema.js.map +1 -0
- package/dist/esm/lib/schema-utils/deduce-column-type.js +23 -0
- package/dist/esm/lib/schema-utils/deduce-column-type.js.map +1 -0
- package/dist/esm/lib/utils/assert.js +6 -0
- package/dist/esm/lib/utils/assert.js.map +1 -0
- package/dist/esm/lib/utils/async-queue.js +119 -0
- package/dist/esm/lib/utils/async-queue.js.map +1 -0
- package/dist/esm/lib/utils/row-utils.js +35 -0
- package/dist/esm/lib/utils/row-utils.js.map +1 -0
- package/dist/esm/types.js +2 -0
- package/dist/esm/types.js.map +1 -0
- package/dist/index.d.ts +23 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +75 -13
- package/dist/lib/arrow/arrow-like-type-utils.d.ts +4 -0
- package/dist/lib/arrow/arrow-like-type-utils.d.ts.map +1 -0
- package/dist/lib/arrow/arrow-like-type-utils.js +26 -31
- package/dist/lib/arrow/arrow-type-utils.d.ts +6 -0
- package/dist/lib/arrow/arrow-type-utils.d.ts.map +1 -0
- package/dist/lib/arrow/arrow-type-utils.js +48 -60
- package/dist/lib/arrow/get-type-info.d.ts +14 -0
- package/dist/lib/arrow/get-type-info.d.ts.map +1 -0
- package/dist/lib/arrow/get-type-info.js +23 -19
- package/dist/lib/batches/base-table-batch-aggregator.d.ts +19 -0
- package/dist/lib/batches/base-table-batch-aggregator.d.ts.map +1 -0
- package/dist/lib/batches/base-table-batch-aggregator.js +52 -68
- package/dist/lib/batches/columnar-table-batch-aggregator.d.ts +23 -0
- package/dist/lib/batches/columnar-table-batch-aggregator.d.ts.map +1 -0
- package/dist/lib/batches/columnar-table-batch-aggregator.js +82 -92
- package/dist/lib/batches/row-table-batch-aggregator.d.ts +22 -0
- package/dist/lib/batches/row-table-batch-aggregator.d.ts.map +1 -0
- package/dist/lib/batches/row-table-batch-aggregator.js +72 -88
- package/dist/lib/batches/table-batch-aggregator.d.ts +25 -0
- package/dist/lib/batches/table-batch-aggregator.d.ts.map +1 -0
- package/dist/lib/batches/table-batch-aggregator.js +2 -2
- package/dist/lib/batches/table-batch-builder.d.ts +53 -0
- package/dist/lib/batches/table-batch-builder.d.ts.map +1 -0
- package/dist/lib/batches/table-batch-builder.js +137 -166
- package/dist/lib/schema/impl/enum.d.ts +92 -0
- package/dist/lib/schema/impl/enum.d.ts.map +1 -0
- package/dist/lib/schema/impl/enum.js +96 -48
- package/dist/lib/schema/impl/field.d.ts +19 -0
- package/dist/lib/schema/impl/field.d.ts.map +1 -0
- package/dist/lib/schema/impl/field.js +31 -34
- package/dist/lib/schema/impl/schema.d.ts +16 -0
- package/dist/lib/schema/impl/schema.d.ts.map +1 -0
- package/dist/lib/schema/impl/schema.js +72 -81
- package/dist/lib/schema/impl/type.d.ts +176 -0
- package/dist/lib/schema/impl/type.d.ts.map +1 -0
- package/dist/lib/schema/impl/type.js +454 -490
- package/dist/lib/schema/schema.d.ts +5 -0
- package/dist/lib/schema/schema.d.ts.map +1 -0
- package/dist/lib/schema/schema.js +90 -0
- package/dist/lib/schema-utils/deduce-column-type.d.ts +3 -0
- package/dist/lib/schema-utils/deduce-column-type.d.ts.map +1 -0
- package/dist/lib/schema-utils/deduce-column-type.js +89 -20
- package/dist/lib/utils/assert.d.ts +2 -0
- package/dist/lib/utils/assert.d.ts.map +1 -0
- package/dist/lib/utils/assert.js +11 -5
- package/dist/lib/utils/async-queue.d.ts +18 -0
- package/dist/lib/utils/async-queue.d.ts.map +1 -0
- package/dist/lib/utils/async-queue.js +82 -109
- package/dist/lib/utils/row-utils.d.ts +9 -0
- package/dist/lib/utils/row-utils.d.ts.map +1 -0
- package/dist/lib/utils/row-utils.js +31 -33
- package/dist/types.d.ts +8 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +2 -2
- package/package.json +7 -8
- package/src/bundle.ts +2 -3
- package/src/category/mesh/deduce-mesh-schema.ts +1 -1
- package/src/category/mesh/mesh-to-arrow-table.ts +1 -1
- package/src/category/mesh/mesh-types.ts +1 -1
- package/src/category/table/deduce-table-schema.ts +1 -1
- package/src/category/table/table-types.ts +2 -2
- package/src/index.ts +1 -1
- package/src/lib/arrow/arrow-like-type-utils.ts +11 -1
- package/src/lib/arrow/arrow-type-utils.ts +1 -1
- package/src/lib/arrow/get-type-info.ts +1 -1
- package/src/lib/batches/base-table-batch-aggregator.ts +1 -1
- package/src/lib/batches/columnar-table-batch-aggregator.ts +1 -1
- package/src/lib/batches/row-table-batch-aggregator.ts +1 -1
- package/src/lib/batches/table-batch-aggregator.ts +1 -1
- package/src/lib/batches/table-batch-builder.ts +2 -2
- package/src/lib/schema/impl/schema.ts +2 -2
- package/src/lib/schema/impl/type.ts +2 -2
- package/src/lib/schema/{index.ts → schema.ts} +0 -0
- package/src/lib/schema-utils/deduce-column-type.ts +6 -2
- package/src/lib/utils/async-queue.ts +7 -4
- package/dist/bundle.js.map +0 -1
- package/dist/category/mesh/deduce-mesh-schema.js.map +0 -1
- package/dist/category/mesh/mesh-to-arrow-table.js.map +0 -1
- package/dist/category/mesh/mesh-utils.js.map +0 -1
- package/dist/category/table/deduce-table-schema.js.map +0 -1
- package/dist/dist.min.js +0 -2
- package/dist/dist.min.js.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/lib/arrow/arrow-like-type-utils.js.map +0 -1
- package/dist/lib/arrow/arrow-type-utils.js.map +0 -1
- package/dist/lib/arrow/get-type-info.js.map +0 -1
- package/dist/lib/batches/base-table-batch-aggregator.js.map +0 -1
- package/dist/lib/batches/columnar-table-batch-aggregator.js.map +0 -1
- package/dist/lib/batches/row-table-batch-aggregator.js.map +0 -1
- package/dist/lib/batches/table-batch-builder.js.map +0 -1
- package/dist/lib/schema/impl/enum.js.map +0 -1
- package/dist/lib/schema/impl/field.js.map +0 -1
- package/dist/lib/schema/impl/schema.js.map +0 -1
- package/dist/lib/schema/impl/type.js.map +0 -1
- package/dist/lib/schema/index.js.map +0 -1
- package/dist/lib/schema-utils/deduce-column-type.js.map +0 -1
- package/dist/lib/utils/assert.js.map +0 -1
- package/dist/lib/utils/async-queue.js.map +0 -1
- package/dist/lib/utils/row-utils.js.map +0 -1
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
2
|
+
|
|
3
|
+
let _Symbol$asyncIterator;
|
|
4
|
+
|
|
5
|
+
class ArrayQueue extends Array {
|
|
6
|
+
enqueue(value) {
|
|
7
|
+
return this.push(value);
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
dequeue() {
|
|
11
|
+
return this.shift();
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
_Symbol$asyncIterator = Symbol.asyncIterator;
|
|
17
|
+
export default class AsyncQueue {
|
|
18
|
+
constructor() {
|
|
19
|
+
_defineProperty(this, "_values", void 0);
|
|
20
|
+
|
|
21
|
+
_defineProperty(this, "_settlers", void 0);
|
|
22
|
+
|
|
23
|
+
_defineProperty(this, "_closed", void 0);
|
|
24
|
+
|
|
25
|
+
this._values = new ArrayQueue();
|
|
26
|
+
this._settlers = new ArrayQueue();
|
|
27
|
+
this._closed = false;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
close() {
|
|
31
|
+
while (this._settlers.length > 0) {
|
|
32
|
+
this._settlers.dequeue().resolve({
|
|
33
|
+
done: true
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
this._closed = true;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
[_Symbol$asyncIterator]() {
|
|
41
|
+
return this;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
enqueue(value) {
|
|
45
|
+
if (this._closed) {
|
|
46
|
+
throw new Error('Closed');
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
if (this._settlers.length > 0) {
|
|
50
|
+
if (this._values.length > 0) {
|
|
51
|
+
throw new Error('Illegal internal state');
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
const settler = this._settlers.dequeue();
|
|
55
|
+
|
|
56
|
+
if (value instanceof Error) {
|
|
57
|
+
settler.reject(value);
|
|
58
|
+
} else {
|
|
59
|
+
settler.resolve({
|
|
60
|
+
value
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
} else {
|
|
64
|
+
this._values.enqueue(value);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
next() {
|
|
69
|
+
if (this._values.length > 0) {
|
|
70
|
+
const value = this._values.dequeue();
|
|
71
|
+
|
|
72
|
+
if (value instanceof Error) {
|
|
73
|
+
return Promise.reject(value);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
return Promise.resolve({
|
|
77
|
+
value
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
if (this._closed) {
|
|
82
|
+
if (this._settlers.length > 0) {
|
|
83
|
+
throw new Error('Illegal internal state');
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
return Promise.resolve({
|
|
87
|
+
done: true
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
return new Promise((resolve, reject) => {
|
|
92
|
+
this._settlers.enqueue({
|
|
93
|
+
resolve,
|
|
94
|
+
reject
|
|
95
|
+
});
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
}
|
|
100
|
+
export async function takeAsync(asyncIterable, count = Infinity) {
|
|
101
|
+
const result = [];
|
|
102
|
+
const iterator = asyncIterable[Symbol.asyncIterator]();
|
|
103
|
+
|
|
104
|
+
while (result.length < count) {
|
|
105
|
+
const {
|
|
106
|
+
value,
|
|
107
|
+
done
|
|
108
|
+
} = await iterator.next();
|
|
109
|
+
|
|
110
|
+
if (done) {
|
|
111
|
+
break;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
result.push(value);
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
return result;
|
|
118
|
+
}
|
|
119
|
+
//# sourceMappingURL=async-queue.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/lib/utils/async-queue.ts"],"names":["ArrayQueue","Array","enqueue","value","push","dequeue","shift","Symbol","asyncIterator","AsyncQueue","constructor","_values","_settlers","_closed","close","length","resolve","done","Error","settler","reject","next","Promise","takeAsync","asyncIterable","count","Infinity","result","iterator"],"mappings":"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","sourcesContent":["// From https://github.com/rauschma/async-iter-demo/tree/master/src under MIT license\n// http://2ality.com/2016/10/asynchronous-iteration.html\n\nclass ArrayQueue<T> extends Array<T> {\n enqueue(value: T) {\n // Add at the end\n return this.push(value);\n }\n dequeue(): T {\n // Remove first element\n return this.shift() as T;\n }\n}\n\nexport default class AsyncQueue<T> {\n private _values: ArrayQueue<T | Error>;\n private _settlers: ArrayQueue<{resolve: (value: any) => void; reject: (reason?: any) => void}>;\n private _closed: boolean;\n\n constructor() {\n // enqueues > dequeues\n this._values = new ArrayQueue<T>();\n // dequeues > enqueues\n this._settlers = new ArrayQueue<{\n resolve: (value: any) => void;\n reject: (reason?: any) => void;\n }>();\n this._closed = false;\n }\n\n close(): void {\n while (this._settlers.length > 0) {\n this._settlers.dequeue().resolve({done: true});\n }\n this._closed = true;\n }\n\n [Symbol.asyncIterator](): AsyncIterator<T> {\n return this;\n }\n\n enqueue(value: T | Error): void {\n if (this._closed) {\n throw new Error('Closed');\n }\n\n if (this._settlers.length > 0) {\n if (this._values.length > 0) {\n throw new Error('Illegal internal state');\n }\n const settler = this._settlers.dequeue();\n if (value instanceof Error) {\n settler.reject(value);\n } else {\n settler.resolve({value});\n }\n } else {\n this._values.enqueue(value);\n }\n }\n\n /**\n * @returns a Promise for an IteratorResult\n */\n next(): Promise<any> {\n if (this._values.length > 0) {\n const value = this._values.dequeue();\n if (value instanceof Error) {\n return Promise.reject(value);\n }\n return Promise.resolve({value});\n }\n\n if (this._closed) {\n if (this._settlers.length > 0) {\n throw new Error('Illegal internal state');\n }\n return Promise.resolve({done: true});\n }\n // Wait for new values to be enqueued\n return new Promise((resolve, reject) => {\n this._settlers.enqueue({resolve, reject});\n });\n }\n}\n\n/**\n * @returns a Promise for an Array with the elements in `asyncIterable`\n */\nexport async function takeAsync(\n asyncIterable: AsyncIterable<any>,\n count = Infinity\n): Promise<any[]> {\n const result: Array<any> = [];\n const iterator = asyncIterable[Symbol.asyncIterator]();\n while (result.length < count) {\n const {value, done} = await iterator.next();\n if (done) {\n break;\n }\n result.push(value);\n }\n return result;\n}\n"],"file":"async-queue.js"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
export function convertToObjectRow(arrayRow, headers) {
|
|
2
|
+
if (!arrayRow) {
|
|
3
|
+
throw new Error('null row');
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
if (!headers) {
|
|
7
|
+
throw new Error('no headers');
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
const objectRow = {};
|
|
11
|
+
|
|
12
|
+
for (let i = 0; i < headers.length; i++) {
|
|
13
|
+
objectRow[headers[i]] = arrayRow[i];
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
return objectRow;
|
|
17
|
+
}
|
|
18
|
+
export function convertToArrayRow(objectRow, headers) {
|
|
19
|
+
if (!objectRow) {
|
|
20
|
+
throw new Error('null row');
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
if (!headers) {
|
|
24
|
+
throw new Error('no headers');
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
const arrayRow = new Array(headers.length);
|
|
28
|
+
|
|
29
|
+
for (let i = 0; i < headers.length; i++) {
|
|
30
|
+
arrayRow[i] = objectRow[headers[i]];
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
return arrayRow;
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=row-utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/lib/utils/row-utils.ts"],"names":["convertToObjectRow","arrayRow","headers","Error","objectRow","i","length","convertToArrayRow","Array"],"mappings":"AACA,OAAO,SAASA,kBAAT,CACLC,QADK,EAELC,OAFK,EAGwB;AAC7B,MAAI,CAACD,QAAL,EAAe;AACb,UAAM,IAAIE,KAAJ,CAAU,UAAV,CAAN;AACD;;AACD,MAAI,CAACD,OAAL,EAAc;AACZ,UAAM,IAAIC,KAAJ,CAAU,YAAV,CAAN;AACD;;AACD,QAAMC,SAAS,GAAG,EAAlB;;AACA,OAAK,IAAIC,CAAC,GAAG,CAAb,EAAgBA,CAAC,GAAGH,OAAO,CAACI,MAA5B,EAAoCD,CAAC,EAArC,EAAyC;AACvCD,IAAAA,SAAS,CAACF,OAAO,CAACG,CAAD,CAAR,CAAT,GAAwBJ,QAAQ,CAACI,CAAD,CAAhC;AACD;;AACD,SAAOD,SAAP;AACD;AAGD,OAAO,SAASG,iBAAT,CACLH,SADK,EAELF,OAFK,EAGE;AACP,MAAI,CAACE,SAAL,EAAgB;AACd,UAAM,IAAID,KAAJ,CAAU,UAAV,CAAN;AACD;;AACD,MAAI,CAACD,OAAL,EAAc;AACZ,UAAM,IAAIC,KAAJ,CAAU,YAAV,CAAN;AACD;;AACD,QAAMF,QAAQ,GAAG,IAAIO,KAAJ,CAAUN,OAAO,CAACI,MAAlB,CAAjB;;AACA,OAAK,IAAID,CAAC,GAAG,CAAb,EAAgBA,CAAC,GAAGH,OAAO,CAACI,MAA5B,EAAoCD,CAAC,EAArC,EAAyC;AACvCJ,IAAAA,QAAQ,CAACI,CAAD,CAAR,GAAcD,SAAS,CAACF,OAAO,CAACG,CAAD,CAAR,CAAvB;AACD;;AACD,SAAOJ,QAAP;AACD","sourcesContent":["/** Convert an object row to an array row */\nexport function convertToObjectRow(\n arrayRow: any[],\n headers: string[]\n): {[columnName: string]: any} {\n if (!arrayRow) {\n throw new Error('null row');\n }\n if (!headers) {\n throw new Error('no headers');\n }\n const objectRow = {};\n for (let i = 0; i < headers.length; i++) {\n objectRow[headers[i]] = arrayRow[i];\n }\n return objectRow;\n}\n\n/** Convert an object row to an array row */\nexport function convertToArrayRow(\n objectRow: {[columnName: string]: any},\n headers: string[]\n): any[] {\n if (!objectRow) {\n throw new Error('null row');\n }\n if (!headers) {\n throw new Error('no headers');\n }\n const arrayRow = new Array(headers.length);\n for (let i = 0; i < headers.length; i++) {\n arrayRow[i] = objectRow[headers[i]];\n }\n return arrayRow;\n}\n"],"file":"row-utils.js"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[],"file":"types.js"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export type { TypedArray, NumberArray, AnyArray } from './types';
|
|
2
|
+
export type { Batch } from './category/common';
|
|
3
|
+
export type { Table, ArrayRowTable, ObjectRowTable, ColumnarTable, ArrowTable } from './category/table/table-types';
|
|
4
|
+
export type { TableBatch, RowArrayTableBatch, RowObjectTableBatch, ColumnarTableBatch, ArrowTableBatch } from './category/table/table-types';
|
|
5
|
+
export { default as TableBatchBuilder } from './lib/batches/table-batch-builder';
|
|
6
|
+
export type { TableBatchAggregator } from './lib/batches/table-batch-aggregator';
|
|
7
|
+
export { default as RowTableBatchAggregator } from './lib/batches/row-table-batch-aggregator';
|
|
8
|
+
export { default as ColumnarTableBatchAggregator } from './lib/batches/columnar-table-batch-aggregator';
|
|
9
|
+
export { convertToObjectRow, convertToArrayRow } from './lib/utils/row-utils';
|
|
10
|
+
export type { MeshTable, MeshArrowTable, Mesh, MeshGeometry, MeshAttribute, MeshAttributes } from './category/mesh/mesh-types';
|
|
11
|
+
export { getMeshSize, getMeshBoundingBox } from './category/mesh/mesh-utils';
|
|
12
|
+
export { convertMesh } from './category/mesh/convert-mesh';
|
|
13
|
+
export { deduceMeshSchema, deduceMeshField, makeMeshAttributeMetadata } from './category/mesh/deduce-mesh-schema';
|
|
14
|
+
export type { GeoJSON, Feature, Geometry, Position, GeoJsonProperties } from './category/gis';
|
|
15
|
+
export type { Point, MultiPoint, LineString, MultiLineString, Polygon, MultiPolygon } from './category/gis';
|
|
16
|
+
export type { BinaryGeometryType, BinaryGeometry, BinaryPointGeometry, BinaryLineGeometry, BinaryPolygonGeometry, BinaryAttribute } from './category/gis';
|
|
17
|
+
export type { BinaryFeatures, BinaryPointFeatures, BinaryLineFeatures, BinaryPolygonFeatures } from './category/gis';
|
|
18
|
+
export { Schema, Field, DataType, Null, Binary, Bool, Int, Int8, Int16, Int32, Int64, Uint8, Uint16, Uint32, Uint64, Float, Float16, Float32, Float64, Utf8, Date, DateDay, DateMillisecond, Time, TimeMillisecond, TimeSecond, Timestamp, TimestampSecond, TimestampMillisecond, TimestampMicrosecond, TimestampNanosecond, Interval, IntervalDayTime, IntervalYearMonth, FixedSizeList, Struct } from './lib/schema/schema';
|
|
19
|
+
export { deduceTypeFromColumn, deduceTypeFromValue } from './lib/schema-utils/deduce-column-type';
|
|
20
|
+
export { getTypeInfo } from './lib/arrow/get-type-info';
|
|
21
|
+
export { getArrowTypeFromTypedArray } from './lib/arrow/arrow-like-type-utils';
|
|
22
|
+
export { default as AsyncQueue } from './lib/utils/async-queue';
|
|
23
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,YAAY,EAAC,UAAU,EAAE,WAAW,EAAE,QAAQ,EAAC,MAAM,SAAS,CAAC;AAE/D,YAAY,EAAC,KAAK,EAAC,MAAM,mBAAmB,CAAC;AAI7C,YAAY,EACV,KAAK,EACL,aAAa,EACb,cAAc,EACd,aAAa,EACb,UAAU,EACX,MAAM,8BAA8B,CAAC;AACtC,YAAY,EACV,UAAU,EACV,kBAAkB,EAClB,mBAAmB,EACnB,kBAAkB,EAClB,eAAe,EAChB,MAAM,8BAA8B,CAAC;AAGtC,OAAO,EAAC,OAAO,IAAI,iBAAiB,EAAC,MAAM,mCAAmC,CAAC;AAC/E,YAAY,EAAC,oBAAoB,EAAC,MAAM,sCAAsC,CAAC;AAC/E,OAAO,EAAC,OAAO,IAAI,uBAAuB,EAAC,MAAM,0CAA0C,CAAC;AAC5F,OAAO,EAAC,OAAO,IAAI,4BAA4B,EAAC,MAAM,+CAA+C,CAAC;AAEtG,OAAO,EAAC,kBAAkB,EAAE,iBAAiB,EAAC,MAAM,uBAAuB,CAAC;AAG5E,YAAY,EACV,SAAS,EACT,cAAc,EACd,IAAI,EACJ,YAAY,EACZ,aAAa,EACb,cAAc,EACf,MAAM,4BAA4B,CAAC;AAEpC,OAAO,EAAC,WAAW,EAAE,kBAAkB,EAAC,MAAM,4BAA4B,CAAC;AAC3E,OAAO,EAAC,WAAW,EAAC,MAAM,8BAA8B,CAAC;AACzD,OAAO,EACL,gBAAgB,EAChB,eAAe,EACf,yBAAyB,EAC1B,MAAM,oCAAoC,CAAC;AAI5C,YAAY,EAAC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,iBAAiB,EAAC,MAAM,gBAAgB,CAAC;AAC5F,YAAY,EACV,KAAK,EACL,UAAU,EACV,UAAU,EACV,eAAe,EACf,OAAO,EACP,YAAY,EACb,MAAM,gBAAgB,CAAC;AAGxB,YAAY,EACV,kBAAkB,EAClB,cAAc,EACd,mBAAmB,EACnB,kBAAkB,EAClB,qBAAqB,EACrB,eAAe,EAChB,MAAM,gBAAgB,CAAC;AACxB,YAAY,EACV,cAAc,EACd,mBAAmB,EACnB,kBAAkB,EAClB,qBAAqB,EACtB,MAAM,gBAAgB,CAAC;AAGxB,OAAO,EACL,MAAM,EACN,KAAK,EACL,QAAQ,EACR,IAAI,EACJ,MAAM,EACN,IAAI,EACJ,GAAG,EACH,IAAI,EACJ,KAAK,EACL,KAAK,EACL,KAAK,EACL,KAAK,EACL,MAAM,EACN,MAAM,EACN,MAAM,EACN,KAAK,EACL,OAAO,EACP,OAAO,EACP,OAAO,EACP,IAAI,EACJ,IAAI,EACJ,OAAO,EACP,eAAe,EACf,IAAI,EACJ,eAAe,EACf,UAAU,EACV,SAAS,EACT,eAAe,EACf,oBAAoB,EACpB,oBAAoB,EACpB,mBAAmB,EACnB,QAAQ,EACR,eAAe,EACf,iBAAiB,EACjB,aAAa,EACb,MAAM,EACP,MAAM,qBAAqB,CAAC;AAK7B,OAAO,EAAC,oBAAoB,EAAE,mBAAmB,EAAC,MAAM,uCAAuC,CAAC;AAChG,OAAO,EAAC,WAAW,EAAC,MAAM,2BAA2B,CAAC;AACtD,OAAO,EAAC,0BAA0B,EAAC,MAAM,mCAAmC,CAAC;AAE7E,OAAO,EAAC,OAAO,IAAI,UAAU,EAAC,MAAM,yBAAyB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,13 +1,75 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.getTypeInfo = exports.deduceTypeFromValue = exports.deduceTypeFromColumn = exports.Struct = exports.FixedSizeList = exports.IntervalYearMonth = exports.IntervalDayTime = exports.Interval = exports.TimestampNanosecond = exports.TimestampMicrosecond = exports.TimestampMillisecond = exports.TimestampSecond = exports.Timestamp = exports.TimeSecond = exports.TimeMillisecond = exports.Time = exports.DateMillisecond = exports.DateDay = exports.Date = exports.Utf8 = exports.Float64 = exports.Float32 = exports.Float16 = exports.Float = exports.Uint64 = exports.Uint32 = exports.Uint16 = exports.Uint8 = exports.Int64 = exports.Int32 = exports.Int16 = exports.Int8 = exports.Int = exports.Bool = exports.Binary = exports.Null = exports.DataType = exports.Field = exports.Schema = exports.makeMeshAttributeMetadata = exports.deduceMeshField = exports.deduceMeshSchema = exports.convertMesh = exports.getMeshBoundingBox = exports.getMeshSize = exports.convertToArrayRow = exports.convertToObjectRow = exports.ColumnarTableBatchAggregator = exports.RowTableBatchAggregator = exports.TableBatchBuilder = void 0;
|
|
7
|
+
exports.AsyncQueue = exports.getArrowTypeFromTypedArray = void 0;
|
|
8
|
+
// TABLE CATEGORY UTILS
|
|
9
|
+
var table_batch_builder_1 = require("./lib/batches/table-batch-builder");
|
|
10
|
+
Object.defineProperty(exports, "TableBatchBuilder", { enumerable: true, get: function () { return __importDefault(table_batch_builder_1).default; } });
|
|
11
|
+
var row_table_batch_aggregator_1 = require("./lib/batches/row-table-batch-aggregator");
|
|
12
|
+
Object.defineProperty(exports, "RowTableBatchAggregator", { enumerable: true, get: function () { return __importDefault(row_table_batch_aggregator_1).default; } });
|
|
13
|
+
var columnar_table_batch_aggregator_1 = require("./lib/batches/columnar-table-batch-aggregator");
|
|
14
|
+
Object.defineProperty(exports, "ColumnarTableBatchAggregator", { enumerable: true, get: function () { return __importDefault(columnar_table_batch_aggregator_1).default; } });
|
|
15
|
+
var row_utils_1 = require("./lib/utils/row-utils");
|
|
16
|
+
Object.defineProperty(exports, "convertToObjectRow", { enumerable: true, get: function () { return row_utils_1.convertToObjectRow; } });
|
|
17
|
+
Object.defineProperty(exports, "convertToArrayRow", { enumerable: true, get: function () { return row_utils_1.convertToArrayRow; } });
|
|
18
|
+
var mesh_utils_1 = require("./category/mesh/mesh-utils");
|
|
19
|
+
Object.defineProperty(exports, "getMeshSize", { enumerable: true, get: function () { return mesh_utils_1.getMeshSize; } });
|
|
20
|
+
Object.defineProperty(exports, "getMeshBoundingBox", { enumerable: true, get: function () { return mesh_utils_1.getMeshBoundingBox; } });
|
|
21
|
+
var convert_mesh_1 = require("./category/mesh/convert-mesh");
|
|
22
|
+
Object.defineProperty(exports, "convertMesh", { enumerable: true, get: function () { return convert_mesh_1.convertMesh; } });
|
|
23
|
+
var deduce_mesh_schema_1 = require("./category/mesh/deduce-mesh-schema");
|
|
24
|
+
Object.defineProperty(exports, "deduceMeshSchema", { enumerable: true, get: function () { return deduce_mesh_schema_1.deduceMeshSchema; } });
|
|
25
|
+
Object.defineProperty(exports, "deduceMeshField", { enumerable: true, get: function () { return deduce_mesh_schema_1.deduceMeshField; } });
|
|
26
|
+
Object.defineProperty(exports, "makeMeshAttributeMetadata", { enumerable: true, get: function () { return deduce_mesh_schema_1.makeMeshAttributeMetadata; } });
|
|
27
|
+
// SCHEMA
|
|
28
|
+
var schema_1 = require("./lib/schema/schema");
|
|
29
|
+
Object.defineProperty(exports, "Schema", { enumerable: true, get: function () { return schema_1.Schema; } });
|
|
30
|
+
Object.defineProperty(exports, "Field", { enumerable: true, get: function () { return schema_1.Field; } });
|
|
31
|
+
Object.defineProperty(exports, "DataType", { enumerable: true, get: function () { return schema_1.DataType; } });
|
|
32
|
+
Object.defineProperty(exports, "Null", { enumerable: true, get: function () { return schema_1.Null; } });
|
|
33
|
+
Object.defineProperty(exports, "Binary", { enumerable: true, get: function () { return schema_1.Binary; } });
|
|
34
|
+
Object.defineProperty(exports, "Bool", { enumerable: true, get: function () { return schema_1.Bool; } });
|
|
35
|
+
Object.defineProperty(exports, "Int", { enumerable: true, get: function () { return schema_1.Int; } });
|
|
36
|
+
Object.defineProperty(exports, "Int8", { enumerable: true, get: function () { return schema_1.Int8; } });
|
|
37
|
+
Object.defineProperty(exports, "Int16", { enumerable: true, get: function () { return schema_1.Int16; } });
|
|
38
|
+
Object.defineProperty(exports, "Int32", { enumerable: true, get: function () { return schema_1.Int32; } });
|
|
39
|
+
Object.defineProperty(exports, "Int64", { enumerable: true, get: function () { return schema_1.Int64; } });
|
|
40
|
+
Object.defineProperty(exports, "Uint8", { enumerable: true, get: function () { return schema_1.Uint8; } });
|
|
41
|
+
Object.defineProperty(exports, "Uint16", { enumerable: true, get: function () { return schema_1.Uint16; } });
|
|
42
|
+
Object.defineProperty(exports, "Uint32", { enumerable: true, get: function () { return schema_1.Uint32; } });
|
|
43
|
+
Object.defineProperty(exports, "Uint64", { enumerable: true, get: function () { return schema_1.Uint64; } });
|
|
44
|
+
Object.defineProperty(exports, "Float", { enumerable: true, get: function () { return schema_1.Float; } });
|
|
45
|
+
Object.defineProperty(exports, "Float16", { enumerable: true, get: function () { return schema_1.Float16; } });
|
|
46
|
+
Object.defineProperty(exports, "Float32", { enumerable: true, get: function () { return schema_1.Float32; } });
|
|
47
|
+
Object.defineProperty(exports, "Float64", { enumerable: true, get: function () { return schema_1.Float64; } });
|
|
48
|
+
Object.defineProperty(exports, "Utf8", { enumerable: true, get: function () { return schema_1.Utf8; } });
|
|
49
|
+
Object.defineProperty(exports, "Date", { enumerable: true, get: function () { return schema_1.Date; } });
|
|
50
|
+
Object.defineProperty(exports, "DateDay", { enumerable: true, get: function () { return schema_1.DateDay; } });
|
|
51
|
+
Object.defineProperty(exports, "DateMillisecond", { enumerable: true, get: function () { return schema_1.DateMillisecond; } });
|
|
52
|
+
Object.defineProperty(exports, "Time", { enumerable: true, get: function () { return schema_1.Time; } });
|
|
53
|
+
Object.defineProperty(exports, "TimeMillisecond", { enumerable: true, get: function () { return schema_1.TimeMillisecond; } });
|
|
54
|
+
Object.defineProperty(exports, "TimeSecond", { enumerable: true, get: function () { return schema_1.TimeSecond; } });
|
|
55
|
+
Object.defineProperty(exports, "Timestamp", { enumerable: true, get: function () { return schema_1.Timestamp; } });
|
|
56
|
+
Object.defineProperty(exports, "TimestampSecond", { enumerable: true, get: function () { return schema_1.TimestampSecond; } });
|
|
57
|
+
Object.defineProperty(exports, "TimestampMillisecond", { enumerable: true, get: function () { return schema_1.TimestampMillisecond; } });
|
|
58
|
+
Object.defineProperty(exports, "TimestampMicrosecond", { enumerable: true, get: function () { return schema_1.TimestampMicrosecond; } });
|
|
59
|
+
Object.defineProperty(exports, "TimestampNanosecond", { enumerable: true, get: function () { return schema_1.TimestampNanosecond; } });
|
|
60
|
+
Object.defineProperty(exports, "Interval", { enumerable: true, get: function () { return schema_1.Interval; } });
|
|
61
|
+
Object.defineProperty(exports, "IntervalDayTime", { enumerable: true, get: function () { return schema_1.IntervalDayTime; } });
|
|
62
|
+
Object.defineProperty(exports, "IntervalYearMonth", { enumerable: true, get: function () { return schema_1.IntervalYearMonth; } });
|
|
63
|
+
Object.defineProperty(exports, "FixedSizeList", { enumerable: true, get: function () { return schema_1.FixedSizeList; } });
|
|
64
|
+
Object.defineProperty(exports, "Struct", { enumerable: true, get: function () { return schema_1.Struct; } });
|
|
65
|
+
// EXPERIMENTAL APIs
|
|
66
|
+
// SCHEMA UTILS
|
|
67
|
+
var deduce_column_type_1 = require("./lib/schema-utils/deduce-column-type");
|
|
68
|
+
Object.defineProperty(exports, "deduceTypeFromColumn", { enumerable: true, get: function () { return deduce_column_type_1.deduceTypeFromColumn; } });
|
|
69
|
+
Object.defineProperty(exports, "deduceTypeFromValue", { enumerable: true, get: function () { return deduce_column_type_1.deduceTypeFromValue; } });
|
|
70
|
+
var get_type_info_1 = require("./lib/arrow/get-type-info");
|
|
71
|
+
Object.defineProperty(exports, "getTypeInfo", { enumerable: true, get: function () { return get_type_info_1.getTypeInfo; } });
|
|
72
|
+
var arrow_like_type_utils_1 = require("./lib/arrow/arrow-like-type-utils");
|
|
73
|
+
Object.defineProperty(exports, "getArrowTypeFromTypedArray", { enumerable: true, get: function () { return arrow_like_type_utils_1.getArrowTypeFromTypedArray; } });
|
|
74
|
+
var async_queue_1 = require("./lib/utils/async-queue");
|
|
75
|
+
Object.defineProperty(exports, "AsyncQueue", { enumerable: true, get: function () { return __importDefault(async_queue_1).default; } });
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"arrow-like-type-utils.d.ts","sourceRoot":"","sources":["../../../src/lib/arrow/arrow-like-type-utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,aAAa,CAAC;AAC5C,OAAO,EACL,QAAQ,EAST,MAAM,kBAAkB,CAAC;AAE1B,wBAAgB,0BAA0B,CAAC,KAAK,EAAE,UAAU,GAAG,QAAQ,CAqBtE"}
|
|
@@ -1,32 +1,27 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
return new Float64();
|
|
27
|
-
|
|
28
|
-
default:
|
|
29
|
-
throw new Error('array type not supported');
|
|
30
|
-
}
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getArrowTypeFromTypedArray = void 0;
|
|
4
|
+
const schema_1 = require("../schema/schema");
|
|
5
|
+
function getArrowTypeFromTypedArray(array) {
|
|
6
|
+
switch (array.constructor) {
|
|
7
|
+
case Int8Array:
|
|
8
|
+
return new schema_1.Int8();
|
|
9
|
+
case Uint8Array:
|
|
10
|
+
return new schema_1.Uint8();
|
|
11
|
+
case Int16Array:
|
|
12
|
+
return new schema_1.Int16();
|
|
13
|
+
case Uint16Array:
|
|
14
|
+
return new schema_1.Uint16();
|
|
15
|
+
case Int32Array:
|
|
16
|
+
return new schema_1.Int32();
|
|
17
|
+
case Uint32Array:
|
|
18
|
+
return new schema_1.Uint32();
|
|
19
|
+
case Float32Array:
|
|
20
|
+
return new schema_1.Float32();
|
|
21
|
+
case Float64Array:
|
|
22
|
+
return new schema_1.Float64();
|
|
23
|
+
default:
|
|
24
|
+
throw new Error('array type not supported');
|
|
25
|
+
}
|
|
31
26
|
}
|
|
32
|
-
|
|
27
|
+
exports.getArrowTypeFromTypedArray = getArrowTypeFromTypedArray;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { TypedArray } from '../../types';
|
|
2
|
+
import { DataType } from 'apache-arrow/Arrow.dom';
|
|
3
|
+
import { AbstractVector } from 'apache-arrow/vector';
|
|
4
|
+
export declare function getArrowType(array: TypedArray): DataType;
|
|
5
|
+
export declare function getArrowVector(array: TypedArray): AbstractVector;
|
|
6
|
+
//# sourceMappingURL=arrow-type-utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"arrow-type-utils.d.ts","sourceRoot":"","sources":["../../../src/lib/arrow/arrow-type-utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,aAAa,CAAC;AAC5C,OAAO,EACL,QAAQ,EAiBT,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAC,cAAc,EAAC,MAAM,qBAAqB,CAAC;AAEnD,wBAAgB,YAAY,CAAC,KAAK,EAAE,UAAU,GAAG,QAAQ,CAqBxD;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,UAAU,GAAG,cAAc,CAqBhE"}
|
|
@@ -1,62 +1,50 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
return new Float64();
|
|
27
|
-
|
|
28
|
-
default:
|
|
29
|
-
throw new Error('array type not supported');
|
|
30
|
-
}
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getArrowVector = exports.getArrowType = void 0;
|
|
4
|
+
const Arrow_dom_1 = require("apache-arrow/Arrow.dom");
|
|
5
|
+
function getArrowType(array) {
|
|
6
|
+
switch (array.constructor) {
|
|
7
|
+
case Int8Array:
|
|
8
|
+
return new Arrow_dom_1.Int8();
|
|
9
|
+
case Uint8Array:
|
|
10
|
+
return new Arrow_dom_1.Uint8();
|
|
11
|
+
case Int16Array:
|
|
12
|
+
return new Arrow_dom_1.Int16();
|
|
13
|
+
case Uint16Array:
|
|
14
|
+
return new Arrow_dom_1.Uint16();
|
|
15
|
+
case Int32Array:
|
|
16
|
+
return new Arrow_dom_1.Int32();
|
|
17
|
+
case Uint32Array:
|
|
18
|
+
return new Arrow_dom_1.Uint32();
|
|
19
|
+
case Float32Array:
|
|
20
|
+
return new Arrow_dom_1.Float32();
|
|
21
|
+
case Float64Array:
|
|
22
|
+
return new Arrow_dom_1.Float64();
|
|
23
|
+
default:
|
|
24
|
+
throw new Error('array type not supported');
|
|
25
|
+
}
|
|
31
26
|
}
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
case Float64Array:
|
|
56
|
-
return Float64Vector.from(array);
|
|
57
|
-
|
|
58
|
-
default:
|
|
59
|
-
throw new Error('array type not supported');
|
|
60
|
-
}
|
|
27
|
+
exports.getArrowType = getArrowType;
|
|
28
|
+
function getArrowVector(array) {
|
|
29
|
+
switch (array.constructor) {
|
|
30
|
+
case Int8Array:
|
|
31
|
+
return Arrow_dom_1.Int8Vector.from(array);
|
|
32
|
+
case Uint8Array:
|
|
33
|
+
return Arrow_dom_1.Uint8Vector.from(array);
|
|
34
|
+
case Int16Array:
|
|
35
|
+
return Arrow_dom_1.Int16Vector.from(array);
|
|
36
|
+
case Uint16Array:
|
|
37
|
+
return Arrow_dom_1.Uint16Vector.from(array);
|
|
38
|
+
case Int32Array:
|
|
39
|
+
return Arrow_dom_1.Int32Vector.from(array);
|
|
40
|
+
case Uint32Array:
|
|
41
|
+
return Arrow_dom_1.Uint32Vector.from(array);
|
|
42
|
+
case Float32Array:
|
|
43
|
+
return Arrow_dom_1.Float32Vector.from(array);
|
|
44
|
+
case Float64Array:
|
|
45
|
+
return Arrow_dom_1.Float64Vector.from(array);
|
|
46
|
+
default:
|
|
47
|
+
throw new Error('array type not supported');
|
|
48
|
+
}
|
|
61
49
|
}
|
|
62
|
-
|
|
50
|
+
exports.getArrowVector = getArrowVector;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Type } from '../schema/schema';
|
|
2
|
+
import { AnyArray } from '../../types';
|
|
3
|
+
/**
|
|
4
|
+
* Gets type information from an Arrow type object or "mock" Arrow type object
|
|
5
|
+
* @param arrowTypeLike Arrow Type or type object of similar shape
|
|
6
|
+
*/
|
|
7
|
+
export declare function getTypeInfo(arrowTypeLike: any): {
|
|
8
|
+
typeId: Type;
|
|
9
|
+
ArrayType: AnyArray;
|
|
10
|
+
typeName: string;
|
|
11
|
+
typeEnumName?: string;
|
|
12
|
+
precision?: number;
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=get-type-info.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-type-info.d.ts","sourceRoot":"","sources":["../../../src/lib/arrow/get-type-info.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,IAAI,EAAC,MAAM,kBAAkB,CAAC;AACtC,OAAO,EAAC,QAAQ,EAAC,MAAM,aAAa,CAAC;AAErC;;;GAGG;AACH,wBAAgB,WAAW,CAAC,aAAa,EAAE,GAAG,GAAG;IAC/C,MAAM,EAAE,IAAI,CAAC;IACb,SAAS,EAAE,QAAQ,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAQA"}
|
|
@@ -1,24 +1,28 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getTypeInfo = void 0;
|
|
4
|
+
const schema_1 = require("../schema/schema");
|
|
5
|
+
/**
|
|
6
|
+
* Gets type information from an Arrow type object or "mock" Arrow type object
|
|
7
|
+
* @param arrowTypeLike Arrow Type or type object of similar shape
|
|
8
|
+
*/
|
|
9
|
+
function getTypeInfo(arrowTypeLike) {
|
|
10
|
+
return {
|
|
11
|
+
typeId: arrowTypeLike.typeId,
|
|
12
|
+
ArrayType: arrowTypeLike.ArrayType,
|
|
13
|
+
typeName: arrowTypeLike.toString(),
|
|
14
|
+
typeEnumName: getTypeKey(arrowTypeLike.typeId),
|
|
15
|
+
precision: arrowTypeLike.precision
|
|
16
|
+
};
|
|
10
17
|
}
|
|
18
|
+
exports.getTypeInfo = getTypeInfo;
|
|
11
19
|
let ReverseType = null;
|
|
12
|
-
|
|
13
20
|
function getTypeKey(typeKey) {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
21
|
+
if (!ReverseType) {
|
|
22
|
+
ReverseType = {};
|
|
23
|
+
for (const key in schema_1.Type) {
|
|
24
|
+
ReverseType[schema_1.Type[key]] = key;
|
|
25
|
+
}
|
|
19
26
|
}
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
return ReverseType[typeKey];
|
|
27
|
+
return ReverseType[typeKey];
|
|
23
28
|
}
|
|
24
|
-
//# sourceMappingURL=get-type-info.js.map
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { Schema } from '../schema/schema';
|
|
2
|
+
import type { TableBatch } from '../../category/table/table-types';
|
|
3
|
+
import { TableBatchAggregator, TableBatchOptions } from './table-batch-aggregator';
|
|
4
|
+
export default class RowTableBatchAggregator implements TableBatchAggregator {
|
|
5
|
+
schema: Schema;
|
|
6
|
+
options: TableBatchOptions;
|
|
7
|
+
length: number;
|
|
8
|
+
rows: any[] | null;
|
|
9
|
+
cursor: number;
|
|
10
|
+
private _headers;
|
|
11
|
+
constructor(schema: Schema, options: TableBatchOptions);
|
|
12
|
+
rowCount(): number;
|
|
13
|
+
addArrayRow(row: any[], cursor?: number): void;
|
|
14
|
+
addObjectRow(row: {
|
|
15
|
+
[columnName: string]: any;
|
|
16
|
+
}, cursor?: number): void;
|
|
17
|
+
getBatch(): TableBatch | null;
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=base-table-batch-aggregator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base-table-batch-aggregator.d.ts","sourceRoot":"","sources":["../../../src/lib/batches/base-table-batch-aggregator.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,kBAAkB,CAAC;AAC7C,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,kCAAkC,CAAC;AACjE,OAAO,EAAC,oBAAoB,EAAE,iBAAiB,EAAC,MAAM,0BAA0B,CAAC;AAIjF,MAAM,CAAC,OAAO,OAAO,uBAAwB,YAAW,oBAAoB;IAC1E,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,iBAAiB,CAAC;IAE3B,MAAM,EAAE,MAAM,CAAK;IACnB,IAAI,EAAE,GAAG,EAAE,GAAG,IAAI,CAAQ;IAC1B,MAAM,EAAE,MAAM,CAAK;IACnB,OAAO,CAAC,QAAQ,CAAgB;gBAEpB,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,iBAAiB;IActD,QAAQ,IAAI,MAAM;IAIlB,WAAW,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI;IAU9C,YAAY,CAAC,GAAG,EAAE;QAAC,CAAC,UAAU,EAAE,MAAM,GAAG,GAAG,CAAA;KAAC,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI;IAUrE,QAAQ,IAAI,UAAU,GAAG,IAAI;CAoB9B"}
|