@loaders.gl/schema 4.2.0-alpha.4 → 4.2.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.
Files changed (134) hide show
  1. package/dist/dist.dev.js +190 -161
  2. package/dist/dist.min.js +9 -0
  3. package/dist/index.cjs +64 -73
  4. package/dist/index.cjs.map +7 -0
  5. package/dist/index.d.ts +30 -30
  6. package/dist/index.d.ts.map +1 -1
  7. package/dist/index.js +9 -1
  8. package/dist/lib/mesh/convert-mesh.d.ts +2 -2
  9. package/dist/lib/mesh/convert-mesh.d.ts.map +1 -1
  10. package/dist/lib/mesh/convert-mesh.js +33 -18
  11. package/dist/lib/mesh/deduce-mesh-schema.d.ts +2 -2
  12. package/dist/lib/mesh/deduce-mesh-schema.d.ts.map +1 -1
  13. package/dist/lib/mesh/deduce-mesh-schema.js +54 -40
  14. package/dist/lib/mesh/mesh-to-arrow-table.js +46 -1
  15. package/dist/lib/mesh/mesh-utils.d.ts +2 -2
  16. package/dist/lib/mesh/mesh-utils.d.ts.map +1 -1
  17. package/dist/lib/mesh/mesh-utils.js +41 -28
  18. package/dist/lib/table/arrow-api/arrow-like-field.d.ts +1 -1
  19. package/dist/lib/table/arrow-api/arrow-like-field.d.ts.map +1 -1
  20. package/dist/lib/table/arrow-api/arrow-like-field.js +30 -25
  21. package/dist/lib/table/arrow-api/arrow-like-schema.d.ts +2 -2
  22. package/dist/lib/table/arrow-api/arrow-like-schema.d.ts.map +1 -1
  23. package/dist/lib/table/arrow-api/arrow-like-schema.js +69 -56
  24. package/dist/lib/table/arrow-api/arrow-like-table.d.ts +2 -2
  25. package/dist/lib/table/arrow-api/arrow-like-table.d.ts.map +1 -1
  26. package/dist/lib/table/arrow-api/arrow-like-table.js +53 -45
  27. package/dist/lib/table/arrow-api/arrow-like-type.d.ts +3 -3
  28. package/dist/lib/table/arrow-api/arrow-like-type.d.ts.map +1 -1
  29. package/dist/lib/table/arrow-api/arrow-like-type.js +357 -321
  30. package/dist/lib/table/arrow-api/enum.js +97 -48
  31. package/dist/lib/table/arrow-api/get-type-info.d.ts +1 -1
  32. package/dist/lib/table/arrow-api/get-type-info.d.ts.map +1 -1
  33. package/dist/lib/table/arrow-api/get-type-info.js +20 -14
  34. package/dist/lib/table/arrow-api/index.d.ts +4 -4
  35. package/dist/lib/table/arrow-api/index.d.ts.map +1 -1
  36. package/dist/lib/table/arrow-api/index.js +3 -1
  37. package/dist/lib/table/batches/base-table-batch-aggregator.d.ts +3 -3
  38. package/dist/lib/table/batches/base-table-batch-aggregator.d.ts.map +1 -1
  39. package/dist/lib/table/batches/base-table-batch-aggregator.js +53 -52
  40. package/dist/lib/table/batches/columnar-table-batch-aggregator.d.ts +3 -3
  41. package/dist/lib/table/batches/columnar-table-batch-aggregator.d.ts.map +1 -1
  42. package/dist/lib/table/batches/columnar-table-batch-aggregator.js +81 -67
  43. package/dist/lib/table/batches/row-table-batch-aggregator.d.ts +3 -3
  44. package/dist/lib/table/batches/row-table-batch-aggregator.d.ts.map +1 -1
  45. package/dist/lib/table/batches/row-table-batch-aggregator.js +74 -67
  46. package/dist/lib/table/batches/table-batch-aggregator.d.ts +2 -2
  47. package/dist/lib/table/batches/table-batch-aggregator.d.ts.map +1 -1
  48. package/dist/lib/table/batches/table-batch-aggregator.js +3 -1
  49. package/dist/lib/table/batches/table-batch-builder.d.ts +3 -3
  50. package/dist/lib/table/batches/table-batch-builder.d.ts.map +1 -1
  51. package/dist/lib/table/batches/table-batch-builder.js +128 -116
  52. package/dist/lib/table/simple-table/convert-table.d.ts +1 -1
  53. package/dist/lib/table/simple-table/convert-table.d.ts.map +1 -1
  54. package/dist/lib/table/simple-table/convert-table.js +97 -62
  55. package/dist/lib/table/simple-table/data-type.d.ts +2 -2
  56. package/dist/lib/table/simple-table/data-type.d.ts.map +1 -1
  57. package/dist/lib/table/simple-table/data-type.js +79 -76
  58. package/dist/lib/table/simple-table/make-table-from-batches.js +70 -67
  59. package/dist/lib/table/simple-table/make-table.d.ts +1 -1
  60. package/dist/lib/table/simple-table/make-table.d.ts.map +1 -1
  61. package/dist/lib/table/simple-table/make-table.js +85 -41
  62. package/dist/lib/table/simple-table/row-utils.js +38 -31
  63. package/dist/lib/table/simple-table/table-accessors.d.ts +1 -1
  64. package/dist/lib/table/simple-table/table-accessors.d.ts.map +1 -1
  65. package/dist/lib/table/simple-table/table-accessors.js +314 -270
  66. package/dist/lib/table/simple-table/table-column.d.ts +1 -1
  67. package/dist/lib/table/simple-table/table-column.d.ts.map +1 -1
  68. package/dist/lib/table/simple-table/table-column.js +36 -3
  69. package/dist/lib/table/simple-table/table-schema.d.ts +2 -2
  70. package/dist/lib/table/simple-table/table-schema.d.ts.map +1 -1
  71. package/dist/lib/table/simple-table/table-schema.js +69 -56
  72. package/dist/lib/utils/assert.js +6 -4
  73. package/dist/lib/utils/async-queue.js +76 -82
  74. package/dist/types/batch.d.ts +1 -1
  75. package/dist/types/batch.d.ts.map +1 -1
  76. package/dist/types/batch.js +3 -1
  77. package/dist/types/binary-geometries.d.ts +1 -1
  78. package/dist/types/binary-geometries.d.ts.map +1 -1
  79. package/dist/types/binary-geometries.js +3 -1
  80. package/dist/types/category-gis.d.ts +2 -2
  81. package/dist/types/category-gis.d.ts.map +1 -1
  82. package/dist/types/category-gis.js +3 -1
  83. package/dist/types/category-image.js +3 -1
  84. package/dist/types/category-mesh.d.ts +3 -3
  85. package/dist/types/category-mesh.d.ts.map +1 -1
  86. package/dist/types/category-mesh.js +3 -1
  87. package/dist/types/category-table.d.ts +3 -3
  88. package/dist/types/category-table.d.ts.map +1 -1
  89. package/dist/types/category-table.js +3 -1
  90. package/dist/types/category-texture.d.ts +1 -1
  91. package/dist/types/category-texture.d.ts.map +1 -1
  92. package/dist/types/category-texture.js +3 -1
  93. package/dist/types/flat-geometries.js +3 -1
  94. package/dist/types/schema.js +3 -1
  95. package/dist/types/types.js +3 -1
  96. package/package.json +8 -4
  97. package/src/index.ts +1 -1
  98. package/dist/index.js.map +0 -1
  99. package/dist/lib/mesh/convert-mesh.js.map +0 -1
  100. package/dist/lib/mesh/deduce-mesh-schema.js.map +0 -1
  101. package/dist/lib/mesh/mesh-to-arrow-table.js.map +0 -1
  102. package/dist/lib/mesh/mesh-utils.js.map +0 -1
  103. package/dist/lib/table/arrow-api/arrow-like-field.js.map +0 -1
  104. package/dist/lib/table/arrow-api/arrow-like-schema.js.map +0 -1
  105. package/dist/lib/table/arrow-api/arrow-like-table.js.map +0 -1
  106. package/dist/lib/table/arrow-api/arrow-like-type.js.map +0 -1
  107. package/dist/lib/table/arrow-api/enum.js.map +0 -1
  108. package/dist/lib/table/arrow-api/get-type-info.js.map +0 -1
  109. package/dist/lib/table/arrow-api/index.js.map +0 -1
  110. package/dist/lib/table/batches/base-table-batch-aggregator.js.map +0 -1
  111. package/dist/lib/table/batches/columnar-table-batch-aggregator.js.map +0 -1
  112. package/dist/lib/table/batches/row-table-batch-aggregator.js.map +0 -1
  113. package/dist/lib/table/batches/table-batch-aggregator.js.map +0 -1
  114. package/dist/lib/table/batches/table-batch-builder.js.map +0 -1
  115. package/dist/lib/table/simple-table/convert-table.js.map +0 -1
  116. package/dist/lib/table/simple-table/data-type.js.map +0 -1
  117. package/dist/lib/table/simple-table/make-table-from-batches.js.map +0 -1
  118. package/dist/lib/table/simple-table/make-table.js.map +0 -1
  119. package/dist/lib/table/simple-table/row-utils.js.map +0 -1
  120. package/dist/lib/table/simple-table/table-accessors.js.map +0 -1
  121. package/dist/lib/table/simple-table/table-column.js.map +0 -1
  122. package/dist/lib/table/simple-table/table-schema.js.map +0 -1
  123. package/dist/lib/utils/assert.js.map +0 -1
  124. package/dist/lib/utils/async-queue.js.map +0 -1
  125. package/dist/types/batch.js.map +0 -1
  126. package/dist/types/binary-geometries.js.map +0 -1
  127. package/dist/types/category-gis.js.map +0 -1
  128. package/dist/types/category-image.js.map +0 -1
  129. package/dist/types/category-mesh.js.map +0 -1
  130. package/dist/types/category-table.js.map +0 -1
  131. package/dist/types/category-texture.js.map +0 -1
  132. package/dist/types/flat-geometries.js.map +0 -1
  133. package/dist/types/schema.js.map +0 -1
  134. package/dist/types/types.js.map +0 -1
@@ -1,392 +1,428 @@
1
- let _Symbol$toStringTag, _Symbol$toStringTag2, _Symbol$toStringTag3, _Symbol$toStringTag4, _Symbol$toStringTag5, _Symbol$toStringTag6, _Symbol$toStringTag7, _Symbol$toStringTag8;
1
+ // loaders.gl
2
+ // SPDX-License-Identifier: MIT
3
+ // Copyright (c) vis.gl contributors
4
+ // This code is adapted from ArrowJS https://github.com/apache/arrow
5
+ // under Apache license http://www.apache.org/licenses/LICENSE-2.0
2
6
  import { Type } from "./enum.js";
3
7
  export { Type } from "./enum.js";
8
+ /** ArrowLike DataType class */
4
9
  export class DataType {
5
- static isNull(x) {
6
- return x && x.typeId === Type.Null;
7
- }
8
- static isInt(x) {
9
- return x && x.typeId === Type.Int;
10
- }
11
- static isFloat(x) {
12
- return x && x.typeId === Type.Float;
13
- }
14
- static isBinary(x) {
15
- return x && x.typeId === Type.Binary;
16
- }
17
- static isUtf8(x) {
18
- return x && x.typeId === Type.Utf8;
19
- }
20
- static isBool(x) {
21
- return x && x.typeId === Type.Bool;
22
- }
23
- static isDecimal(x) {
24
- return x && x.typeId === Type.Decimal;
25
- }
26
- static isDate(x) {
27
- return x && x.typeId === Type.Date;
28
- }
29
- static isTime(x) {
30
- return x && x.typeId === Type.Time;
31
- }
32
- static isTimestamp(x) {
33
- return x && x.typeId === Type.Timestamp;
34
- }
35
- static isInterval(x) {
36
- return x && x.typeId === Type.Interval;
37
- }
38
- static isList(x) {
39
- return x && x.typeId === Type.List;
40
- }
41
- static isStruct(x) {
42
- return x && x.typeId === Type.Struct;
43
- }
44
- static isUnion(x) {
45
- return x && x.typeId === Type.Union;
46
- }
47
- static isFixedSizeBinary(x) {
48
- return x && x.typeId === Type.FixedSizeBinary;
49
- }
50
- static isFixedSizeList(x) {
51
- return x && x.typeId === Type.FixedSizeList;
52
- }
53
- static isMap(x) {
54
- return x && x.typeId === Type.Map;
55
- }
56
- static isDictionary(x) {
57
- return x && x.typeId === Type.Dictionary;
58
- }
59
- get typeId() {
60
- return Type.NONE;
61
- }
62
- compareTo(other) {
63
- return this === other;
64
- }
65
- }
10
+ static isNull(x) {
11
+ return x && x.typeId === Type.Null;
12
+ }
13
+ static isInt(x) {
14
+ return x && x.typeId === Type.Int;
15
+ }
16
+ static isFloat(x) {
17
+ return x && x.typeId === Type.Float;
18
+ }
19
+ static isBinary(x) {
20
+ return x && x.typeId === Type.Binary;
21
+ }
22
+ static isUtf8(x) {
23
+ return x && x.typeId === Type.Utf8;
24
+ }
25
+ static isBool(x) {
26
+ return x && x.typeId === Type.Bool;
27
+ }
28
+ static isDecimal(x) {
29
+ return x && x.typeId === Type.Decimal;
30
+ }
31
+ static isDate(x) {
32
+ return x && x.typeId === Type.Date;
33
+ }
34
+ static isTime(x) {
35
+ return x && x.typeId === Type.Time;
36
+ }
37
+ static isTimestamp(x) {
38
+ return x && x.typeId === Type.Timestamp;
39
+ }
40
+ static isInterval(x) {
41
+ return x && x.typeId === Type.Interval;
42
+ }
43
+ static isList(x) {
44
+ return x && x.typeId === Type.List;
45
+ }
46
+ static isStruct(x) {
47
+ return x && x.typeId === Type.Struct;
48
+ }
49
+ static isUnion(x) {
50
+ return x && x.typeId === Type.Union;
51
+ }
52
+ static isFixedSizeBinary(x) {
53
+ return x && x.typeId === Type.FixedSizeBinary;
54
+ }
55
+ static isFixedSizeList(x) {
56
+ return x && x.typeId === Type.FixedSizeList;
57
+ }
58
+ static isMap(x) {
59
+ return x && x.typeId === Type.Map;
60
+ }
61
+ static isDictionary(x) {
62
+ return x && x.typeId === Type.Dictionary;
63
+ }
64
+ get typeId() {
65
+ return Type.NONE;
66
+ }
67
+ // get ArrayType(): AnyArrayType {
68
+ // return Int8Array;
69
+ // }
70
+ // get ArrayType() { return Array; }
71
+ compareTo(other) {
72
+ // TODO
73
+ return this === other; // comparer.visit(this, other);
74
+ }
75
+ }
76
+ // NULL
66
77
  export class Null extends DataType {
67
- get typeId() {
68
- return Type.Null;
69
- }
70
- get [Symbol.toStringTag]() {
71
- return 'Null';
72
- }
73
- toString() {
74
- return 'Null';
75
- }
76
- }
78
+ get typeId() {
79
+ return Type.Null;
80
+ }
81
+ get [Symbol.toStringTag]() {
82
+ return 'Null';
83
+ }
84
+ toString() {
85
+ return 'Null';
86
+ }
87
+ }
88
+ // BOOLEANS
77
89
  export class Bool extends DataType {
78
- get typeId() {
79
- return Type.Bool;
80
- }
81
- get [Symbol.toStringTag]() {
82
- return 'Bool';
83
- }
84
- toString() {
85
- return 'Bool';
86
- }
87
- }
88
- _Symbol$toStringTag = Symbol.toStringTag;
90
+ get typeId() {
91
+ return Type.Bool;
92
+ }
93
+ // get ArrayType() {
94
+ // return Uint8Array;
95
+ // }
96
+ get [Symbol.toStringTag]() {
97
+ return 'Bool';
98
+ }
99
+ toString() {
100
+ return 'Bool';
101
+ }
102
+ }
103
+ // INTS
89
104
  export class Int extends DataType {
90
- constructor(isSigned, bitWidth) {
91
- super();
92
- this.isSigned = void 0;
93
- this.bitWidth = void 0;
94
- this.isSigned = isSigned;
95
- this.bitWidth = bitWidth;
96
- }
97
- get typeId() {
98
- return Type.Int;
99
- }
100
- get [_Symbol$toStringTag]() {
101
- return 'Int';
102
- }
103
- toString() {
104
- return `${this.isSigned ? 'I' : 'Ui'}nt${this.bitWidth}`;
105
- }
105
+ constructor(isSigned, bitWidth) {
106
+ super();
107
+ this.isSigned = isSigned;
108
+ this.bitWidth = bitWidth;
109
+ }
110
+ get typeId() {
111
+ return Type.Int;
112
+ }
113
+ // get ArrayType() {
114
+ // switch (this.bitWidth) {
115
+ // case 8:
116
+ // return this.isSigned ? Int8Array : Uint8Array;
117
+ // case 16:
118
+ // return this.isSigned ? Int16Array : Uint16Array;
119
+ // case 32:
120
+ // return this.isSigned ? Int32Array : Uint32Array;
121
+ // case 64:
122
+ // return this.isSigned ? Int32Array : Uint32Array;
123
+ // default:
124
+ // throw new Error(`Unrecognized ${this[Symbol.toStringTag]} type`);
125
+ // }
126
+ // }
127
+ get [Symbol.toStringTag]() {
128
+ return 'Int';
129
+ }
130
+ toString() {
131
+ return `${this.isSigned ? 'I' : 'Ui'}nt${this.bitWidth}`;
132
+ }
106
133
  }
107
134
  export class Int8 extends Int {
108
- constructor() {
109
- super(true, 8);
110
- }
135
+ constructor() {
136
+ super(true, 8);
137
+ }
111
138
  }
112
139
  export class Int16 extends Int {
113
- constructor() {
114
- super(true, 16);
115
- }
140
+ constructor() {
141
+ super(true, 16);
142
+ }
116
143
  }
117
144
  export class Int32 extends Int {
118
- constructor() {
119
- super(true, 32);
120
- }
145
+ constructor() {
146
+ super(true, 32);
147
+ }
121
148
  }
122
149
  export class Int64 extends Int {
123
- constructor() {
124
- super(true, 64);
125
- }
150
+ constructor() {
151
+ super(true, 64);
152
+ }
126
153
  }
127
154
  export class Uint8 extends Int {
128
- constructor() {
129
- super(false, 8);
130
- }
155
+ constructor() {
156
+ super(false, 8);
157
+ }
131
158
  }
132
159
  export class Uint16 extends Int {
133
- constructor() {
134
- super(false, 16);
135
- }
160
+ constructor() {
161
+ super(false, 16);
162
+ }
136
163
  }
137
164
  export class Uint32 extends Int {
138
- constructor() {
139
- super(false, 32);
140
- }
165
+ constructor() {
166
+ super(false, 32);
167
+ }
141
168
  }
142
169
  export class Uint64 extends Int {
143
- constructor() {
144
- super(false, 64);
145
- }
170
+ constructor() {
171
+ super(false, 64);
172
+ }
146
173
  }
174
+ // FLOATS
147
175
  const Precision = {
148
- HALF: 16,
149
- SINGLE: 32,
150
- DOUBLE: 64
176
+ HALF: 16,
177
+ SINGLE: 32,
178
+ DOUBLE: 64
151
179
  };
152
- _Symbol$toStringTag2 = Symbol.toStringTag;
153
180
  export class Float extends DataType {
154
- constructor(precision) {
155
- super();
156
- this.precision = void 0;
157
- this.precision = precision;
158
- }
159
- get typeId() {
160
- return Type.Float;
161
- }
162
- get [_Symbol$toStringTag2]() {
163
- return 'Float';
164
- }
165
- toString() {
166
- return `Float${this.precision}`;
167
- }
181
+ constructor(precision) {
182
+ super();
183
+ this.precision = precision;
184
+ }
185
+ get typeId() {
186
+ return Type.Float;
187
+ }
188
+ // get ArrayType() {
189
+ // switch (this.precision) {
190
+ // case Precision.HALF:
191
+ // return Uint16Array;
192
+ // case Precision.SINGLE:
193
+ // return Float32Array;
194
+ // case Precision.DOUBLE:
195
+ // return Float64Array;
196
+ // default:
197
+ // throw new Error(`Unrecognized ${this[Symbol.toStringTag]} type`);
198
+ // }
199
+ // }
200
+ get [Symbol.toStringTag]() {
201
+ return 'Float';
202
+ }
203
+ toString() {
204
+ return `Float${this.precision}`;
205
+ }
168
206
  }
169
207
  export class Float16 extends Float {
170
- constructor() {
171
- super(Precision.HALF);
172
- }
208
+ constructor() {
209
+ super(Precision.HALF);
210
+ }
173
211
  }
174
212
  export class Float32 extends Float {
175
- constructor() {
176
- super(Precision.SINGLE);
177
- }
213
+ constructor() {
214
+ super(Precision.SINGLE);
215
+ }
178
216
  }
179
217
  export class Float64 extends Float {
180
- constructor() {
181
- super(Precision.DOUBLE);
182
- }
218
+ constructor() {
219
+ super(Precision.DOUBLE);
220
+ }
183
221
  }
184
222
  export class Binary extends DataType {
185
- constructor() {
186
- super();
187
- }
188
- get typeId() {
189
- return Type.Binary;
190
- }
191
- toString() {
192
- return 'Binary';
193
- }
194
- get [Symbol.toStringTag]() {
195
- return 'Binary';
196
- }
197
- }
223
+ constructor() {
224
+ super();
225
+ }
226
+ get typeId() {
227
+ return Type.Binary;
228
+ }
229
+ toString() {
230
+ return 'Binary';
231
+ }
232
+ get [Symbol.toStringTag]() {
233
+ return 'Binary';
234
+ }
235
+ }
236
+ // STRINGS
198
237
  export class Utf8 extends DataType {
199
- get typeId() {
200
- return Type.Utf8;
201
- }
202
- get [Symbol.toStringTag]() {
203
- return 'Utf8';
204
- }
205
- toString() {
206
- return 'Utf8';
207
- }
208
- }
238
+ get typeId() {
239
+ return Type.Utf8;
240
+ }
241
+ // get ArrayType() {
242
+ // return Uint8Array;
243
+ // }
244
+ get [Symbol.toStringTag]() {
245
+ return 'Utf8';
246
+ }
247
+ toString() {
248
+ return 'Utf8';
249
+ }
250
+ }
251
+ // DATES, TIMES AND INTERVALS
209
252
  const DateUnit = {
210
- DAY: 0,
211
- MILLISECOND: 1
253
+ DAY: 0,
254
+ MILLISECOND: 1
212
255
  };
213
- _Symbol$toStringTag3 = Symbol.toStringTag;
214
256
  export class Date extends DataType {
215
- constructor(unit) {
216
- super();
217
- this.unit = void 0;
218
- this.unit = unit;
219
- }
220
- get typeId() {
221
- return Type.Date;
222
- }
223
- get [_Symbol$toStringTag3]() {
224
- return 'Date';
225
- }
226
- toString() {
227
- return `Date${(this.unit + 1) * 32}<${DateUnit[this.unit]}>`;
228
- }
257
+ constructor(unit) {
258
+ super();
259
+ this.unit = unit;
260
+ }
261
+ get typeId() {
262
+ return Type.Date;
263
+ }
264
+ // get ArrayType() {
265
+ // return Int32Array;
266
+ // }
267
+ get [Symbol.toStringTag]() {
268
+ return 'Date';
269
+ }
270
+ toString() {
271
+ return `Date${(this.unit + 1) * 32}<${DateUnit[this.unit]}>`;
272
+ }
229
273
  }
230
274
  export class DateDay extends Date {
231
- constructor() {
232
- super(DateUnit.DAY);
233
- }
275
+ constructor() {
276
+ super(DateUnit.DAY);
277
+ }
234
278
  }
235
279
  export class DateMillisecond extends Date {
236
- constructor() {
237
- super(DateUnit.MILLISECOND);
238
- }
280
+ constructor() {
281
+ super(DateUnit.MILLISECOND);
282
+ }
239
283
  }
240
284
  const TimeUnit = {
241
- SECOND: 1,
242
- MILLISECOND: 1e3,
243
- MICROSECOND: 1e6,
244
- NANOSECOND: 1e9
285
+ SECOND: 1,
286
+ MILLISECOND: 1e3,
287
+ MICROSECOND: 1e6,
288
+ NANOSECOND: 1e9
245
289
  };
246
- _Symbol$toStringTag4 = Symbol.toStringTag;
247
290
  export class Time extends DataType {
248
- constructor(unit, bitWidth) {
249
- super();
250
- this.unit = void 0;
251
- this.bitWidth = void 0;
252
- this.unit = unit;
253
- this.bitWidth = bitWidth;
254
- }
255
- get typeId() {
256
- return Type.Time;
257
- }
258
- toString() {
259
- return `Time${this.bitWidth}<${TimeUnit[this.unit]}>`;
260
- }
261
- get [_Symbol$toStringTag4]() {
262
- return 'Time';
263
- }
291
+ constructor(unit, bitWidth) {
292
+ super();
293
+ this.unit = unit;
294
+ this.bitWidth = bitWidth;
295
+ }
296
+ get typeId() {
297
+ return Type.Time;
298
+ }
299
+ toString() {
300
+ return `Time${this.bitWidth}<${TimeUnit[this.unit]}>`;
301
+ }
302
+ get [Symbol.toStringTag]() {
303
+ return 'Time';
304
+ }
264
305
  }
265
306
  export class TimeSecond extends Time {
266
- constructor() {
267
- super(TimeUnit.SECOND, 32);
268
- }
307
+ constructor() {
308
+ super(TimeUnit.SECOND, 32);
309
+ }
269
310
  }
270
311
  export class TimeMillisecond extends Time {
271
- constructor() {
272
- super(TimeUnit.MILLISECOND, 32);
273
- }
312
+ constructor() {
313
+ super(TimeUnit.MILLISECOND, 32);
314
+ }
274
315
  }
275
- _Symbol$toStringTag5 = Symbol.toStringTag;
316
+ // export class TimeMicrosecond extends Time { constructor() { super(TimeUnit.MICROSECOND, 64); } }
317
+ // export class TimeNanosecond extends Time { constructor() { super(TimeUnit.NANOSECOND, 64); } }
276
318
  export class Timestamp extends DataType {
277
- constructor(unit) {
278
- let timezone = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
279
- super();
280
- this.unit = void 0;
281
- this.timezone = void 0;
282
- this.unit = unit;
283
- this.timezone = timezone;
284
- }
285
- get typeId() {
286
- return Type.Timestamp;
287
- }
288
- get [_Symbol$toStringTag5]() {
289
- return 'Timestamp';
290
- }
291
- toString() {
292
- return `Timestamp<${TimeUnit[this.unit]}${this.timezone ? `, ${this.timezone}` : ''}>`;
293
- }
319
+ constructor(unit, timezone = null) {
320
+ super();
321
+ this.unit = unit;
322
+ this.timezone = timezone;
323
+ }
324
+ get typeId() {
325
+ return Type.Timestamp;
326
+ }
327
+ // get ArrayType() {
328
+ // return Int32Array;
329
+ // }
330
+ get [Symbol.toStringTag]() {
331
+ return 'Timestamp';
332
+ }
333
+ toString() {
334
+ return `Timestamp<${TimeUnit[this.unit]}${this.timezone ? `, ${this.timezone}` : ''}>`;
335
+ }
294
336
  }
295
337
  export class TimestampSecond extends Timestamp {
296
- constructor() {
297
- let timezone = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
298
- super(TimeUnit.SECOND, timezone);
299
- }
338
+ constructor(timezone = null) {
339
+ super(TimeUnit.SECOND, timezone);
340
+ }
300
341
  }
301
342
  export class TimestampMillisecond extends Timestamp {
302
- constructor() {
303
- let timezone = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
304
- super(TimeUnit.MILLISECOND, timezone);
305
- }
343
+ constructor(timezone = null) {
344
+ super(TimeUnit.MILLISECOND, timezone);
345
+ }
306
346
  }
307
347
  export class TimestampMicrosecond extends Timestamp {
308
- constructor() {
309
- let timezone = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
310
- super(TimeUnit.MICROSECOND, timezone);
311
- }
348
+ constructor(timezone = null) {
349
+ super(TimeUnit.MICROSECOND, timezone);
350
+ }
312
351
  }
313
352
  export class TimestampNanosecond extends Timestamp {
314
- constructor() {
315
- let timezone = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
316
- super(TimeUnit.NANOSECOND, timezone);
317
- }
353
+ constructor(timezone = null) {
354
+ super(TimeUnit.NANOSECOND, timezone);
355
+ }
318
356
  }
319
357
  const IntervalUnit = {
320
- DAY_TIME: 0,
321
- YEAR_MONTH: 1
358
+ DAY_TIME: 0,
359
+ YEAR_MONTH: 1
322
360
  };
323
- _Symbol$toStringTag6 = Symbol.toStringTag;
324
361
  export class Interval extends DataType {
325
- constructor(unit) {
326
- super();
327
- this.unit = void 0;
328
- this.unit = unit;
329
- }
330
- get typeId() {
331
- return Type.Interval;
332
- }
333
- get [_Symbol$toStringTag6]() {
334
- return 'Interval';
335
- }
336
- toString() {
337
- return `Interval<${IntervalUnit[this.unit]}>`;
338
- }
362
+ constructor(unit) {
363
+ super();
364
+ this.unit = unit;
365
+ }
366
+ get typeId() {
367
+ return Type.Interval;
368
+ }
369
+ // get ArrayType() {
370
+ // return Int32Array;
371
+ // }
372
+ get [Symbol.toStringTag]() {
373
+ return 'Interval';
374
+ }
375
+ toString() {
376
+ return `Interval<${IntervalUnit[this.unit]}>`;
377
+ }
339
378
  }
340
379
  export class IntervalDayTime extends Interval {
341
- constructor() {
342
- super(IntervalUnit.DAY_TIME);
343
- }
380
+ constructor() {
381
+ super(IntervalUnit.DAY_TIME);
382
+ }
344
383
  }
345
384
  export class IntervalYearMonth extends Interval {
346
- constructor() {
347
- super(IntervalUnit.YEAR_MONTH);
348
- }
385
+ constructor() {
386
+ super(IntervalUnit.YEAR_MONTH);
387
+ }
349
388
  }
350
- _Symbol$toStringTag7 = Symbol.toStringTag;
351
389
  export class FixedSizeList extends DataType {
352
- constructor(listSize, child) {
353
- super();
354
- this.listSize = void 0;
355
- this.children = void 0;
356
- this.listSize = listSize;
357
- this.children = [child];
358
- }
359
- get typeId() {
360
- return Type.FixedSizeList;
361
- }
362
- get valueType() {
363
- return this.children[0].type;
364
- }
365
- get valueField() {
366
- return this.children[0];
367
- }
368
- get [_Symbol$toStringTag7]() {
369
- return 'FixedSizeList';
370
- }
371
- toString() {
372
- return `FixedSizeList[${this.listSize}]<${this.valueType}>`;
373
- }
374
- }
375
- _Symbol$toStringTag8 = Symbol.toStringTag;
390
+ constructor(listSize, child) {
391
+ super();
392
+ this.listSize = listSize;
393
+ this.children = [child];
394
+ }
395
+ get typeId() {
396
+ return Type.FixedSizeList;
397
+ }
398
+ get valueType() {
399
+ return this.children[0].type;
400
+ }
401
+ get valueField() {
402
+ return this.children[0];
403
+ }
404
+ // get ArrayType() {
405
+ // return this.valueType.ArrayType;
406
+ // }
407
+ get [Symbol.toStringTag]() {
408
+ return 'FixedSizeList';
409
+ }
410
+ toString() {
411
+ return `FixedSizeList[${this.listSize}]<${this.valueType}>`;
412
+ }
413
+ }
376
414
  export class Struct extends DataType {
377
- constructor(children) {
378
- super();
379
- this.children = void 0;
380
- this.children = children;
381
- }
382
- get typeId() {
383
- return Type.Struct;
384
- }
385
- toString() {
386
- return `Struct<{${this.children.map(f => `${f.name}:${f.type}`).join(', ')}}>`;
387
- }
388
- get [_Symbol$toStringTag8]() {
389
- return 'Struct';
390
- }
391
- }
392
- //# sourceMappingURL=arrow-like-type.js.map
415
+ constructor(children) {
416
+ super();
417
+ this.children = children;
418
+ }
419
+ get typeId() {
420
+ return Type.Struct;
421
+ }
422
+ toString() {
423
+ return `Struct<{${this.children.map((f) => `${f.name}:${f.type}`).join(', ')}}>`;
424
+ }
425
+ get [Symbol.toStringTag]() {
426
+ return 'Struct';
427
+ }
428
+ }