@loaders.gl/schema 3.1.0-beta.5 → 3.1.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/category/gis.d.ts +49 -0
- package/dist/category/gis.d.ts.map +1 -1
- package/dist/es5/bundle.js +1 -1
- package/dist/es5/bundle.js.map +1 -1
- package/dist/es5/category/mesh/convert-mesh.js +10 -2
- package/dist/es5/category/mesh/convert-mesh.js.map +1 -1
- package/dist/es5/category/mesh/deduce-mesh-schema.js +8 -8
- package/dist/es5/category/mesh/deduce-mesh-schema.js.map +1 -1
- package/dist/es5/category/mesh/mesh-utils.js +16 -16
- package/dist/es5/category/mesh/mesh-utils.js.map +1 -1
- package/dist/es5/category/table/deduce-table-schema.js +9 -9
- package/dist/es5/category/table/deduce-table-schema.js.map +1 -1
- package/dist/es5/index.js +52 -52
- package/dist/es5/index.js.map +1 -1
- package/dist/es5/lib/arrow/get-type-info.js +3 -3
- package/dist/es5/lib/arrow/get-type-info.js.map +1 -1
- package/dist/es5/lib/batches/base-table-batch-aggregator.js +53 -42
- package/dist/es5/lib/batches/base-table-batch-aggregator.js.map +1 -1
- package/dist/es5/lib/batches/columnar-table-batch-aggregator.js +90 -71
- package/dist/es5/lib/batches/columnar-table-batch-aggregator.js.map +1 -1
- package/dist/es5/lib/batches/row-table-batch-aggregator.js +70 -59
- package/dist/es5/lib/batches/row-table-batch-aggregator.js.map +1 -1
- package/dist/es5/lib/batches/table-batch-builder.js +133 -113
- package/dist/es5/lib/batches/table-batch-builder.js.map +1 -1
- package/dist/es5/lib/schema/impl/enum.js +1 -1
- package/dist/es5/lib/schema/impl/field.js +32 -19
- package/dist/es5/lib/schema/impl/field.js.map +1 -1
- package/dist/es5/lib/schema/impl/schema.js +119 -54
- package/dist/es5/lib/schema/impl/schema.js.map +1 -1
- package/dist/es5/lib/schema/impl/type.js +728 -395
- package/dist/es5/lib/schema/impl/type.js.map +1 -1
- package/dist/es5/lib/schema/schema.js +37 -37
- package/dist/es5/lib/utils/async-queue.js +164 -81
- package/dist/es5/lib/utils/async-queue.js.map +1 -1
- package/dist/es5/lib/utils/row-utils.js +4 -4
- package/dist/es5/lib/utils/row-utils.js.map +1 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/category/gis.ts +60 -0
- package/src/index.ts +13 -0
package/dist/es5/index.js
CHANGED
|
@@ -7,313 +7,313 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
});
|
|
8
8
|
Object.defineProperty(exports, "TableBatchBuilder", {
|
|
9
9
|
enumerable: true,
|
|
10
|
-
get: function () {
|
|
10
|
+
get: function get() {
|
|
11
11
|
return _tableBatchBuilder.default;
|
|
12
12
|
}
|
|
13
13
|
});
|
|
14
14
|
Object.defineProperty(exports, "RowTableBatchAggregator", {
|
|
15
15
|
enumerable: true,
|
|
16
|
-
get: function () {
|
|
16
|
+
get: function get() {
|
|
17
17
|
return _rowTableBatchAggregator.default;
|
|
18
18
|
}
|
|
19
19
|
});
|
|
20
20
|
Object.defineProperty(exports, "ColumnarTableBatchAggregator", {
|
|
21
21
|
enumerable: true,
|
|
22
|
-
get: function () {
|
|
22
|
+
get: function get() {
|
|
23
23
|
return _columnarTableBatchAggregator.default;
|
|
24
24
|
}
|
|
25
25
|
});
|
|
26
26
|
Object.defineProperty(exports, "convertToObjectRow", {
|
|
27
27
|
enumerable: true,
|
|
28
|
-
get: function () {
|
|
28
|
+
get: function get() {
|
|
29
29
|
return _rowUtils.convertToObjectRow;
|
|
30
30
|
}
|
|
31
31
|
});
|
|
32
32
|
Object.defineProperty(exports, "convertToArrayRow", {
|
|
33
33
|
enumerable: true,
|
|
34
|
-
get: function () {
|
|
34
|
+
get: function get() {
|
|
35
35
|
return _rowUtils.convertToArrayRow;
|
|
36
36
|
}
|
|
37
37
|
});
|
|
38
38
|
Object.defineProperty(exports, "getMeshSize", {
|
|
39
39
|
enumerable: true,
|
|
40
|
-
get: function () {
|
|
40
|
+
get: function get() {
|
|
41
41
|
return _meshUtils.getMeshSize;
|
|
42
42
|
}
|
|
43
43
|
});
|
|
44
44
|
Object.defineProperty(exports, "getMeshBoundingBox", {
|
|
45
45
|
enumerable: true,
|
|
46
|
-
get: function () {
|
|
46
|
+
get: function get() {
|
|
47
47
|
return _meshUtils.getMeshBoundingBox;
|
|
48
48
|
}
|
|
49
49
|
});
|
|
50
50
|
Object.defineProperty(exports, "convertMesh", {
|
|
51
51
|
enumerable: true,
|
|
52
|
-
get: function () {
|
|
52
|
+
get: function get() {
|
|
53
53
|
return _convertMesh.convertMesh;
|
|
54
54
|
}
|
|
55
55
|
});
|
|
56
56
|
Object.defineProperty(exports, "deduceMeshSchema", {
|
|
57
57
|
enumerable: true,
|
|
58
|
-
get: function () {
|
|
58
|
+
get: function get() {
|
|
59
59
|
return _deduceMeshSchema.deduceMeshSchema;
|
|
60
60
|
}
|
|
61
61
|
});
|
|
62
62
|
Object.defineProperty(exports, "deduceMeshField", {
|
|
63
63
|
enumerable: true,
|
|
64
|
-
get: function () {
|
|
64
|
+
get: function get() {
|
|
65
65
|
return _deduceMeshSchema.deduceMeshField;
|
|
66
66
|
}
|
|
67
67
|
});
|
|
68
68
|
Object.defineProperty(exports, "makeMeshAttributeMetadata", {
|
|
69
69
|
enumerable: true,
|
|
70
|
-
get: function () {
|
|
70
|
+
get: function get() {
|
|
71
71
|
return _deduceMeshSchema.makeMeshAttributeMetadata;
|
|
72
72
|
}
|
|
73
73
|
});
|
|
74
74
|
Object.defineProperty(exports, "Schema", {
|
|
75
75
|
enumerable: true,
|
|
76
|
-
get: function () {
|
|
76
|
+
get: function get() {
|
|
77
77
|
return _schema.Schema;
|
|
78
78
|
}
|
|
79
79
|
});
|
|
80
80
|
Object.defineProperty(exports, "Field", {
|
|
81
81
|
enumerable: true,
|
|
82
|
-
get: function () {
|
|
82
|
+
get: function get() {
|
|
83
83
|
return _schema.Field;
|
|
84
84
|
}
|
|
85
85
|
});
|
|
86
86
|
Object.defineProperty(exports, "DataType", {
|
|
87
87
|
enumerable: true,
|
|
88
|
-
get: function () {
|
|
88
|
+
get: function get() {
|
|
89
89
|
return _schema.DataType;
|
|
90
90
|
}
|
|
91
91
|
});
|
|
92
92
|
Object.defineProperty(exports, "Null", {
|
|
93
93
|
enumerable: true,
|
|
94
|
-
get: function () {
|
|
94
|
+
get: function get() {
|
|
95
95
|
return _schema.Null;
|
|
96
96
|
}
|
|
97
97
|
});
|
|
98
98
|
Object.defineProperty(exports, "Binary", {
|
|
99
99
|
enumerable: true,
|
|
100
|
-
get: function () {
|
|
100
|
+
get: function get() {
|
|
101
101
|
return _schema.Binary;
|
|
102
102
|
}
|
|
103
103
|
});
|
|
104
104
|
Object.defineProperty(exports, "Bool", {
|
|
105
105
|
enumerable: true,
|
|
106
|
-
get: function () {
|
|
106
|
+
get: function get() {
|
|
107
107
|
return _schema.Bool;
|
|
108
108
|
}
|
|
109
109
|
});
|
|
110
110
|
Object.defineProperty(exports, "Int", {
|
|
111
111
|
enumerable: true,
|
|
112
|
-
get: function () {
|
|
112
|
+
get: function get() {
|
|
113
113
|
return _schema.Int;
|
|
114
114
|
}
|
|
115
115
|
});
|
|
116
116
|
Object.defineProperty(exports, "Int8", {
|
|
117
117
|
enumerable: true,
|
|
118
|
-
get: function () {
|
|
118
|
+
get: function get() {
|
|
119
119
|
return _schema.Int8;
|
|
120
120
|
}
|
|
121
121
|
});
|
|
122
122
|
Object.defineProperty(exports, "Int16", {
|
|
123
123
|
enumerable: true,
|
|
124
|
-
get: function () {
|
|
124
|
+
get: function get() {
|
|
125
125
|
return _schema.Int16;
|
|
126
126
|
}
|
|
127
127
|
});
|
|
128
128
|
Object.defineProperty(exports, "Int32", {
|
|
129
129
|
enumerable: true,
|
|
130
|
-
get: function () {
|
|
130
|
+
get: function get() {
|
|
131
131
|
return _schema.Int32;
|
|
132
132
|
}
|
|
133
133
|
});
|
|
134
134
|
Object.defineProperty(exports, "Int64", {
|
|
135
135
|
enumerable: true,
|
|
136
|
-
get: function () {
|
|
136
|
+
get: function get() {
|
|
137
137
|
return _schema.Int64;
|
|
138
138
|
}
|
|
139
139
|
});
|
|
140
140
|
Object.defineProperty(exports, "Uint8", {
|
|
141
141
|
enumerable: true,
|
|
142
|
-
get: function () {
|
|
142
|
+
get: function get() {
|
|
143
143
|
return _schema.Uint8;
|
|
144
144
|
}
|
|
145
145
|
});
|
|
146
146
|
Object.defineProperty(exports, "Uint16", {
|
|
147
147
|
enumerable: true,
|
|
148
|
-
get: function () {
|
|
148
|
+
get: function get() {
|
|
149
149
|
return _schema.Uint16;
|
|
150
150
|
}
|
|
151
151
|
});
|
|
152
152
|
Object.defineProperty(exports, "Uint32", {
|
|
153
153
|
enumerable: true,
|
|
154
|
-
get: function () {
|
|
154
|
+
get: function get() {
|
|
155
155
|
return _schema.Uint32;
|
|
156
156
|
}
|
|
157
157
|
});
|
|
158
158
|
Object.defineProperty(exports, "Uint64", {
|
|
159
159
|
enumerable: true,
|
|
160
|
-
get: function () {
|
|
160
|
+
get: function get() {
|
|
161
161
|
return _schema.Uint64;
|
|
162
162
|
}
|
|
163
163
|
});
|
|
164
164
|
Object.defineProperty(exports, "Float", {
|
|
165
165
|
enumerable: true,
|
|
166
|
-
get: function () {
|
|
166
|
+
get: function get() {
|
|
167
167
|
return _schema.Float;
|
|
168
168
|
}
|
|
169
169
|
});
|
|
170
170
|
Object.defineProperty(exports, "Float16", {
|
|
171
171
|
enumerable: true,
|
|
172
|
-
get: function () {
|
|
172
|
+
get: function get() {
|
|
173
173
|
return _schema.Float16;
|
|
174
174
|
}
|
|
175
175
|
});
|
|
176
176
|
Object.defineProperty(exports, "Float32", {
|
|
177
177
|
enumerable: true,
|
|
178
|
-
get: function () {
|
|
178
|
+
get: function get() {
|
|
179
179
|
return _schema.Float32;
|
|
180
180
|
}
|
|
181
181
|
});
|
|
182
182
|
Object.defineProperty(exports, "Float64", {
|
|
183
183
|
enumerable: true,
|
|
184
|
-
get: function () {
|
|
184
|
+
get: function get() {
|
|
185
185
|
return _schema.Float64;
|
|
186
186
|
}
|
|
187
187
|
});
|
|
188
188
|
Object.defineProperty(exports, "Utf8", {
|
|
189
189
|
enumerable: true,
|
|
190
|
-
get: function () {
|
|
190
|
+
get: function get() {
|
|
191
191
|
return _schema.Utf8;
|
|
192
192
|
}
|
|
193
193
|
});
|
|
194
194
|
Object.defineProperty(exports, "Date", {
|
|
195
195
|
enumerable: true,
|
|
196
|
-
get: function () {
|
|
196
|
+
get: function get() {
|
|
197
197
|
return _schema.Date;
|
|
198
198
|
}
|
|
199
199
|
});
|
|
200
200
|
Object.defineProperty(exports, "DateDay", {
|
|
201
201
|
enumerable: true,
|
|
202
|
-
get: function () {
|
|
202
|
+
get: function get() {
|
|
203
203
|
return _schema.DateDay;
|
|
204
204
|
}
|
|
205
205
|
});
|
|
206
206
|
Object.defineProperty(exports, "DateMillisecond", {
|
|
207
207
|
enumerable: true,
|
|
208
|
-
get: function () {
|
|
208
|
+
get: function get() {
|
|
209
209
|
return _schema.DateMillisecond;
|
|
210
210
|
}
|
|
211
211
|
});
|
|
212
212
|
Object.defineProperty(exports, "Time", {
|
|
213
213
|
enumerable: true,
|
|
214
|
-
get: function () {
|
|
214
|
+
get: function get() {
|
|
215
215
|
return _schema.Time;
|
|
216
216
|
}
|
|
217
217
|
});
|
|
218
218
|
Object.defineProperty(exports, "TimeMillisecond", {
|
|
219
219
|
enumerable: true,
|
|
220
|
-
get: function () {
|
|
220
|
+
get: function get() {
|
|
221
221
|
return _schema.TimeMillisecond;
|
|
222
222
|
}
|
|
223
223
|
});
|
|
224
224
|
Object.defineProperty(exports, "TimeSecond", {
|
|
225
225
|
enumerable: true,
|
|
226
|
-
get: function () {
|
|
226
|
+
get: function get() {
|
|
227
227
|
return _schema.TimeSecond;
|
|
228
228
|
}
|
|
229
229
|
});
|
|
230
230
|
Object.defineProperty(exports, "Timestamp", {
|
|
231
231
|
enumerable: true,
|
|
232
|
-
get: function () {
|
|
232
|
+
get: function get() {
|
|
233
233
|
return _schema.Timestamp;
|
|
234
234
|
}
|
|
235
235
|
});
|
|
236
236
|
Object.defineProperty(exports, "TimestampSecond", {
|
|
237
237
|
enumerable: true,
|
|
238
|
-
get: function () {
|
|
238
|
+
get: function get() {
|
|
239
239
|
return _schema.TimestampSecond;
|
|
240
240
|
}
|
|
241
241
|
});
|
|
242
242
|
Object.defineProperty(exports, "TimestampMillisecond", {
|
|
243
243
|
enumerable: true,
|
|
244
|
-
get: function () {
|
|
244
|
+
get: function get() {
|
|
245
245
|
return _schema.TimestampMillisecond;
|
|
246
246
|
}
|
|
247
247
|
});
|
|
248
248
|
Object.defineProperty(exports, "TimestampMicrosecond", {
|
|
249
249
|
enumerable: true,
|
|
250
|
-
get: function () {
|
|
250
|
+
get: function get() {
|
|
251
251
|
return _schema.TimestampMicrosecond;
|
|
252
252
|
}
|
|
253
253
|
});
|
|
254
254
|
Object.defineProperty(exports, "TimestampNanosecond", {
|
|
255
255
|
enumerable: true,
|
|
256
|
-
get: function () {
|
|
256
|
+
get: function get() {
|
|
257
257
|
return _schema.TimestampNanosecond;
|
|
258
258
|
}
|
|
259
259
|
});
|
|
260
260
|
Object.defineProperty(exports, "Interval", {
|
|
261
261
|
enumerable: true,
|
|
262
|
-
get: function () {
|
|
262
|
+
get: function get() {
|
|
263
263
|
return _schema.Interval;
|
|
264
264
|
}
|
|
265
265
|
});
|
|
266
266
|
Object.defineProperty(exports, "IntervalDayTime", {
|
|
267
267
|
enumerable: true,
|
|
268
|
-
get: function () {
|
|
268
|
+
get: function get() {
|
|
269
269
|
return _schema.IntervalDayTime;
|
|
270
270
|
}
|
|
271
271
|
});
|
|
272
272
|
Object.defineProperty(exports, "IntervalYearMonth", {
|
|
273
273
|
enumerable: true,
|
|
274
|
-
get: function () {
|
|
274
|
+
get: function get() {
|
|
275
275
|
return _schema.IntervalYearMonth;
|
|
276
276
|
}
|
|
277
277
|
});
|
|
278
278
|
Object.defineProperty(exports, "FixedSizeList", {
|
|
279
279
|
enumerable: true,
|
|
280
|
-
get: function () {
|
|
280
|
+
get: function get() {
|
|
281
281
|
return _schema.FixedSizeList;
|
|
282
282
|
}
|
|
283
283
|
});
|
|
284
284
|
Object.defineProperty(exports, "Struct", {
|
|
285
285
|
enumerable: true,
|
|
286
|
-
get: function () {
|
|
286
|
+
get: function get() {
|
|
287
287
|
return _schema.Struct;
|
|
288
288
|
}
|
|
289
289
|
});
|
|
290
290
|
Object.defineProperty(exports, "deduceTypeFromColumn", {
|
|
291
291
|
enumerable: true,
|
|
292
|
-
get: function () {
|
|
292
|
+
get: function get() {
|
|
293
293
|
return _deduceColumnType.deduceTypeFromColumn;
|
|
294
294
|
}
|
|
295
295
|
});
|
|
296
296
|
Object.defineProperty(exports, "deduceTypeFromValue", {
|
|
297
297
|
enumerable: true,
|
|
298
|
-
get: function () {
|
|
298
|
+
get: function get() {
|
|
299
299
|
return _deduceColumnType.deduceTypeFromValue;
|
|
300
300
|
}
|
|
301
301
|
});
|
|
302
302
|
Object.defineProperty(exports, "getTypeInfo", {
|
|
303
303
|
enumerable: true,
|
|
304
|
-
get: function () {
|
|
304
|
+
get: function get() {
|
|
305
305
|
return _getTypeInfo.getTypeInfo;
|
|
306
306
|
}
|
|
307
307
|
});
|
|
308
308
|
Object.defineProperty(exports, "getArrowTypeFromTypedArray", {
|
|
309
309
|
enumerable: true,
|
|
310
|
-
get: function () {
|
|
310
|
+
get: function get() {
|
|
311
311
|
return _arrowLikeTypeUtils.getArrowTypeFromTypedArray;
|
|
312
312
|
}
|
|
313
313
|
});
|
|
314
314
|
Object.defineProperty(exports, "AsyncQueue", {
|
|
315
315
|
enumerable: true,
|
|
316
|
-
get: function () {
|
|
316
|
+
get: function get() {
|
|
317
317
|
return _asyncQueue.default;
|
|
318
318
|
}
|
|
319
319
|
});
|
package/dist/es5/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuBA;;AAEA;;AACA;;AAEA;;AAYA;;AACA;;AACA;;
|
|
1
|
+
{"version":3,"sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuBA;;AAEA;;AACA;;AAEA;;AAYA;;AACA;;AACA;;AAgDA;;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} 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"}
|
|
@@ -17,14 +17,14 @@ function getTypeInfo(arrowTypeLike) {
|
|
|
17
17
|
};
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
-
|
|
20
|
+
var ReverseType = null;
|
|
21
21
|
|
|
22
22
|
function getTypeKey(typeKey) {
|
|
23
23
|
if (!ReverseType) {
|
|
24
24
|
ReverseType = {};
|
|
25
25
|
|
|
26
|
-
for (
|
|
27
|
-
ReverseType[_schema.Type[
|
|
26
|
+
for (var _key in _schema.Type) {
|
|
27
|
+
ReverseType[_schema.Type[_key]] = _key;
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
30
|
|
|
@@ -1 +1 @@
|
|
|
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,
|
|
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"}
|
|
@@ -7,12 +7,17 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
});
|
|
8
8
|
exports.default = void 0;
|
|
9
9
|
|
|
10
|
+
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
11
|
+
|
|
12
|
+
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
13
|
+
|
|
10
14
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
15
|
|
|
12
|
-
|
|
16
|
+
var DEFAULT_ROW_COUNT = 100;
|
|
13
17
|
|
|
14
|
-
|
|
15
|
-
|
|
18
|
+
var RowTableBatchAggregator = function () {
|
|
19
|
+
function RowTableBatchAggregator(schema, options) {
|
|
20
|
+
(0, _classCallCheck2.default)(this, RowTableBatchAggregator);
|
|
16
21
|
(0, _defineProperty2.default)(this, "schema", void 0);
|
|
17
22
|
(0, _defineProperty2.default)(this, "options", void 0);
|
|
18
23
|
(0, _defineProperty2.default)(this, "length", 0);
|
|
@@ -25,57 +30,63 @@ class RowTableBatchAggregator {
|
|
|
25
30
|
if (!Array.isArray(schema)) {
|
|
26
31
|
this._headers = [];
|
|
27
32
|
|
|
28
|
-
for (
|
|
33
|
+
for (var key in schema) {
|
|
29
34
|
this._headers[schema[key].index] = schema[key].name;
|
|
30
35
|
}
|
|
31
36
|
}
|
|
32
37
|
}
|
|
33
38
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
addArrayRow(row, cursor) {
|
|
39
|
-
if (Number.isFinite(cursor)) {
|
|
40
|
-
this.cursor = cursor;
|
|
39
|
+
(0, _createClass2.default)(RowTableBatchAggregator, [{
|
|
40
|
+
key: "rowCount",
|
|
41
|
+
value: function rowCount() {
|
|
42
|
+
return this.length;
|
|
41
43
|
}
|
|
44
|
+
}, {
|
|
45
|
+
key: "addArrayRow",
|
|
46
|
+
value: function addArrayRow(row, cursor) {
|
|
47
|
+
if (Number.isFinite(cursor)) {
|
|
48
|
+
this.cursor = cursor;
|
|
49
|
+
}
|
|
42
50
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
addObjectRow(row, cursor) {
|
|
49
|
-
if (Number.isFinite(cursor)) {
|
|
50
|
-
this.cursor = cursor;
|
|
51
|
+
this.rows = this.rows || new Array(DEFAULT_ROW_COUNT);
|
|
52
|
+
this.rows[this.length] = row;
|
|
53
|
+
this.length++;
|
|
51
54
|
}
|
|
55
|
+
}, {
|
|
56
|
+
key: "addObjectRow",
|
|
57
|
+
value: function addObjectRow(row, cursor) {
|
|
58
|
+
if (Number.isFinite(cursor)) {
|
|
59
|
+
this.cursor = cursor;
|
|
60
|
+
}
|
|
52
61
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
getBatch() {
|
|
59
|
-
let rows = this.rows;
|
|
60
|
-
|
|
61
|
-
if (!rows) {
|
|
62
|
-
return null;
|
|
62
|
+
this.rows = this.rows || new Array(DEFAULT_ROW_COUNT);
|
|
63
|
+
this.rows[this.length] = row;
|
|
64
|
+
this.length++;
|
|
63
65
|
}
|
|
66
|
+
}, {
|
|
67
|
+
key: "getBatch",
|
|
68
|
+
value: function getBatch() {
|
|
69
|
+
var rows = this.rows;
|
|
64
70
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
shape: this.options.shape,
|
|
69
|
-
batchType: 'data',
|
|
70
|
-
data: rows,
|
|
71
|
-
length: this.length,
|
|
72
|
-
schema: this.schema,
|
|
73
|
-
cursor: this.cursor
|
|
74
|
-
};
|
|
75
|
-
return batch;
|
|
76
|
-
}
|
|
71
|
+
if (!rows) {
|
|
72
|
+
return null;
|
|
73
|
+
}
|
|
77
74
|
|
|
78
|
-
|
|
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
|
+
}();
|
|
79
90
|
|
|
80
91
|
exports.default = RowTableBatchAggregator;
|
|
81
92
|
//# sourceMappingURL=base-table-batch-aggregator.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/lib/batches/base-table-batch-aggregator.ts"],"names":["DEFAULT_ROW_COUNT","RowTableBatchAggregator","
|
|
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"}
|