@loaders.gl/schema 4.2.0-alpha.4 → 4.2.0-alpha.6

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 (136) hide show
  1. package/dist/dist.dev.js +216 -147
  2. package/dist/dist.min.js +9 -0
  3. package/dist/index.cjs +128 -97
  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 +34 -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 +71 -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 +57 -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 +371 -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 +56 -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 +82 -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 +76 -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 +131 -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 +79 -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/src/lib/table/arrow-api/arrow-like-field.ts +2 -2
  99. package/src/lib/table/arrow-api/arrow-like-type.ts +4 -2
  100. package/dist/index.js.map +0 -1
  101. package/dist/lib/mesh/convert-mesh.js.map +0 -1
  102. package/dist/lib/mesh/deduce-mesh-schema.js.map +0 -1
  103. package/dist/lib/mesh/mesh-to-arrow-table.js.map +0 -1
  104. package/dist/lib/mesh/mesh-utils.js.map +0 -1
  105. package/dist/lib/table/arrow-api/arrow-like-field.js.map +0 -1
  106. package/dist/lib/table/arrow-api/arrow-like-schema.js.map +0 -1
  107. package/dist/lib/table/arrow-api/arrow-like-table.js.map +0 -1
  108. package/dist/lib/table/arrow-api/arrow-like-type.js.map +0 -1
  109. package/dist/lib/table/arrow-api/enum.js.map +0 -1
  110. package/dist/lib/table/arrow-api/get-type-info.js.map +0 -1
  111. package/dist/lib/table/arrow-api/index.js.map +0 -1
  112. package/dist/lib/table/batches/base-table-batch-aggregator.js.map +0 -1
  113. package/dist/lib/table/batches/columnar-table-batch-aggregator.js.map +0 -1
  114. package/dist/lib/table/batches/row-table-batch-aggregator.js.map +0 -1
  115. package/dist/lib/table/batches/table-batch-aggregator.js.map +0 -1
  116. package/dist/lib/table/batches/table-batch-builder.js.map +0 -1
  117. package/dist/lib/table/simple-table/convert-table.js.map +0 -1
  118. package/dist/lib/table/simple-table/data-type.js.map +0 -1
  119. package/dist/lib/table/simple-table/make-table-from-batches.js.map +0 -1
  120. package/dist/lib/table/simple-table/make-table.js.map +0 -1
  121. package/dist/lib/table/simple-table/row-utils.js.map +0 -1
  122. package/dist/lib/table/simple-table/table-accessors.js.map +0 -1
  123. package/dist/lib/table/simple-table/table-column.js.map +0 -1
  124. package/dist/lib/table/simple-table/table-schema.js.map +0 -1
  125. package/dist/lib/utils/assert.js.map +0 -1
  126. package/dist/lib/utils/async-queue.js.map +0 -1
  127. package/dist/types/batch.js.map +0 -1
  128. package/dist/types/binary-geometries.js.map +0 -1
  129. package/dist/types/category-gis.js.map +0 -1
  130. package/dist/types/category-image.js.map +0 -1
  131. package/dist/types/category-mesh.js.map +0 -1
  132. package/dist/types/category-table.js.map +0 -1
  133. package/dist/types/category-texture.js.map +0 -1
  134. package/dist/types/flat-geometries.js.map +0 -1
  135. package/dist/types/schema.js.map +0 -1
  136. package/dist/types/types.js.map +0 -1
@@ -1,392 +1,442 @@
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
+ isSigned;
106
+ bitWidth;
107
+ constructor(isSigned, bitWidth) {
108
+ super();
109
+ this.isSigned = isSigned;
110
+ this.bitWidth = bitWidth;
111
+ }
112
+ get typeId() {
113
+ return Type.Int;
114
+ }
115
+ // get ArrayType() {
116
+ // switch (this.bitWidth) {
117
+ // case 8:
118
+ // return this.isSigned ? Int8Array : Uint8Array;
119
+ // case 16:
120
+ // return this.isSigned ? Int16Array : Uint16Array;
121
+ // case 32:
122
+ // return this.isSigned ? Int32Array : Uint32Array;
123
+ // case 64:
124
+ // return this.isSigned ? Int32Array : Uint32Array;
125
+ // default:
126
+ // throw new Error(`Unrecognized ${this[Symbol.toStringTag]} type`);
127
+ // }
128
+ // }
129
+ get [Symbol.toStringTag]() {
130
+ return 'Int';
131
+ }
132
+ toString() {
133
+ return `${this.isSigned ? 'I' : 'Ui'}nt${this.bitWidth}`;
134
+ }
106
135
  }
107
136
  export class Int8 extends Int {
108
- constructor() {
109
- super(true, 8);
110
- }
137
+ constructor() {
138
+ super(true, 8);
139
+ }
111
140
  }
112
141
  export class Int16 extends Int {
113
- constructor() {
114
- super(true, 16);
115
- }
142
+ constructor() {
143
+ super(true, 16);
144
+ }
116
145
  }
117
146
  export class Int32 extends Int {
118
- constructor() {
119
- super(true, 32);
120
- }
147
+ constructor() {
148
+ super(true, 32);
149
+ }
121
150
  }
122
151
  export class Int64 extends Int {
123
- constructor() {
124
- super(true, 64);
125
- }
152
+ constructor() {
153
+ super(true, 64);
154
+ }
126
155
  }
127
156
  export class Uint8 extends Int {
128
- constructor() {
129
- super(false, 8);
130
- }
157
+ constructor() {
158
+ super(false, 8);
159
+ }
131
160
  }
132
161
  export class Uint16 extends Int {
133
- constructor() {
134
- super(false, 16);
135
- }
162
+ constructor() {
163
+ super(false, 16);
164
+ }
136
165
  }
137
166
  export class Uint32 extends Int {
138
- constructor() {
139
- super(false, 32);
140
- }
167
+ constructor() {
168
+ super(false, 32);
169
+ }
141
170
  }
142
171
  export class Uint64 extends Int {
143
- constructor() {
144
- super(false, 64);
145
- }
172
+ constructor() {
173
+ super(false, 64);
174
+ }
146
175
  }
176
+ // FLOATS
147
177
  const Precision = {
148
- HALF: 16,
149
- SINGLE: 32,
150
- DOUBLE: 64
178
+ HALF: 16,
179
+ SINGLE: 32,
180
+ DOUBLE: 64
151
181
  };
152
- _Symbol$toStringTag2 = Symbol.toStringTag;
153
182
  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
- }
183
+ precision;
184
+ constructor(precision) {
185
+ super();
186
+ this.precision = precision;
187
+ }
188
+ get typeId() {
189
+ return Type.Float;
190
+ }
191
+ // get ArrayType() {
192
+ // switch (this.precision) {
193
+ // case Precision.HALF:
194
+ // return Uint16Array;
195
+ // case Precision.SINGLE:
196
+ // return Float32Array;
197
+ // case Precision.DOUBLE:
198
+ // return Float64Array;
199
+ // default:
200
+ // throw new Error(`Unrecognized ${this[Symbol.toStringTag]} type`);
201
+ // }
202
+ // }
203
+ get [Symbol.toStringTag]() {
204
+ return 'Float';
205
+ }
206
+ toString() {
207
+ return `Float${this.precision}`;
208
+ }
168
209
  }
169
210
  export class Float16 extends Float {
170
- constructor() {
171
- super(Precision.HALF);
172
- }
211
+ constructor() {
212
+ super(Precision.HALF);
213
+ }
173
214
  }
174
215
  export class Float32 extends Float {
175
- constructor() {
176
- super(Precision.SINGLE);
177
- }
216
+ constructor() {
217
+ super(Precision.SINGLE);
218
+ }
178
219
  }
179
220
  export class Float64 extends Float {
180
- constructor() {
181
- super(Precision.DOUBLE);
182
- }
221
+ constructor() {
222
+ super(Precision.DOUBLE);
223
+ }
183
224
  }
184
225
  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
- }
226
+ constructor() {
227
+ super();
228
+ }
229
+ get typeId() {
230
+ return Type.Binary;
231
+ }
232
+ toString() {
233
+ return 'Binary';
234
+ }
235
+ get [Symbol.toStringTag]() {
236
+ return 'Binary';
237
+ }
238
+ }
239
+ // STRINGS
198
240
  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
- }
241
+ get typeId() {
242
+ return Type.Utf8;
243
+ }
244
+ // get ArrayType() {
245
+ // return Uint8Array;
246
+ // }
247
+ get [Symbol.toStringTag]() {
248
+ return 'Utf8';
249
+ }
250
+ toString() {
251
+ return 'Utf8';
252
+ }
253
+ }
254
+ // DATES, TIMES AND INTERVALS
209
255
  const DateUnit = {
210
- DAY: 0,
211
- MILLISECOND: 1
256
+ DAY: 0,
257
+ MILLISECOND: 1
212
258
  };
213
- _Symbol$toStringTag3 = Symbol.toStringTag;
214
259
  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
- }
260
+ unit;
261
+ constructor(unit) {
262
+ super();
263
+ this.unit = unit;
264
+ }
265
+ get typeId() {
266
+ return Type.Date;
267
+ }
268
+ // get ArrayType() {
269
+ // return Int32Array;
270
+ // }
271
+ get [Symbol.toStringTag]() {
272
+ return 'Date';
273
+ }
274
+ toString() {
275
+ return `Date${(this.unit + 1) * 32}<${DateUnit[this.unit]}>`;
276
+ }
229
277
  }
230
278
  export class DateDay extends Date {
231
- constructor() {
232
- super(DateUnit.DAY);
233
- }
279
+ constructor() {
280
+ super(DateUnit.DAY);
281
+ }
234
282
  }
235
283
  export class DateMillisecond extends Date {
236
- constructor() {
237
- super(DateUnit.MILLISECOND);
238
- }
284
+ constructor() {
285
+ super(DateUnit.MILLISECOND);
286
+ }
239
287
  }
240
288
  const TimeUnit = {
241
- SECOND: 1,
242
- MILLISECOND: 1e3,
243
- MICROSECOND: 1e6,
244
- NANOSECOND: 1e9
289
+ SECOND: 1,
290
+ MILLISECOND: 1e3,
291
+ MICROSECOND: 1e6,
292
+ NANOSECOND: 1e9
245
293
  };
246
- _Symbol$toStringTag4 = Symbol.toStringTag;
247
294
  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
- }
295
+ unit;
296
+ bitWidth;
297
+ constructor(unit, bitWidth) {
298
+ super();
299
+ this.unit = unit;
300
+ this.bitWidth = bitWidth;
301
+ }
302
+ get typeId() {
303
+ return Type.Time;
304
+ }
305
+ toString() {
306
+ return `Time${this.bitWidth}<${TimeUnit[this.unit]}>`;
307
+ }
308
+ get [Symbol.toStringTag]() {
309
+ return 'Time';
310
+ }
264
311
  }
265
312
  export class TimeSecond extends Time {
266
- constructor() {
267
- super(TimeUnit.SECOND, 32);
268
- }
313
+ constructor() {
314
+ super(TimeUnit.SECOND, 32);
315
+ }
269
316
  }
270
317
  export class TimeMillisecond extends Time {
271
- constructor() {
272
- super(TimeUnit.MILLISECOND, 32);
273
- }
318
+ constructor() {
319
+ super(TimeUnit.MILLISECOND, 32);
320
+ }
274
321
  }
275
- _Symbol$toStringTag5 = Symbol.toStringTag;
322
+ // export class TimeMicrosecond extends Time { constructor() { super(TimeUnit.MICROSECOND, 64); } }
323
+ // export class TimeNanosecond extends Time { constructor() { super(TimeUnit.NANOSECOND, 64); } }
276
324
  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
- }
325
+ unit;
326
+ timezone;
327
+ constructor(unit, timezone = null) {
328
+ super();
329
+ this.unit = unit;
330
+ this.timezone = timezone;
331
+ }
332
+ get typeId() {
333
+ return Type.Timestamp;
334
+ }
335
+ // get ArrayType() {
336
+ // return Int32Array;
337
+ // }
338
+ get [Symbol.toStringTag]() {
339
+ return 'Timestamp';
340
+ }
341
+ toString() {
342
+ return `Timestamp<${TimeUnit[this.unit]}${this.timezone ? `, ${this.timezone}` : ''}>`;
343
+ }
294
344
  }
295
345
  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
- }
346
+ constructor(timezone = null) {
347
+ super(TimeUnit.SECOND, timezone);
348
+ }
300
349
  }
301
350
  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
- }
351
+ constructor(timezone = null) {
352
+ super(TimeUnit.MILLISECOND, timezone);
353
+ }
306
354
  }
307
355
  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
- }
356
+ constructor(timezone = null) {
357
+ super(TimeUnit.MICROSECOND, timezone);
358
+ }
312
359
  }
313
360
  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
- }
361
+ constructor(timezone = null) {
362
+ super(TimeUnit.NANOSECOND, timezone);
363
+ }
318
364
  }
319
365
  const IntervalUnit = {
320
- DAY_TIME: 0,
321
- YEAR_MONTH: 1
366
+ DAY_TIME: 0,
367
+ YEAR_MONTH: 1
322
368
  };
323
- _Symbol$toStringTag6 = Symbol.toStringTag;
324
369
  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
- }
370
+ unit;
371
+ constructor(unit) {
372
+ super();
373
+ this.unit = unit;
374
+ }
375
+ get typeId() {
376
+ return Type.Interval;
377
+ }
378
+ // get ArrayType() {
379
+ // return Int32Array;
380
+ // }
381
+ get [Symbol.toStringTag]() {
382
+ return 'Interval';
383
+ }
384
+ toString() {
385
+ return `Interval<${IntervalUnit[this.unit]}>`;
386
+ }
339
387
  }
340
388
  export class IntervalDayTime extends Interval {
341
- constructor() {
342
- super(IntervalUnit.DAY_TIME);
343
- }
389
+ constructor() {
390
+ super(IntervalUnit.DAY_TIME);
391
+ }
344
392
  }
345
393
  export class IntervalYearMonth extends Interval {
346
- constructor() {
347
- super(IntervalUnit.YEAR_MONTH);
348
- }
394
+ constructor() {
395
+ super(IntervalUnit.YEAR_MONTH);
396
+ }
349
397
  }
350
- _Symbol$toStringTag7 = Symbol.toStringTag;
351
398
  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;
399
+ listSize;
400
+ children;
401
+ constructor(listSize, child) {
402
+ super();
403
+ this.listSize = listSize;
404
+ this.children = [child];
405
+ }
406
+ get typeId() {
407
+ return Type.FixedSizeList;
408
+ }
409
+ get valueType() {
410
+ return this.children[0].type;
411
+ }
412
+ get valueField() {
413
+ return this.children[0];
414
+ }
415
+ // get ArrayType() {
416
+ // return this.valueType.ArrayType;
417
+ // }
418
+ get [Symbol.toStringTag]() {
419
+ return 'FixedSizeList';
420
+ }
421
+ toString() {
422
+ return `FixedSizeList[${this.listSize}]<${JSON.stringify(this.valueType)}>`;
423
+ }
424
+ }
376
425
  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
426
+ children;
427
+ constructor(children) {
428
+ super();
429
+ this.children = children;
430
+ }
431
+ get typeId() {
432
+ return Type.Struct;
433
+ }
434
+ toString() {
435
+ return `Struct<{${this.children
436
+ .map((f) => `${f.name}:${JSON.stringify(f.type)}`)
437
+ .join(', ')}}>`;
438
+ }
439
+ get [Symbol.toStringTag]() {
440
+ return 'Struct';
441
+ }
442
+ }