@loaders.gl/schema 3.1.3 → 4.0.0-alpha.5
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.js +2 -2
- package/dist/bundle.js.map +1 -0
- package/dist/category/common.d.ts +1 -2
- package/dist/category/common.d.ts.map +1 -1
- package/dist/category/common.js +2 -10
- package/dist/{es5/category → category}/common.js.map +0 -0
- package/dist/category/gis.js +2 -2
- package/dist/{es5/category → category}/gis.js.map +0 -0
- package/dist/category/image/image.d.ts +18 -0
- package/dist/category/image/image.d.ts.map +1 -0
- package/dist/category/image/image.js +2 -0
- package/dist/{esm/category/gis.js.map → category/image/image.js.map} +1 -1
- package/dist/category/mesh/convert-mesh.js +31 -37
- package/dist/category/mesh/convert-mesh.js.map +1 -0
- package/dist/category/mesh/deduce-mesh-schema.js +37 -57
- package/dist/category/mesh/deduce-mesh-schema.js.map +1 -0
- package/dist/category/mesh/mesh-to-arrow-table.d.ts +10 -0
- package/dist/category/mesh/mesh-to-arrow-table.d.ts.map +1 -1
- package/dist/category/mesh/mesh-to-arrow-table.js +15 -28
- package/dist/category/mesh/mesh-to-arrow-table.js.map +1 -0
- package/dist/category/mesh/mesh-types.js +2 -2
- package/dist/{es5/category → category}/mesh/mesh-types.js.map +0 -0
- package/dist/category/mesh/mesh-utils.js +35 -48
- package/dist/category/mesh/mesh-utils.js.map +1 -0
- package/dist/category/table/deduce-table-schema.js +39 -94
- package/dist/category/table/deduce-table-schema.js.map +1 -0
- package/dist/category/table/table-types.d.ts +1 -3
- package/dist/category/table/table-types.d.ts.map +1 -1
- package/dist/category/table/table-types.js +2 -2
- package/dist/{es5/category → category}/table/table-types.js.map +0 -0
- package/dist/category/texture/texture.d.ts +18 -0
- package/dist/category/texture/texture.d.ts.map +1 -0
- package/dist/category/texture/texture.js +2 -0
- package/dist/{esm/category/common.js.map → category/texture/texture.js.map} +1 -1
- package/dist/dist.min.js +15078 -208
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +13 -75
- package/dist/index.js.map +1 -0
- package/dist/lib/arrow/arrow-like-type-utils.js +31 -26
- package/dist/lib/arrow/arrow-like-type-utils.js.map +1 -0
- package/dist/lib/arrow/arrow-type-utils.d.ts +5 -0
- package/dist/lib/arrow/arrow-type-utils.d.ts.map +1 -1
- package/dist/lib/arrow/arrow-type-utils.js +20 -28
- package/dist/lib/arrow/arrow-type-utils.js.map +1 -0
- package/dist/lib/arrow/get-type-info.js +19 -23
- package/dist/lib/arrow/get-type-info.js.map +1 -0
- package/dist/lib/batches/base-table-batch-aggregator.js +68 -52
- package/dist/lib/batches/base-table-batch-aggregator.js.map +1 -0
- package/dist/lib/batches/columnar-table-batch-aggregator.js +92 -82
- package/dist/lib/batches/columnar-table-batch-aggregator.js.map +1 -0
- package/dist/lib/batches/row-table-batch-aggregator.js +88 -72
- package/dist/lib/batches/row-table-batch-aggregator.js.map +1 -0
- package/dist/lib/batches/table-batch-aggregator.js +2 -2
- package/dist/{es5/lib → lib}/batches/table-batch-aggregator.js.map +0 -0
- package/dist/lib/batches/table-batch-builder.js +166 -137
- package/dist/lib/batches/table-batch-builder.js.map +1 -0
- package/dist/lib/schema/impl/enum.js +48 -96
- package/dist/lib/schema/impl/enum.js.map +1 -0
- package/dist/lib/schema/impl/field.js +34 -31
- package/dist/lib/schema/impl/field.js.map +1 -0
- package/dist/lib/schema/impl/schema.js +81 -72
- package/dist/lib/schema/impl/schema.js.map +1 -0
- package/dist/lib/schema/impl/type.js +490 -454
- package/dist/lib/schema/impl/type.js.map +1 -0
- package/dist/lib/schema/schema.js +5 -90
- package/dist/lib/schema/schema.js.map +1 -0
- package/dist/lib/schema-utils/deduce-column-type.js +20 -89
- package/dist/lib/schema-utils/deduce-column-type.js.map +1 -0
- package/dist/lib/utils/assert.js +5 -11
- package/dist/lib/utils/assert.js.map +1 -0
- package/dist/lib/utils/async-queue.js +109 -82
- package/dist/lib/utils/async-queue.js.map +1 -0
- package/dist/lib/utils/row-utils.js +33 -31
- package/dist/lib/utils/row-utils.js.map +1 -0
- package/dist/types.js +2 -2
- package/dist/{es5/types.js.map → types.js.map} +0 -0
- package/package.json +6 -5
- package/src/category/common.ts +1 -2
- package/src/category/image/image.ts +19 -0
- package/src/category/mesh/convert-mesh.ts +6 -6
- package/src/category/mesh/mesh-to-arrow-table.ts +2 -4
- package/src/category/table/table-types.ts +1 -4
- package/src/category/texture/texture.ts +28 -0
- package/src/index.ts +6 -1
- package/src/lib/arrow/arrow-type-utils.ts +0 -2
- package/dist/es5/bundle.js +0 -7
- package/dist/es5/bundle.js.map +0 -1
- package/dist/es5/category/common.js +0 -2
- package/dist/es5/category/gis.js +0 -2
- package/dist/es5/category/mesh/convert-mesh.js +0 -43
- package/dist/es5/category/mesh/convert-mesh.js.map +0 -1
- package/dist/es5/category/mesh/deduce-mesh-schema.js +0 -54
- package/dist/es5/category/mesh/deduce-mesh-schema.js.map +0 -1
- package/dist/es5/category/mesh/mesh-to-arrow-table.js +0 -2
- package/dist/es5/category/mesh/mesh-to-arrow-table.js.map +0 -1
- package/dist/es5/category/mesh/mesh-types.js +0 -2
- package/dist/es5/category/mesh/mesh-utils.js +0 -47
- package/dist/es5/category/mesh/mesh-utils.js.map +0 -1
- package/dist/es5/category/table/deduce-table-schema.js +0 -58
- package/dist/es5/category/table/deduce-table-schema.js.map +0 -1
- package/dist/es5/category/table/table-types.js +0 -2
- package/dist/es5/index.js +0 -344
- package/dist/es5/index.js.map +0 -1
- package/dist/es5/lib/arrow/arrow-like-type-utils.js +0 -40
- package/dist/es5/lib/arrow/arrow-like-type-utils.js.map +0 -1
- package/dist/es5/lib/arrow/arrow-type-utils.js +0 -2
- package/dist/es5/lib/arrow/arrow-type-utils.js.map +0 -1
- package/dist/es5/lib/arrow/get-type-info.js +0 -33
- package/dist/es5/lib/arrow/get-type-info.js.map +0 -1
- package/dist/es5/lib/batches/base-table-batch-aggregator.js +0 -92
- package/dist/es5/lib/batches/base-table-batch-aggregator.js.map +0 -1
- package/dist/es5/lib/batches/columnar-table-batch-aggregator.js +0 -128
- package/dist/es5/lib/batches/columnar-table-batch-aggregator.js.map +0 -1
- package/dist/es5/lib/batches/row-table-batch-aggregator.js +0 -113
- package/dist/es5/lib/batches/row-table-batch-aggregator.js.map +0 -1
- package/dist/es5/lib/batches/table-batch-aggregator.js +0 -2
- package/dist/es5/lib/batches/table-batch-builder.js +0 -207
- package/dist/es5/lib/batches/table-batch-builder.js.map +0 -1
- package/dist/es5/lib/schema/impl/enum.js +0 -56
- package/dist/es5/lib/schema/impl/enum.js.map +0 -1
- package/dist/es5/lib/schema/impl/field.js +0 -56
- package/dist/es5/lib/schema/impl/field.js.map +0 -1
- package/dist/es5/lib/schema/impl/schema.js +0 -168
- package/dist/es5/lib/schema/impl/schema.js.map +0 -1
- package/dist/es5/lib/schema/impl/type.js +0 -927
- package/dist/es5/lib/schema/impl/type.js.map +0 -1
- package/dist/es5/lib/schema/schema.js +0 -236
- package/dist/es5/lib/schema/schema.js.map +0 -1
- package/dist/es5/lib/schema-utils/deduce-column-type.js +0 -32
- package/dist/es5/lib/schema-utils/deduce-column-type.js.map +0 -1
- package/dist/es5/lib/utils/assert.js +0 -13
- package/dist/es5/lib/utils/assert.js.map +0 -1
- package/dist/es5/lib/utils/async-queue.js +0 -213
- package/dist/es5/lib/utils/async-queue.js.map +0 -1
- package/dist/es5/lib/utils/row-utils.js +0 -44
- package/dist/es5/lib/utils/row-utils.js.map +0 -1
- package/dist/es5/types.js +0 -2
- package/dist/esm/bundle.js +0 -5
- package/dist/esm/bundle.js.map +0 -1
- package/dist/esm/category/common.js +0 -2
- package/dist/esm/category/gis.js +0 -2
- package/dist/esm/category/mesh/convert-mesh.js +0 -26
- package/dist/esm/category/mesh/convert-mesh.js.map +0 -1
- package/dist/esm/category/mesh/deduce-mesh-schema.js +0 -42
- package/dist/esm/category/mesh/deduce-mesh-schema.js.map +0 -1
- package/dist/esm/category/mesh/mesh-to-arrow-table.js +0 -2
- package/dist/esm/category/mesh/mesh-to-arrow-table.js.map +0 -1
- package/dist/esm/category/mesh/mesh-types.js +0 -2
- package/dist/esm/category/mesh/mesh-types.js.map +0 -1
- package/dist/esm/category/mesh/mesh-utils.js +0 -38
- package/dist/esm/category/mesh/mesh-utils.js.map +0 -1
- package/dist/esm/category/table/deduce-table-schema.js +0 -51
- package/dist/esm/category/table/deduce-table-schema.js.map +0 -1
- package/dist/esm/category/table/table-types.js +0 -2
- package/dist/esm/category/table/table-types.js.map +0 -1
- package/dist/esm/index.js +0 -13
- package/dist/esm/index.js.map +0 -1
- package/dist/esm/lib/arrow/arrow-like-type-utils.js +0 -32
- package/dist/esm/lib/arrow/arrow-like-type-utils.js.map +0 -1
- package/dist/esm/lib/arrow/arrow-type-utils.js +0 -2
- package/dist/esm/lib/arrow/arrow-type-utils.js.map +0 -1
- package/dist/esm/lib/arrow/get-type-info.js +0 -24
- package/dist/esm/lib/arrow/get-type-info.js.map +0 -1
- package/dist/esm/lib/batches/base-table-batch-aggregator.js +0 -74
- package/dist/esm/lib/batches/base-table-batch-aggregator.js.map +0 -1
- package/dist/esm/lib/batches/columnar-table-batch-aggregator.js +0 -100
- package/dist/esm/lib/batches/columnar-table-batch-aggregator.js.map +0 -1
- package/dist/esm/lib/batches/row-table-batch-aggregator.js +0 -95
- package/dist/esm/lib/batches/row-table-batch-aggregator.js.map +0 -1
- package/dist/esm/lib/batches/table-batch-aggregator.js +0 -2
- package/dist/esm/lib/batches/table-batch-aggregator.js.map +0 -1
- package/dist/esm/lib/batches/table-batch-builder.js +0 -182
- package/dist/esm/lib/batches/table-batch-builder.js.map +0 -1
- package/dist/esm/lib/schema/impl/enum.js +0 -49
- package/dist/esm/lib/schema/impl/enum.js.map +0 -1
- package/dist/esm/lib/schema/impl/field.js +0 -35
- package/dist/esm/lib/schema/impl/field.js.map +0 -1
- package/dist/esm/lib/schema/impl/schema.js +0 -92
- package/dist/esm/lib/schema/impl/schema.js.map +0 -1
- package/dist/esm/lib/schema/impl/type.js +0 -498
- package/dist/esm/lib/schema/impl/type.js.map +0 -1
- package/dist/esm/lib/schema/schema.js +0 -5
- package/dist/esm/lib/schema/schema.js.map +0 -1
- package/dist/esm/lib/schema-utils/deduce-column-type.js +0 -23
- package/dist/esm/lib/schema-utils/deduce-column-type.js.map +0 -1
- package/dist/esm/lib/utils/assert.js +0 -6
- package/dist/esm/lib/utils/assert.js.map +0 -1
- package/dist/esm/lib/utils/async-queue.js +0 -119
- package/dist/esm/lib/utils/async-queue.js.map +0 -1
- package/dist/esm/lib/utils/row-utils.js +0 -35
- package/dist/esm/lib/utils/row-utils.js.map +0 -1
- package/dist/esm/types.js +0 -2
- package/dist/esm/types.js.map +0 -1
package/dist/es5/index.js
DELETED
|
@@ -1,344 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
Object.defineProperty(exports, "TableBatchBuilder", {
|
|
9
|
-
enumerable: true,
|
|
10
|
-
get: function get() {
|
|
11
|
-
return _tableBatchBuilder.default;
|
|
12
|
-
}
|
|
13
|
-
});
|
|
14
|
-
Object.defineProperty(exports, "RowTableBatchAggregator", {
|
|
15
|
-
enumerable: true,
|
|
16
|
-
get: function get() {
|
|
17
|
-
return _rowTableBatchAggregator.default;
|
|
18
|
-
}
|
|
19
|
-
});
|
|
20
|
-
Object.defineProperty(exports, "ColumnarTableBatchAggregator", {
|
|
21
|
-
enumerable: true,
|
|
22
|
-
get: function get() {
|
|
23
|
-
return _columnarTableBatchAggregator.default;
|
|
24
|
-
}
|
|
25
|
-
});
|
|
26
|
-
Object.defineProperty(exports, "convertToObjectRow", {
|
|
27
|
-
enumerable: true,
|
|
28
|
-
get: function get() {
|
|
29
|
-
return _rowUtils.convertToObjectRow;
|
|
30
|
-
}
|
|
31
|
-
});
|
|
32
|
-
Object.defineProperty(exports, "convertToArrayRow", {
|
|
33
|
-
enumerable: true,
|
|
34
|
-
get: function get() {
|
|
35
|
-
return _rowUtils.convertToArrayRow;
|
|
36
|
-
}
|
|
37
|
-
});
|
|
38
|
-
Object.defineProperty(exports, "getMeshSize", {
|
|
39
|
-
enumerable: true,
|
|
40
|
-
get: function get() {
|
|
41
|
-
return _meshUtils.getMeshSize;
|
|
42
|
-
}
|
|
43
|
-
});
|
|
44
|
-
Object.defineProperty(exports, "getMeshBoundingBox", {
|
|
45
|
-
enumerable: true,
|
|
46
|
-
get: function get() {
|
|
47
|
-
return _meshUtils.getMeshBoundingBox;
|
|
48
|
-
}
|
|
49
|
-
});
|
|
50
|
-
Object.defineProperty(exports, "convertMesh", {
|
|
51
|
-
enumerable: true,
|
|
52
|
-
get: function get() {
|
|
53
|
-
return _convertMesh.convertMesh;
|
|
54
|
-
}
|
|
55
|
-
});
|
|
56
|
-
Object.defineProperty(exports, "deduceMeshSchema", {
|
|
57
|
-
enumerable: true,
|
|
58
|
-
get: function get() {
|
|
59
|
-
return _deduceMeshSchema.deduceMeshSchema;
|
|
60
|
-
}
|
|
61
|
-
});
|
|
62
|
-
Object.defineProperty(exports, "deduceMeshField", {
|
|
63
|
-
enumerable: true,
|
|
64
|
-
get: function get() {
|
|
65
|
-
return _deduceMeshSchema.deduceMeshField;
|
|
66
|
-
}
|
|
67
|
-
});
|
|
68
|
-
Object.defineProperty(exports, "makeMeshAttributeMetadata", {
|
|
69
|
-
enumerable: true,
|
|
70
|
-
get: function get() {
|
|
71
|
-
return _deduceMeshSchema.makeMeshAttributeMetadata;
|
|
72
|
-
}
|
|
73
|
-
});
|
|
74
|
-
Object.defineProperty(exports, "Schema", {
|
|
75
|
-
enumerable: true,
|
|
76
|
-
get: function get() {
|
|
77
|
-
return _schema.Schema;
|
|
78
|
-
}
|
|
79
|
-
});
|
|
80
|
-
Object.defineProperty(exports, "Field", {
|
|
81
|
-
enumerable: true,
|
|
82
|
-
get: function get() {
|
|
83
|
-
return _schema.Field;
|
|
84
|
-
}
|
|
85
|
-
});
|
|
86
|
-
Object.defineProperty(exports, "DataType", {
|
|
87
|
-
enumerable: true,
|
|
88
|
-
get: function get() {
|
|
89
|
-
return _schema.DataType;
|
|
90
|
-
}
|
|
91
|
-
});
|
|
92
|
-
Object.defineProperty(exports, "Null", {
|
|
93
|
-
enumerable: true,
|
|
94
|
-
get: function get() {
|
|
95
|
-
return _schema.Null;
|
|
96
|
-
}
|
|
97
|
-
});
|
|
98
|
-
Object.defineProperty(exports, "Binary", {
|
|
99
|
-
enumerable: true,
|
|
100
|
-
get: function get() {
|
|
101
|
-
return _schema.Binary;
|
|
102
|
-
}
|
|
103
|
-
});
|
|
104
|
-
Object.defineProperty(exports, "Bool", {
|
|
105
|
-
enumerable: true,
|
|
106
|
-
get: function get() {
|
|
107
|
-
return _schema.Bool;
|
|
108
|
-
}
|
|
109
|
-
});
|
|
110
|
-
Object.defineProperty(exports, "Int", {
|
|
111
|
-
enumerable: true,
|
|
112
|
-
get: function get() {
|
|
113
|
-
return _schema.Int;
|
|
114
|
-
}
|
|
115
|
-
});
|
|
116
|
-
Object.defineProperty(exports, "Int8", {
|
|
117
|
-
enumerable: true,
|
|
118
|
-
get: function get() {
|
|
119
|
-
return _schema.Int8;
|
|
120
|
-
}
|
|
121
|
-
});
|
|
122
|
-
Object.defineProperty(exports, "Int16", {
|
|
123
|
-
enumerable: true,
|
|
124
|
-
get: function get() {
|
|
125
|
-
return _schema.Int16;
|
|
126
|
-
}
|
|
127
|
-
});
|
|
128
|
-
Object.defineProperty(exports, "Int32", {
|
|
129
|
-
enumerable: true,
|
|
130
|
-
get: function get() {
|
|
131
|
-
return _schema.Int32;
|
|
132
|
-
}
|
|
133
|
-
});
|
|
134
|
-
Object.defineProperty(exports, "Int64", {
|
|
135
|
-
enumerable: true,
|
|
136
|
-
get: function get() {
|
|
137
|
-
return _schema.Int64;
|
|
138
|
-
}
|
|
139
|
-
});
|
|
140
|
-
Object.defineProperty(exports, "Uint8", {
|
|
141
|
-
enumerable: true,
|
|
142
|
-
get: function get() {
|
|
143
|
-
return _schema.Uint8;
|
|
144
|
-
}
|
|
145
|
-
});
|
|
146
|
-
Object.defineProperty(exports, "Uint16", {
|
|
147
|
-
enumerable: true,
|
|
148
|
-
get: function get() {
|
|
149
|
-
return _schema.Uint16;
|
|
150
|
-
}
|
|
151
|
-
});
|
|
152
|
-
Object.defineProperty(exports, "Uint32", {
|
|
153
|
-
enumerable: true,
|
|
154
|
-
get: function get() {
|
|
155
|
-
return _schema.Uint32;
|
|
156
|
-
}
|
|
157
|
-
});
|
|
158
|
-
Object.defineProperty(exports, "Uint64", {
|
|
159
|
-
enumerable: true,
|
|
160
|
-
get: function get() {
|
|
161
|
-
return _schema.Uint64;
|
|
162
|
-
}
|
|
163
|
-
});
|
|
164
|
-
Object.defineProperty(exports, "Float", {
|
|
165
|
-
enumerable: true,
|
|
166
|
-
get: function get() {
|
|
167
|
-
return _schema.Float;
|
|
168
|
-
}
|
|
169
|
-
});
|
|
170
|
-
Object.defineProperty(exports, "Float16", {
|
|
171
|
-
enumerable: true,
|
|
172
|
-
get: function get() {
|
|
173
|
-
return _schema.Float16;
|
|
174
|
-
}
|
|
175
|
-
});
|
|
176
|
-
Object.defineProperty(exports, "Float32", {
|
|
177
|
-
enumerable: true,
|
|
178
|
-
get: function get() {
|
|
179
|
-
return _schema.Float32;
|
|
180
|
-
}
|
|
181
|
-
});
|
|
182
|
-
Object.defineProperty(exports, "Float64", {
|
|
183
|
-
enumerable: true,
|
|
184
|
-
get: function get() {
|
|
185
|
-
return _schema.Float64;
|
|
186
|
-
}
|
|
187
|
-
});
|
|
188
|
-
Object.defineProperty(exports, "Utf8", {
|
|
189
|
-
enumerable: true,
|
|
190
|
-
get: function get() {
|
|
191
|
-
return _schema.Utf8;
|
|
192
|
-
}
|
|
193
|
-
});
|
|
194
|
-
Object.defineProperty(exports, "Date", {
|
|
195
|
-
enumerable: true,
|
|
196
|
-
get: function get() {
|
|
197
|
-
return _schema.Date;
|
|
198
|
-
}
|
|
199
|
-
});
|
|
200
|
-
Object.defineProperty(exports, "DateDay", {
|
|
201
|
-
enumerable: true,
|
|
202
|
-
get: function get() {
|
|
203
|
-
return _schema.DateDay;
|
|
204
|
-
}
|
|
205
|
-
});
|
|
206
|
-
Object.defineProperty(exports, "DateMillisecond", {
|
|
207
|
-
enumerable: true,
|
|
208
|
-
get: function get() {
|
|
209
|
-
return _schema.DateMillisecond;
|
|
210
|
-
}
|
|
211
|
-
});
|
|
212
|
-
Object.defineProperty(exports, "Time", {
|
|
213
|
-
enumerable: true,
|
|
214
|
-
get: function get() {
|
|
215
|
-
return _schema.Time;
|
|
216
|
-
}
|
|
217
|
-
});
|
|
218
|
-
Object.defineProperty(exports, "TimeMillisecond", {
|
|
219
|
-
enumerable: true,
|
|
220
|
-
get: function get() {
|
|
221
|
-
return _schema.TimeMillisecond;
|
|
222
|
-
}
|
|
223
|
-
});
|
|
224
|
-
Object.defineProperty(exports, "TimeSecond", {
|
|
225
|
-
enumerable: true,
|
|
226
|
-
get: function get() {
|
|
227
|
-
return _schema.TimeSecond;
|
|
228
|
-
}
|
|
229
|
-
});
|
|
230
|
-
Object.defineProperty(exports, "Timestamp", {
|
|
231
|
-
enumerable: true,
|
|
232
|
-
get: function get() {
|
|
233
|
-
return _schema.Timestamp;
|
|
234
|
-
}
|
|
235
|
-
});
|
|
236
|
-
Object.defineProperty(exports, "TimestampSecond", {
|
|
237
|
-
enumerable: true,
|
|
238
|
-
get: function get() {
|
|
239
|
-
return _schema.TimestampSecond;
|
|
240
|
-
}
|
|
241
|
-
});
|
|
242
|
-
Object.defineProperty(exports, "TimestampMillisecond", {
|
|
243
|
-
enumerable: true,
|
|
244
|
-
get: function get() {
|
|
245
|
-
return _schema.TimestampMillisecond;
|
|
246
|
-
}
|
|
247
|
-
});
|
|
248
|
-
Object.defineProperty(exports, "TimestampMicrosecond", {
|
|
249
|
-
enumerable: true,
|
|
250
|
-
get: function get() {
|
|
251
|
-
return _schema.TimestampMicrosecond;
|
|
252
|
-
}
|
|
253
|
-
});
|
|
254
|
-
Object.defineProperty(exports, "TimestampNanosecond", {
|
|
255
|
-
enumerable: true,
|
|
256
|
-
get: function get() {
|
|
257
|
-
return _schema.TimestampNanosecond;
|
|
258
|
-
}
|
|
259
|
-
});
|
|
260
|
-
Object.defineProperty(exports, "Interval", {
|
|
261
|
-
enumerable: true,
|
|
262
|
-
get: function get() {
|
|
263
|
-
return _schema.Interval;
|
|
264
|
-
}
|
|
265
|
-
});
|
|
266
|
-
Object.defineProperty(exports, "IntervalDayTime", {
|
|
267
|
-
enumerable: true,
|
|
268
|
-
get: function get() {
|
|
269
|
-
return _schema.IntervalDayTime;
|
|
270
|
-
}
|
|
271
|
-
});
|
|
272
|
-
Object.defineProperty(exports, "IntervalYearMonth", {
|
|
273
|
-
enumerable: true,
|
|
274
|
-
get: function get() {
|
|
275
|
-
return _schema.IntervalYearMonth;
|
|
276
|
-
}
|
|
277
|
-
});
|
|
278
|
-
Object.defineProperty(exports, "FixedSizeList", {
|
|
279
|
-
enumerable: true,
|
|
280
|
-
get: function get() {
|
|
281
|
-
return _schema.FixedSizeList;
|
|
282
|
-
}
|
|
283
|
-
});
|
|
284
|
-
Object.defineProperty(exports, "Struct", {
|
|
285
|
-
enumerable: true,
|
|
286
|
-
get: function get() {
|
|
287
|
-
return _schema.Struct;
|
|
288
|
-
}
|
|
289
|
-
});
|
|
290
|
-
Object.defineProperty(exports, "deduceTypeFromColumn", {
|
|
291
|
-
enumerable: true,
|
|
292
|
-
get: function get() {
|
|
293
|
-
return _deduceColumnType.deduceTypeFromColumn;
|
|
294
|
-
}
|
|
295
|
-
});
|
|
296
|
-
Object.defineProperty(exports, "deduceTypeFromValue", {
|
|
297
|
-
enumerable: true,
|
|
298
|
-
get: function get() {
|
|
299
|
-
return _deduceColumnType.deduceTypeFromValue;
|
|
300
|
-
}
|
|
301
|
-
});
|
|
302
|
-
Object.defineProperty(exports, "getTypeInfo", {
|
|
303
|
-
enumerable: true,
|
|
304
|
-
get: function get() {
|
|
305
|
-
return _getTypeInfo.getTypeInfo;
|
|
306
|
-
}
|
|
307
|
-
});
|
|
308
|
-
Object.defineProperty(exports, "getArrowTypeFromTypedArray", {
|
|
309
|
-
enumerable: true,
|
|
310
|
-
get: function get() {
|
|
311
|
-
return _arrowLikeTypeUtils.getArrowTypeFromTypedArray;
|
|
312
|
-
}
|
|
313
|
-
});
|
|
314
|
-
Object.defineProperty(exports, "AsyncQueue", {
|
|
315
|
-
enumerable: true,
|
|
316
|
-
get: function get() {
|
|
317
|
-
return _asyncQueue.default;
|
|
318
|
-
}
|
|
319
|
-
});
|
|
320
|
-
|
|
321
|
-
var _tableBatchBuilder = _interopRequireDefault(require("./lib/batches/table-batch-builder"));
|
|
322
|
-
|
|
323
|
-
var _rowTableBatchAggregator = _interopRequireDefault(require("./lib/batches/row-table-batch-aggregator"));
|
|
324
|
-
|
|
325
|
-
var _columnarTableBatchAggregator = _interopRequireDefault(require("./lib/batches/columnar-table-batch-aggregator"));
|
|
326
|
-
|
|
327
|
-
var _rowUtils = require("./lib/utils/row-utils");
|
|
328
|
-
|
|
329
|
-
var _meshUtils = require("./category/mesh/mesh-utils");
|
|
330
|
-
|
|
331
|
-
var _convertMesh = require("./category/mesh/convert-mesh");
|
|
332
|
-
|
|
333
|
-
var _deduceMeshSchema = require("./category/mesh/deduce-mesh-schema");
|
|
334
|
-
|
|
335
|
-
var _schema = require("./lib/schema/schema");
|
|
336
|
-
|
|
337
|
-
var _deduceColumnType = require("./lib/schema-utils/deduce-column-type");
|
|
338
|
-
|
|
339
|
-
var _getTypeInfo = require("./lib/arrow/get-type-info");
|
|
340
|
-
|
|
341
|
-
var _arrowLikeTypeUtils = require("./lib/arrow/arrow-like-type-utils");
|
|
342
|
-
|
|
343
|
-
var _asyncQueue = _interopRequireDefault(require("./lib/utils/async-queue"));
|
|
344
|
-
//# sourceMappingURL=index.js.map
|
package/dist/es5/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuBA;;AAEA;;AACA;;AAEA;;AAYA;;AACA;;AACA;;AAiDA;;AA0CA;;AACA;;AACA;;AAEA","sourcesContent":["// COMMON CATEGORY\nexport type {TypedArray, NumberArray, AnyArray} from './types';\n\nexport type {Batch} from './category/common';\n\n// TABLE CATEGORY TYPES\n\nexport type {\n Table,\n ArrayRowTable,\n ObjectRowTable,\n ColumnarTable,\n ArrowTable\n} from './category/table/table-types';\nexport type {\n TableBatch,\n RowArrayTableBatch,\n RowObjectTableBatch,\n ColumnarTableBatch,\n ArrowTableBatch\n} from './category/table/table-types';\n\n// TABLE CATEGORY UTILS\nexport {default as TableBatchBuilder} from './lib/batches/table-batch-builder';\nexport type {TableBatchAggregator} from './lib/batches/table-batch-aggregator';\nexport {default as RowTableBatchAggregator} from './lib/batches/row-table-batch-aggregator';\nexport {default as ColumnarTableBatchAggregator} from './lib/batches/columnar-table-batch-aggregator';\n\nexport {convertToObjectRow, convertToArrayRow} from './lib/utils/row-utils';\n\n// MESH CATEGORY\nexport type {\n MeshTable,\n MeshArrowTable,\n Mesh,\n MeshGeometry,\n MeshAttribute,\n MeshAttributes\n} from './category/mesh/mesh-types';\n\nexport {getMeshSize, getMeshBoundingBox} from './category/mesh/mesh-utils';\nexport {convertMesh} from './category/mesh/convert-mesh';\nexport {\n deduceMeshSchema,\n deduceMeshField,\n makeMeshAttributeMetadata\n} from './category/mesh/deduce-mesh-schema';\n\n// TYPES\n// GIS CATEGORY - GEOJSON\nexport type {GeoJSON, Feature, Geometry, Position, GeoJsonProperties} from './category/gis';\nexport type {\n Point,\n MultiPoint,\n LineString,\n MultiLineString,\n Polygon,\n MultiPolygon,\n GeometryCollection\n} from './category/gis';\n\nexport type {GeojsonGeometryInfo} from './category/gis';\n\n// GIS CATEGORY - FLAT GEOJSON\nexport type {\n FlatFeature,\n FlatIndexedGeometry,\n FlatGeometry,\n FlatGeometryType,\n FlatPoint,\n FlatLineString,\n FlatPolygon\n} from './category/gis';\n\n// GIS CATEGORY - BINARY\nexport type {\n BinaryGeometryType,\n BinaryGeometry,\n BinaryPointGeometry,\n BinaryLineGeometry,\n BinaryPolygonGeometry,\n BinaryAttribute\n} from './category/gis';\nexport type {\n BinaryFeatures,\n BinaryPointFeatures,\n BinaryLineFeatures,\n BinaryPolygonFeatures\n} from './category/gis';\n\n// SCHEMA\nexport {\n Schema,\n Field,\n DataType,\n Null,\n Binary,\n Bool,\n Int,\n Int8,\n Int16,\n Int32,\n Int64,\n Uint8,\n Uint16,\n Uint32,\n Uint64,\n Float,\n Float16,\n Float32,\n Float64,\n Utf8,\n Date,\n DateDay,\n DateMillisecond,\n Time,\n TimeMillisecond,\n TimeSecond,\n Timestamp,\n TimestampSecond,\n TimestampMillisecond,\n TimestampMicrosecond,\n TimestampNanosecond,\n Interval,\n IntervalDayTime,\n IntervalYearMonth,\n FixedSizeList,\n Struct\n} from './lib/schema/schema';\n\n// EXPERIMENTAL APIs\n\n// SCHEMA UTILS\nexport {deduceTypeFromColumn, deduceTypeFromValue} from './lib/schema-utils/deduce-column-type';\nexport {getTypeInfo} from './lib/arrow/get-type-info';\nexport {getArrowTypeFromTypedArray} from './lib/arrow/arrow-like-type-utils';\n\nexport {default as AsyncQueue} from './lib/utils/async-queue';\n"],"file":"index.js"}
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.getArrowTypeFromTypedArray = getArrowTypeFromTypedArray;
|
|
7
|
-
|
|
8
|
-
var _schema = require("../schema/schema");
|
|
9
|
-
|
|
10
|
-
function getArrowTypeFromTypedArray(array) {
|
|
11
|
-
switch (array.constructor) {
|
|
12
|
-
case Int8Array:
|
|
13
|
-
return new _schema.Int8();
|
|
14
|
-
|
|
15
|
-
case Uint8Array:
|
|
16
|
-
return new _schema.Uint8();
|
|
17
|
-
|
|
18
|
-
case Int16Array:
|
|
19
|
-
return new _schema.Int16();
|
|
20
|
-
|
|
21
|
-
case Uint16Array:
|
|
22
|
-
return new _schema.Uint16();
|
|
23
|
-
|
|
24
|
-
case Int32Array:
|
|
25
|
-
return new _schema.Int32();
|
|
26
|
-
|
|
27
|
-
case Uint32Array:
|
|
28
|
-
return new _schema.Uint32();
|
|
29
|
-
|
|
30
|
-
case Float32Array:
|
|
31
|
-
return new _schema.Float32();
|
|
32
|
-
|
|
33
|
-
case Float64Array:
|
|
34
|
-
return new _schema.Float64();
|
|
35
|
-
|
|
36
|
-
default:
|
|
37
|
-
throw new Error('array type not supported');
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
//# sourceMappingURL=arrow-like-type-utils.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/lib/arrow/arrow-like-type-utils.ts"],"names":["getArrowTypeFromTypedArray","array","constructor","Int8Array","Int8","Uint8Array","Uint8","Int16Array","Int16","Uint16Array","Uint16","Int32Array","Int32","Uint32Array","Uint32","Float32Array","Float32","Float64Array","Float64","Error"],"mappings":";;;;;;;AACA;;AAYO,SAASA,0BAAT,CAAoCC,KAApC,EAAiE;AACtE,UAAQA,KAAK,CAACC,WAAd;AACE,SAAKC,SAAL;AACE,aAAO,IAAIC,YAAJ,EAAP;;AACF,SAAKC,UAAL;AACE,aAAO,IAAIC,aAAJ,EAAP;;AACF,SAAKC,UAAL;AACE,aAAO,IAAIC,aAAJ,EAAP;;AACF,SAAKC,WAAL;AACE,aAAO,IAAIC,cAAJ,EAAP;;AACF,SAAKC,UAAL;AACE,aAAO,IAAIC,aAAJ,EAAP;;AACF,SAAKC,WAAL;AACE,aAAO,IAAIC,cAAJ,EAAP;;AACF,SAAKC,YAAL;AACE,aAAO,IAAIC,eAAJ,EAAP;;AACF,SAAKC,YAAL;AACE,aAAO,IAAIC,eAAJ,EAAP;;AACF;AACE,YAAM,IAAIC,KAAJ,CAAU,0BAAV,CAAN;AAlBJ;AAoBD","sourcesContent":["import type {TypedArray} from '../../types';\nimport {\n DataType,\n Float32,\n Float64,\n Int16,\n Int32,\n Int8,\n Uint16,\n Uint32,\n Uint8\n} from '../schema/schema';\n\nexport function getArrowTypeFromTypedArray(array: TypedArray): DataType {\n switch (array.constructor) {\n case Int8Array:\n return new Int8();\n case Uint8Array:\n return new Uint8();\n case Int16Array:\n return new Int16();\n case Uint16Array:\n return new Uint16();\n case Int32Array:\n return new Int32();\n case Uint32Array:\n return new Uint32();\n case Float32Array:\n return new Float32();\n case Float64Array:\n return new Float64();\n default:\n throw new Error('array type not supported');\n }\n}\n"],"file":"arrow-like-type-utils.js"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[],"file":"arrow-type-utils.js"}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.getTypeInfo = getTypeInfo;
|
|
7
|
-
|
|
8
|
-
var _schema = require("../schema/schema");
|
|
9
|
-
|
|
10
|
-
function getTypeInfo(arrowTypeLike) {
|
|
11
|
-
return {
|
|
12
|
-
typeId: arrowTypeLike.typeId,
|
|
13
|
-
ArrayType: arrowTypeLike.ArrayType,
|
|
14
|
-
typeName: arrowTypeLike.toString(),
|
|
15
|
-
typeEnumName: getTypeKey(arrowTypeLike.typeId),
|
|
16
|
-
precision: arrowTypeLike.precision
|
|
17
|
-
};
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
var ReverseType = null;
|
|
21
|
-
|
|
22
|
-
function getTypeKey(typeKey) {
|
|
23
|
-
if (!ReverseType) {
|
|
24
|
-
ReverseType = {};
|
|
25
|
-
|
|
26
|
-
for (var _key in _schema.Type) {
|
|
27
|
-
ReverseType[_schema.Type[_key]] = _key;
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
return ReverseType[typeKey];
|
|
32
|
-
}
|
|
33
|
-
//# sourceMappingURL=get-type-info.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/lib/arrow/get-type-info.ts"],"names":["getTypeInfo","arrowTypeLike","typeId","ArrayType","typeName","toString","typeEnumName","getTypeKey","precision","ReverseType","typeKey","key","Type"],"mappings":";;;;;;;AAAA;;AAOO,SAASA,WAAT,CAAqBC,aAArB,EAML;AACA,SAAO;AACLC,IAAAA,MAAM,EAAED,aAAa,CAACC,MADjB;AAELC,IAAAA,SAAS,EAAEF,aAAa,CAACE,SAFpB;AAGLC,IAAAA,QAAQ,EAAEH,aAAa,CAACI,QAAd,EAHL;AAILC,IAAAA,YAAY,EAAEC,UAAU,CAACN,aAAa,CAACC,MAAf,CAJnB;AAKLM,IAAAA,SAAS,EAAEP,aAAa,CAACO;AALpB,GAAP;AAOD;;AAED,IAAIC,WAA2C,GAAG,IAAlD;;AAEA,SAASF,UAAT,CAAoBG,OAApB,EAA6B;AAC3B,MAAI,CAACD,WAAL,EAAkB;AAChBA,IAAAA,WAAW,GAAG,EAAd;;AACA,SAAK,IAAME,IAAX,IAAkBC,YAAlB,EAAwB;AACtBH,MAAAA,WAAW,CAACG,aAAKD,IAAL,CAAD,CAAX,GAAyBA,IAAzB;AACD;AACF;;AAED,SAAOF,WAAW,CAACC,OAAD,CAAlB;AACD","sourcesContent":["import {Type} from '../schema/schema';\nimport {AnyArray} from '../../types';\n\n/**\n * Gets type information from an Arrow type object or \"mock\" Arrow type object\n * @param arrowTypeLike Arrow Type or type object of similar shape\n */\nexport function getTypeInfo(arrowTypeLike: any): {\n typeId: Type;\n ArrayType: AnyArray;\n typeName: string;\n typeEnumName?: string;\n precision?: number;\n} {\n return {\n typeId: arrowTypeLike.typeId,\n ArrayType: arrowTypeLike.ArrayType,\n typeName: arrowTypeLike.toString(),\n typeEnumName: getTypeKey(arrowTypeLike.typeId),\n precision: arrowTypeLike.precision\n };\n}\n\nlet ReverseType: {[key: string]: string} | null = null;\n\nfunction getTypeKey(typeKey) {\n if (!ReverseType) {\n ReverseType = {};\n for (const key in Type) {\n ReverseType[Type[key]] = key;\n }\n }\n\n return ReverseType[typeKey];\n}\n"],"file":"get-type-info.js"}
|
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports.default = void 0;
|
|
9
|
-
|
|
10
|
-
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
11
|
-
|
|
12
|
-
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
13
|
-
|
|
14
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
15
|
-
|
|
16
|
-
var DEFAULT_ROW_COUNT = 100;
|
|
17
|
-
|
|
18
|
-
var RowTableBatchAggregator = function () {
|
|
19
|
-
function RowTableBatchAggregator(schema, options) {
|
|
20
|
-
(0, _classCallCheck2.default)(this, RowTableBatchAggregator);
|
|
21
|
-
(0, _defineProperty2.default)(this, "schema", void 0);
|
|
22
|
-
(0, _defineProperty2.default)(this, "options", void 0);
|
|
23
|
-
(0, _defineProperty2.default)(this, "length", 0);
|
|
24
|
-
(0, _defineProperty2.default)(this, "rows", null);
|
|
25
|
-
(0, _defineProperty2.default)(this, "cursor", 0);
|
|
26
|
-
(0, _defineProperty2.default)(this, "_headers", []);
|
|
27
|
-
this.options = options;
|
|
28
|
-
this.schema = schema;
|
|
29
|
-
|
|
30
|
-
if (!Array.isArray(schema)) {
|
|
31
|
-
this._headers = [];
|
|
32
|
-
|
|
33
|
-
for (var key in schema) {
|
|
34
|
-
this._headers[schema[key].index] = schema[key].name;
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
(0, _createClass2.default)(RowTableBatchAggregator, [{
|
|
40
|
-
key: "rowCount",
|
|
41
|
-
value: function rowCount() {
|
|
42
|
-
return this.length;
|
|
43
|
-
}
|
|
44
|
-
}, {
|
|
45
|
-
key: "addArrayRow",
|
|
46
|
-
value: function addArrayRow(row, cursor) {
|
|
47
|
-
if (Number.isFinite(cursor)) {
|
|
48
|
-
this.cursor = cursor;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
this.rows = this.rows || new Array(DEFAULT_ROW_COUNT);
|
|
52
|
-
this.rows[this.length] = row;
|
|
53
|
-
this.length++;
|
|
54
|
-
}
|
|
55
|
-
}, {
|
|
56
|
-
key: "addObjectRow",
|
|
57
|
-
value: function addObjectRow(row, cursor) {
|
|
58
|
-
if (Number.isFinite(cursor)) {
|
|
59
|
-
this.cursor = cursor;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
this.rows = this.rows || new Array(DEFAULT_ROW_COUNT);
|
|
63
|
-
this.rows[this.length] = row;
|
|
64
|
-
this.length++;
|
|
65
|
-
}
|
|
66
|
-
}, {
|
|
67
|
-
key: "getBatch",
|
|
68
|
-
value: function getBatch() {
|
|
69
|
-
var rows = this.rows;
|
|
70
|
-
|
|
71
|
-
if (!rows) {
|
|
72
|
-
return null;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
rows = rows.slice(0, this.length);
|
|
76
|
-
this.rows = null;
|
|
77
|
-
var batch = {
|
|
78
|
-
shape: this.options.shape,
|
|
79
|
-
batchType: 'data',
|
|
80
|
-
data: rows,
|
|
81
|
-
length: this.length,
|
|
82
|
-
schema: this.schema,
|
|
83
|
-
cursor: this.cursor
|
|
84
|
-
};
|
|
85
|
-
return batch;
|
|
86
|
-
}
|
|
87
|
-
}]);
|
|
88
|
-
return RowTableBatchAggregator;
|
|
89
|
-
}();
|
|
90
|
-
|
|
91
|
-
exports.default = RowTableBatchAggregator;
|
|
92
|
-
//# sourceMappingURL=base-table-batch-aggregator.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/lib/batches/base-table-batch-aggregator.ts"],"names":["DEFAULT_ROW_COUNT","RowTableBatchAggregator","schema","options","Array","isArray","_headers","key","index","name","length","row","cursor","Number","isFinite","rows","slice","batch","shape","batchType","data"],"mappings":";;;;;;;;;;;;;;;AAIA,IAAMA,iBAAiB,GAAG,GAA1B;;IAEqBC,uB;AASnB,mCAAYC,MAAZ,EAA4BC,OAA5B,EAAwD;AAAA;AAAA;AAAA;AAAA,kDALvC,CAKuC;AAAA,gDAJnC,IAImC;AAAA,kDAHvC,CAGuC;AAAA,oDAF3B,EAE2B;AACtD,SAAKA,OAAL,GAAeA,OAAf;AACA,SAAKD,MAAL,GAAcA,MAAd;;AAIA,QAAI,CAACE,KAAK,CAACC,OAAN,CAAcH,MAAd,CAAL,EAA4B;AAC1B,WAAKI,QAAL,GAAgB,EAAhB;;AACA,WAAK,IAAMC,GAAX,IAAkBL,MAAlB,EAA0B;AACxB,aAAKI,QAAL,CAAcJ,MAAM,CAACK,GAAD,CAAN,CAAYC,KAA1B,IAAmCN,MAAM,CAACK,GAAD,CAAN,CAAYE,IAA/C;AACD;AACF;AACF;;;;WAED,oBAAmB;AACjB,aAAO,KAAKC,MAAZ;AACD;;;WAED,qBAAYC,GAAZ,EAAwBC,MAAxB,EAA+C;AAC7C,UAAIC,MAAM,CAACC,QAAP,CAAgBF,MAAhB,CAAJ,EAA6B;AAC3B,aAAKA,MAAL,GAAcA,MAAd;AACD;;AAED,WAAKG,IAAL,GAAY,KAAKA,IAAL,IAAa,IAAIX,KAAJ,CAAUJ,iBAAV,CAAzB;AACA,WAAKe,IAAL,CAAU,KAAKL,MAAf,IAAyBC,GAAzB;AACA,WAAKD,MAAL;AACD;;;WAED,sBAAaC,GAAb,EAA+CC,MAA/C,EAAsE;AACpE,UAAIC,MAAM,CAACC,QAAP,CAAgBF,MAAhB,CAAJ,EAA6B;AAC3B,aAAKA,MAAL,GAAcA,MAAd;AACD;;AAED,WAAKG,IAAL,GAAY,KAAKA,IAAL,IAAa,IAAIX,KAAJ,CAAUJ,iBAAV,CAAzB;AACA,WAAKe,IAAL,CAAU,KAAKL,MAAf,IAAyBC,GAAzB;AACA,WAAKD,MAAL;AACD;;;WAED,oBAA8B;AAC5B,UAAIK,IAAI,GAAG,KAAKA,IAAhB;;AACA,UAAI,CAACA,IAAL,EAAW;AACT,eAAO,IAAP;AACD;;AAEDA,MAAAA,IAAI,GAAGA,IAAI,CAACC,KAAL,CAAW,CAAX,EAAc,KAAKN,MAAnB,CAAP;AACA,WAAKK,IAAL,GAAY,IAAZ;AAEA,UAAME,KAAiB,GAAG;AACxBC,QAAAA,KAAK,EAAE,KAAKf,OAAL,CAAae,KADI;AAExBC,QAAAA,SAAS,EAAE,MAFa;AAGxBC,QAAAA,IAAI,EAAEL,IAHkB;AAIxBL,QAAAA,MAAM,EAAE,KAAKA,MAJW;AAKxBR,QAAAA,MAAM,EAAE,KAAKA,MALW;AAMxBU,QAAAA,MAAM,EAAE,KAAKA;AANW,OAA1B;AASA,aAAOK,KAAP;AACD","sourcesContent":["import type {Schema} from '../schema/schema';\nimport type {TableBatch} from '../../category/table/table-types';\nimport {TableBatchAggregator, TableBatchOptions} from './table-batch-aggregator';\n\nconst DEFAULT_ROW_COUNT = 100;\n\nexport default class RowTableBatchAggregator implements TableBatchAggregator {\n schema: Schema;\n options: TableBatchOptions;\n\n length: number = 0;\n rows: any[] | null = null;\n cursor: number = 0;\n private _headers: string[] = [];\n\n constructor(schema: Schema, options: TableBatchOptions) {\n this.options = options;\n this.schema = schema;\n\n // schema is an array if there're no headers\n // object if there are headers\n if (!Array.isArray(schema)) {\n this._headers = [];\n for (const key in schema) {\n this._headers[schema[key].index] = schema[key].name;\n }\n }\n }\n\n rowCount(): number {\n return this.length;\n }\n\n addArrayRow(row: any[], cursor?: number): void {\n if (Number.isFinite(cursor)) {\n this.cursor = cursor as number;\n }\n\n this.rows = this.rows || new Array(DEFAULT_ROW_COUNT);\n this.rows[this.length] = row;\n this.length++;\n }\n\n addObjectRow(row: {[columnName: string]: any}, cursor?: number): void {\n if (Number.isFinite(cursor)) {\n this.cursor = cursor as number;\n }\n\n this.rows = this.rows || new Array(DEFAULT_ROW_COUNT);\n this.rows[this.length] = row;\n this.length++;\n }\n\n getBatch(): TableBatch | null {\n let rows = this.rows;\n if (!rows) {\n return null;\n }\n\n rows = rows.slice(0, this.length);\n this.rows = null;\n\n const batch: TableBatch = {\n shape: this.options.shape,\n batchType: 'data',\n data: rows,\n length: this.length,\n schema: this.schema,\n cursor: this.cursor\n };\n\n return batch;\n }\n}\n"],"file":"base-table-batch-aggregator.js"}
|
|
@@ -1,128 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports.default = void 0;
|
|
9
|
-
|
|
10
|
-
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
11
|
-
|
|
12
|
-
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
13
|
-
|
|
14
|
-
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
15
|
-
|
|
16
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
17
|
-
|
|
18
|
-
var DEFAULT_ROW_COUNT = 100;
|
|
19
|
-
|
|
20
|
-
var ColumnarTableBatchAggregator = function () {
|
|
21
|
-
function ColumnarTableBatchAggregator(schema, options) {
|
|
22
|
-
(0, _classCallCheck2.default)(this, ColumnarTableBatchAggregator);
|
|
23
|
-
(0, _defineProperty2.default)(this, "schema", void 0);
|
|
24
|
-
(0, _defineProperty2.default)(this, "length", 0);
|
|
25
|
-
(0, _defineProperty2.default)(this, "allocated", 0);
|
|
26
|
-
(0, _defineProperty2.default)(this, "columns", {});
|
|
27
|
-
this.schema = schema;
|
|
28
|
-
|
|
29
|
-
this._reallocateColumns();
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
(0, _createClass2.default)(ColumnarTableBatchAggregator, [{
|
|
33
|
-
key: "rowCount",
|
|
34
|
-
value: function rowCount() {
|
|
35
|
-
return this.length;
|
|
36
|
-
}
|
|
37
|
-
}, {
|
|
38
|
-
key: "addArrayRow",
|
|
39
|
-
value: function addArrayRow(row) {
|
|
40
|
-
this._reallocateColumns();
|
|
41
|
-
|
|
42
|
-
var i = 0;
|
|
43
|
-
|
|
44
|
-
for (var fieldName in this.columns) {
|
|
45
|
-
this.columns[fieldName][this.length] = row[i++];
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
this.length++;
|
|
49
|
-
}
|
|
50
|
-
}, {
|
|
51
|
-
key: "addObjectRow",
|
|
52
|
-
value: function addObjectRow(row) {
|
|
53
|
-
this._reallocateColumns();
|
|
54
|
-
|
|
55
|
-
for (var fieldName in row) {
|
|
56
|
-
this.columns[fieldName][this.length] = row[fieldName];
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
this.length++;
|
|
60
|
-
}
|
|
61
|
-
}, {
|
|
62
|
-
key: "getBatch",
|
|
63
|
-
value: function getBatch() {
|
|
64
|
-
this._pruneColumns();
|
|
65
|
-
|
|
66
|
-
var columns = Array.isArray(this.schema) ? this.columns : {};
|
|
67
|
-
|
|
68
|
-
if (!Array.isArray(this.schema)) {
|
|
69
|
-
for (var fieldName in this.schema) {
|
|
70
|
-
var field = this.schema[fieldName];
|
|
71
|
-
columns[field.name] = this.columns[field.index];
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
this.columns = {};
|
|
76
|
-
var batch = {
|
|
77
|
-
shape: 'columnar-table',
|
|
78
|
-
batchType: 'data',
|
|
79
|
-
data: columns,
|
|
80
|
-
schema: this.schema,
|
|
81
|
-
length: this.length
|
|
82
|
-
};
|
|
83
|
-
return batch;
|
|
84
|
-
}
|
|
85
|
-
}, {
|
|
86
|
-
key: "_reallocateColumns",
|
|
87
|
-
value: function _reallocateColumns() {
|
|
88
|
-
if (this.length < this.allocated) {
|
|
89
|
-
return;
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
this.allocated = this.allocated > 0 ? this.allocated *= 2 : DEFAULT_ROW_COUNT;
|
|
93
|
-
this.columns = {};
|
|
94
|
-
|
|
95
|
-
for (var fieldName in this.schema) {
|
|
96
|
-
var field = this.schema[fieldName];
|
|
97
|
-
var ArrayType = field.type || Float32Array;
|
|
98
|
-
var oldColumn = this.columns[field.index];
|
|
99
|
-
|
|
100
|
-
if (oldColumn && ArrayBuffer.isView(oldColumn)) {
|
|
101
|
-
var typedArray = new ArrayType(this.allocated);
|
|
102
|
-
typedArray.set(oldColumn);
|
|
103
|
-
this.columns[field.index] = typedArray;
|
|
104
|
-
} else if (oldColumn) {
|
|
105
|
-
oldColumn.length = this.allocated;
|
|
106
|
-
this.columns[field.index] = oldColumn;
|
|
107
|
-
} else {
|
|
108
|
-
this.columns[field.index] = new ArrayType(this.allocated);
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
}, {
|
|
113
|
-
key: "_pruneColumns",
|
|
114
|
-
value: function _pruneColumns() {
|
|
115
|
-
for (var _i = 0, _Object$entries = Object.entries(this.columns); _i < _Object$entries.length; _i++) {
|
|
116
|
-
var _Object$entries$_i = (0, _slicedToArray2.default)(_Object$entries[_i], 2),
|
|
117
|
-
_columnName = _Object$entries$_i[0],
|
|
118
|
-
column = _Object$entries$_i[1];
|
|
119
|
-
|
|
120
|
-
this.columns[_columnName] = column.slice(0, this.length);
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
}]);
|
|
124
|
-
return ColumnarTableBatchAggregator;
|
|
125
|
-
}();
|
|
126
|
-
|
|
127
|
-
exports.default = ColumnarTableBatchAggregator;
|
|
128
|
-
//# sourceMappingURL=columnar-table-batch-aggregator.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/lib/batches/columnar-table-batch-aggregator.ts"],"names":["DEFAULT_ROW_COUNT","ColumnarTableBatchAggregator","schema","options","_reallocateColumns","length","row","i","fieldName","columns","_pruneColumns","Array","isArray","field","name","index","batch","shape","batchType","data","allocated","ArrayType","type","Float32Array","oldColumn","ArrayBuffer","isView","typedArray","set","Object","entries","columnName","column","slice"],"mappings":"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","sourcesContent":["import type {Schema} from '../schema/schema';\nimport type {ColumnarTableBatch, ArrowTableBatch} from '../../category/table/table-types';\nimport {TableBatchAggregator} from './table-batch-aggregator';\n\ntype ColumnarTableBatchOptions = {};\n\nconst DEFAULT_ROW_COUNT = 100;\n\nexport default class ColumnarTableBatchAggregator implements TableBatchAggregator {\n schema: Schema;\n length: number = 0;\n allocated: number = 0;\n columns: {[columnName: string]: any[]} = {};\n\n constructor(schema: Schema, options: ColumnarTableBatchOptions) {\n this.schema = schema;\n this._reallocateColumns();\n }\n\n rowCount(): number {\n return this.length;\n }\n\n addArrayRow(row: any[]) {\n // If user keeps pushing rows beyond batch size, reallocate\n this._reallocateColumns();\n let i = 0;\n // TODO what if no csv header, columns not populated?\n for (const fieldName in this.columns) {\n this.columns[fieldName][this.length] = row[i++];\n }\n this.length++;\n }\n\n addObjectRow(row: {[columnName: string]: any}): void {\n // If user keeps pushing rows beyond batch size, reallocate\n this._reallocateColumns();\n for (const fieldName in row) {\n this.columns[fieldName][this.length] = row[fieldName];\n }\n this.length++;\n }\n\n getBatch(): ColumnarTableBatch | ArrowTableBatch | null {\n this._pruneColumns();\n const columns = Array.isArray(this.schema) ? this.columns : {};\n\n // schema is an array if there're no headers\n // object if there are headers\n // columns should match schema format\n if (!Array.isArray(this.schema)) {\n for (const fieldName in this.schema) {\n const field = this.schema[fieldName];\n columns[field.name] = this.columns[field.index];\n }\n }\n\n this.columns = {};\n\n const batch: ColumnarTableBatch = {\n shape: 'columnar-table',\n batchType: 'data',\n data: columns,\n schema: this.schema,\n length: this.length\n };\n\n return batch;\n }\n\n // HELPERS\n\n _reallocateColumns() {\n if (this.length < this.allocated) {\n return;\n }\n\n // @ts-ignore TODO\n this.allocated = this.allocated > 0 ? (this.allocated *= 2) : DEFAULT_ROW_COUNT;\n this.columns = {};\n\n for (const fieldName in this.schema) {\n const field = this.schema[fieldName];\n const ArrayType = field.type || Float32Array;\n const oldColumn = this.columns[field.index];\n\n if (oldColumn && ArrayBuffer.isView(oldColumn)) {\n // Copy the old data to the new array\n const typedArray = new ArrayType(this.allocated);\n typedArray.set(oldColumn);\n this.columns[field.index] = typedArray;\n } else if (oldColumn) {\n // Plain array\n oldColumn.length = this.allocated;\n this.columns[field.index] = oldColumn;\n } else {\n // Create new\n this.columns[field.index] = new ArrayType(this.allocated);\n }\n }\n }\n\n _pruneColumns() {\n for (const [columnName, column] of Object.entries(this.columns)) {\n this.columns[columnName] = column.slice(0, this.length);\n }\n }\n}\n"],"file":"columnar-table-batch-aggregator.js"}
|