@loaders.gl/arrow 4.3.0-alpha.2 → 4.3.0-alpha.4

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.
@@ -5,7 +5,7 @@ import { parseArrowSync } from "./parsers/parse-arrow-sync.js";
5
5
  import { parseArrowInBatches } from "./parsers/parse-arrow-in-batches.js";
6
6
  // __VERSION__ is injected by babel-plugin-version-inline
7
7
  // @ts-ignore TS2304: Cannot find name '__VERSION__'.
8
- const VERSION = typeof "4.3.0-alpha.1" !== 'undefined' ? "4.3.0-alpha.1" : 'latest';
8
+ const VERSION = typeof "4.3.0-alpha.3" !== 'undefined' ? "4.3.0-alpha.3" : 'latest';
9
9
  /** ArrowJS table loader */
10
10
  export const ArrowWorkerLoader = {
11
11
  dataType: null,
@@ -205,6 +205,82 @@
205
205
  return await parser(data, { ...options }, context, loader);
206
206
  }
207
207
 
208
+ // ../schema/src/lib/table/simple-table/data-type.ts
209
+ function getDataTypeFromValue(value, defaultNumberType = "float32") {
210
+ if (value instanceof Date) {
211
+ return "date-millisecond";
212
+ }
213
+ if (value instanceof Number) {
214
+ return defaultNumberType;
215
+ }
216
+ if (typeof value === "string") {
217
+ return "utf8";
218
+ }
219
+ if (value === null || value === "undefined") {
220
+ return "null";
221
+ }
222
+ return "null";
223
+ }
224
+ function getDataTypeFromArray(array) {
225
+ let type = getDataTypeFromTypedArray(array);
226
+ if (type !== "null") {
227
+ return { type, nullable: false };
228
+ }
229
+ if (array.length > 0) {
230
+ type = getDataTypeFromValue(array[0]);
231
+ return { type, nullable: true };
232
+ }
233
+ return { type: "null", nullable: true };
234
+ }
235
+ function getDataTypeFromTypedArray(array) {
236
+ switch (array.constructor) {
237
+ case Int8Array:
238
+ return "int8";
239
+ case Uint8Array:
240
+ case Uint8ClampedArray:
241
+ return "uint8";
242
+ case Int16Array:
243
+ return "int16";
244
+ case Uint16Array:
245
+ return "uint16";
246
+ case Int32Array:
247
+ return "int32";
248
+ case Uint32Array:
249
+ return "uint32";
250
+ case Float32Array:
251
+ return "float32";
252
+ case Float64Array:
253
+ return "float64";
254
+ default:
255
+ return "null";
256
+ }
257
+ }
258
+ function getArrayTypeFromDataType(type, nullable) {
259
+ if (!nullable) {
260
+ switch (type) {
261
+ case "int8":
262
+ return Int8Array;
263
+ case "uint8":
264
+ return Uint8Array;
265
+ case "int16":
266
+ return Int16Array;
267
+ case "uint16":
268
+ return Uint16Array;
269
+ case "int32":
270
+ return Int32Array;
271
+ case "uint32":
272
+ return Uint32Array;
273
+ case "float32":
274
+ return Float32Array;
275
+ case "float64":
276
+ return Float64Array;
277
+ default:
278
+ break;
279
+ }
280
+ }
281
+ return Array;
282
+ }
283
+
208
284
  // ../schema/src/lib/table/simple-table/table-accessors.ts
209
285
  function getTableLength(table) {
210
286
  switch (table.shape) {
@@ -355,82 +431,6 @@
355
431
  }
356
432
  }
357
433
 
358
- // ../schema/src/lib/table/simple-table/data-type.ts
359
- function getDataTypeFromValue(value, defaultNumberType = "float32") {
360
- if (value instanceof Date) {
361
- return "date-millisecond";
362
- }
363
- if (value instanceof Number) {
364
- return defaultNumberType;
365
- }
366
- if (typeof value === "string") {
367
- return "utf8";
368
- }
369
- if (value === null || value === "undefined") {
370
- return "null";
371
- }
372
- return "null";
373
- }
374
- function getDataTypeFromArray(array) {
375
- let type = getDataTypeFromTypedArray(array);
376
- if (type !== "null") {
377
- return { type, nullable: false };
378
- }
379
- if (array.length > 0) {
380
- type = getDataTypeFromValue(array[0]);
381
- return { type, nullable: true };
382
- }
383
- return { type: "null", nullable: true };
384
- }
385
- function getDataTypeFromTypedArray(array) {
386
- switch (array.constructor) {
387
- case Int8Array:
388
- return "int8";
389
- case Uint8Array:
390
- case Uint8ClampedArray:
391
- return "uint8";
392
- case Int16Array:
393
- return "int16";
394
- case Uint16Array:
395
- return "uint16";
396
- case Int32Array:
397
- return "int32";
398
- case Uint32Array:
399
- return "uint32";
400
- case Float32Array:
401
- return "float32";
402
- case Float64Array:
403
- return "float64";
404
- default:
405
- return "null";
406
- }
407
- }
408
- function getArrayTypeFromDataType(type, nullable) {
409
- if (!nullable) {
410
- switch (type) {
411
- case "int8":
412
- return Int8Array;
413
- case "uint8":
414
- return Uint8Array;
415
- case "int16":
416
- return Int16Array;
417
- case "uint16":
418
- return Uint16Array;
419
- case "int32":
420
- return Int32Array;
421
- case "uint32":
422
- return Uint32Array;
423
- case "float32":
424
- return Float32Array;
425
- case "float64":
426
- return Float64Array;
427
- default:
428
- break;
429
- }
430
- }
431
- return Array;
432
- }
433
-
434
434
  // ../schema/src/lib/table/simple-table/table-schema.ts
435
435
  function deduceTableSchema(table) {
436
436
  switch (table.shape) {
@@ -12512,7 +12512,7 @@ return true;`);
12512
12512
  }
12513
12513
 
12514
12514
  // src/arrow-loader.ts
12515
- var VERSION = true ? "4.3.0-alpha.1" : "latest";
12515
+ var VERSION = true ? "4.3.0-alpha.3" : "latest";
12516
12516
  var ArrowWorkerLoader = {
12517
12517
  dataType: null,
12518
12518
  batchType: null,
@@ -2,7 +2,7 @@
2
2
  import { encodeArrowSync } from "./lib/encode-arrow.js";
3
3
  // __VERSION__ is injected by babel-plugin-version-inline
4
4
  // @ts-ignore TS2304: Cannot find name '__VERSION__'.
5
- const VERSION = typeof "4.3.0-alpha.1" !== 'undefined' ? "4.3.0-alpha.1" : 'latest';
5
+ const VERSION = typeof "4.3.0-alpha.3" !== 'undefined' ? "4.3.0-alpha.3" : 'latest';
6
6
  /** Apache Arrow writer */
7
7
  export const ArrowWriter = {
8
8
  name: 'Apache Arrow',
package/dist/dist.dev.js CHANGED
@@ -82,6 +82,82 @@ var __exports__ = (() => {
82
82
  });
83
83
  __reExport(bundle_exports, __toESM(require_core(), 1));
84
84
 
85
+ // ../schema/src/lib/table/simple-table/data-type.ts
86
+ function getDataTypeFromValue(value, defaultNumberType = "float32") {
87
+ if (value instanceof Date) {
88
+ return "date-millisecond";
89
+ }
90
+ if (value instanceof Number) {
91
+ return defaultNumberType;
92
+ }
93
+ if (typeof value === "string") {
94
+ return "utf8";
95
+ }
96
+ if (value === null || value === "undefined") {
97
+ return "null";
98
+ }
99
+ return "null";
100
+ }
101
+ function getDataTypeFromArray(array) {
102
+ let type = getDataTypeFromTypedArray(array);
103
+ if (type !== "null") {
104
+ return { type, nullable: false };
105
+ }
106
+ if (array.length > 0) {
107
+ type = getDataTypeFromValue(array[0]);
108
+ return { type, nullable: true };
109
+ }
110
+ return { type: "null", nullable: true };
111
+ }
112
+ function getDataTypeFromTypedArray(array) {
113
+ switch (array.constructor) {
114
+ case Int8Array:
115
+ return "int8";
116
+ case Uint8Array:
117
+ case Uint8ClampedArray:
118
+ return "uint8";
119
+ case Int16Array:
120
+ return "int16";
121
+ case Uint16Array:
122
+ return "uint16";
123
+ case Int32Array:
124
+ return "int32";
125
+ case Uint32Array:
126
+ return "uint32";
127
+ case Float32Array:
128
+ return "float32";
129
+ case Float64Array:
130
+ return "float64";
131
+ default:
132
+ return "null";
133
+ }
134
+ }
135
+ function getArrayTypeFromDataType(type, nullable) {
136
+ if (!nullable) {
137
+ switch (type) {
138
+ case "int8":
139
+ return Int8Array;
140
+ case "uint8":
141
+ return Uint8Array;
142
+ case "int16":
143
+ return Int16Array;
144
+ case "uint16":
145
+ return Uint16Array;
146
+ case "int32":
147
+ return Int32Array;
148
+ case "uint32":
149
+ return Uint32Array;
150
+ case "float32":
151
+ return Float32Array;
152
+ case "float64":
153
+ return Float64Array;
154
+ default:
155
+ break;
156
+ }
157
+ }
158
+ return Array;
159
+ }
160
+
85
161
  // ../schema/src/lib/table/batches/base-table-batch-aggregator.ts
86
162
  var DEFAULT_ROW_COUNT = 100;
87
163
  var BaseTableBatchAggregator = class {
@@ -629,82 +705,6 @@ var __exports__ = (() => {
629
705
  }
630
706
  }
631
707
 
632
- // ../schema/src/lib/table/simple-table/data-type.ts
633
- function getDataTypeFromValue(value, defaultNumberType = "float32") {
634
- if (value instanceof Date) {
635
- return "date-millisecond";
636
- }
637
- if (value instanceof Number) {
638
- return defaultNumberType;
639
- }
640
- if (typeof value === "string") {
641
- return "utf8";
642
- }
643
- if (value === null || value === "undefined") {
644
- return "null";
645
- }
646
- return "null";
647
- }
648
- function getDataTypeFromArray(array) {
649
- let type = getDataTypeFromTypedArray(array);
650
- if (type !== "null") {
651
- return { type, nullable: false };
652
- }
653
- if (array.length > 0) {
654
- type = getDataTypeFromValue(array[0]);
655
- return { type, nullable: true };
656
- }
657
- return { type: "null", nullable: true };
658
- }
659
- function getDataTypeFromTypedArray(array) {
660
- switch (array.constructor) {
661
- case Int8Array:
662
- return "int8";
663
- case Uint8Array:
664
- case Uint8ClampedArray:
665
- return "uint8";
666
- case Int16Array:
667
- return "int16";
668
- case Uint16Array:
669
- return "uint16";
670
- case Int32Array:
671
- return "int32";
672
- case Uint32Array:
673
- return "uint32";
674
- case Float32Array:
675
- return "float32";
676
- case Float64Array:
677
- return "float64";
678
- default:
679
- return "null";
680
- }
681
- }
682
- function getArrayTypeFromDataType(type, nullable) {
683
- if (!nullable) {
684
- switch (type) {
685
- case "int8":
686
- return Int8Array;
687
- case "uint8":
688
- return Uint8Array;
689
- case "int16":
690
- return Int16Array;
691
- case "uint16":
692
- return Uint16Array;
693
- case "int32":
694
- return Int32Array;
695
- case "uint32":
696
- return Uint32Array;
697
- case "float32":
698
- return Float32Array;
699
- case "float64":
700
- return Float64Array;
701
- default:
702
- break;
703
- }
704
- }
705
- return Array;
706
- }
707
-
708
708
  // ../schema/src/lib/table/simple-table/table-schema.ts
709
709
  function deduceTableSchema(table) {
710
710
  switch (table.shape) {