celldega 0.1.4 → 0.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +4 -1
- package/build.js +0 -16
- package/js/vendor/parquet-wasm/LICENSE_APACHE +0 -176
- package/js/vendor/parquet-wasm/LICENSE_MIT +0 -25
- package/js/vendor/parquet-wasm/arrow2_bg.wasm.base64 +0 -1
- package/js/vendor/parquet-wasm/parquet-wasm_unpkg.js +0 -1963
- package/js/vendor/parquet-wasm/wasmModuleBase64.js +0 -2
- package/js/vendor/parquet-wasm/wrapper.js +0 -3
- package/js/widget.css +0 -23
- package/js/widget.js +0 -701
- package/pyproject.toml +0 -31
- package/src/celldega/__init__.py +0 -25
- package/wasm-plugin.mjs +0 -39
|
@@ -1,1963 +0,0 @@
|
|
|
1
|
-
// reference
|
|
2
|
-
// https://unpkg.com/parquet-wasm@0.4.0-beta.5/esm/arrow2.js
|
|
3
|
-
// https://github.com/kylebarron/parquet-wasm
|
|
4
|
-
let wasm;
|
|
5
|
-
|
|
6
|
-
const cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
7
|
-
|
|
8
|
-
cachedTextDecoder.decode();
|
|
9
|
-
|
|
10
|
-
let cachedUint8Memory0 = new Uint8Array();
|
|
11
|
-
|
|
12
|
-
function getUint8Memory0() {
|
|
13
|
-
if (cachedUint8Memory0.byteLength === 0) {
|
|
14
|
-
cachedUint8Memory0 = new Uint8Array(wasm.memory.buffer);
|
|
15
|
-
}
|
|
16
|
-
return cachedUint8Memory0;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
function getStringFromWasm0(ptr, len) {
|
|
20
|
-
return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
const heap = new Array(32).fill(undefined);
|
|
24
|
-
|
|
25
|
-
heap.push(undefined, null, true, false);
|
|
26
|
-
|
|
27
|
-
let heap_next = heap.length;
|
|
28
|
-
|
|
29
|
-
function addHeapObject(obj) {
|
|
30
|
-
if (heap_next === heap.length) heap.push(heap.length + 1);
|
|
31
|
-
const idx = heap_next;
|
|
32
|
-
heap_next = heap[idx];
|
|
33
|
-
|
|
34
|
-
heap[idx] = obj;
|
|
35
|
-
return idx;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
function getObject(idx) { return heap[idx]; }
|
|
39
|
-
|
|
40
|
-
function dropObject(idx) {
|
|
41
|
-
if (idx < 36) return;
|
|
42
|
-
heap[idx] = heap_next;
|
|
43
|
-
heap_next = idx;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
function takeObject(idx) {
|
|
47
|
-
const ret = getObject(idx);
|
|
48
|
-
dropObject(idx);
|
|
49
|
-
return ret;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
function debugString(val) {
|
|
53
|
-
// primitive types
|
|
54
|
-
const type = typeof val;
|
|
55
|
-
if (type == 'number' || type == 'boolean' || val == null) {
|
|
56
|
-
return `${val}`;
|
|
57
|
-
}
|
|
58
|
-
if (type == 'string') {
|
|
59
|
-
return `"${val}"`;
|
|
60
|
-
}
|
|
61
|
-
if (type == 'symbol') {
|
|
62
|
-
const description = val.description;
|
|
63
|
-
if (description == null) {
|
|
64
|
-
return 'Symbol';
|
|
65
|
-
} else {
|
|
66
|
-
return `Symbol(${description})`;
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
if (type == 'function') {
|
|
70
|
-
const name = val.name;
|
|
71
|
-
if (typeof name == 'string' && name.length > 0) {
|
|
72
|
-
return `Function(${name})`;
|
|
73
|
-
} else {
|
|
74
|
-
return 'Function';
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
// objects
|
|
78
|
-
if (Array.isArray(val)) {
|
|
79
|
-
const length = val.length;
|
|
80
|
-
let debug = '[';
|
|
81
|
-
if (length > 0) {
|
|
82
|
-
debug += debugString(val[0]);
|
|
83
|
-
}
|
|
84
|
-
for(let i = 1; i < length; i++) {
|
|
85
|
-
debug += ', ' + debugString(val[i]);
|
|
86
|
-
}
|
|
87
|
-
debug += ']';
|
|
88
|
-
return debug;
|
|
89
|
-
}
|
|
90
|
-
// Test for built-in
|
|
91
|
-
const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
|
|
92
|
-
let className;
|
|
93
|
-
if (builtInMatches.length > 1) {
|
|
94
|
-
className = builtInMatches[1];
|
|
95
|
-
} else {
|
|
96
|
-
// Failed to match the standard '[object ClassName]'
|
|
97
|
-
return toString.call(val);
|
|
98
|
-
}
|
|
99
|
-
if (className == 'Object') {
|
|
100
|
-
// we're a user defined class or Object
|
|
101
|
-
// JSON.stringify avoids problems with cycles, and is generally much
|
|
102
|
-
// easier than looping through ownProperties of `val`.
|
|
103
|
-
try {
|
|
104
|
-
return 'Object(' + JSON.stringify(val) + ')';
|
|
105
|
-
} catch (_) {
|
|
106
|
-
return 'Object';
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
// errors
|
|
110
|
-
if (val instanceof Error) {
|
|
111
|
-
return `${val.name}: ${val.message}\n${val.stack}`;
|
|
112
|
-
}
|
|
113
|
-
// TODO we could test for more things here, like `Set`s and `Map`s.
|
|
114
|
-
return className;
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
let WASM_VECTOR_LEN = 0;
|
|
118
|
-
|
|
119
|
-
const cachedTextEncoder = new TextEncoder('utf-8');
|
|
120
|
-
|
|
121
|
-
const encodeString = (typeof cachedTextEncoder.encodeInto === 'function'
|
|
122
|
-
? function (arg, view) {
|
|
123
|
-
return cachedTextEncoder.encodeInto(arg, view);
|
|
124
|
-
}
|
|
125
|
-
: function (arg, view) {
|
|
126
|
-
const buf = cachedTextEncoder.encode(arg);
|
|
127
|
-
view.set(buf);
|
|
128
|
-
return {
|
|
129
|
-
read: arg.length,
|
|
130
|
-
written: buf.length
|
|
131
|
-
};
|
|
132
|
-
});
|
|
133
|
-
|
|
134
|
-
function passStringToWasm0(arg, malloc, realloc) {
|
|
135
|
-
|
|
136
|
-
if (realloc === undefined) {
|
|
137
|
-
const buf = cachedTextEncoder.encode(arg);
|
|
138
|
-
const ptr = malloc(buf.length);
|
|
139
|
-
getUint8Memory0().subarray(ptr, ptr + buf.length).set(buf);
|
|
140
|
-
WASM_VECTOR_LEN = buf.length;
|
|
141
|
-
return ptr;
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
let len = arg.length;
|
|
145
|
-
let ptr = malloc(len);
|
|
146
|
-
|
|
147
|
-
const mem = getUint8Memory0();
|
|
148
|
-
|
|
149
|
-
let offset = 0;
|
|
150
|
-
|
|
151
|
-
for (; offset < len; offset++) {
|
|
152
|
-
const code = arg.charCodeAt(offset);
|
|
153
|
-
if (code > 0x7F) break;
|
|
154
|
-
mem[ptr + offset] = code;
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
if (offset !== len) {
|
|
158
|
-
if (offset !== 0) {
|
|
159
|
-
arg = arg.slice(offset);
|
|
160
|
-
}
|
|
161
|
-
ptr = realloc(ptr, len, len = offset + arg.length * 3);
|
|
162
|
-
const view = getUint8Memory0().subarray(ptr + offset, ptr + len);
|
|
163
|
-
const ret = encodeString(arg, view);
|
|
164
|
-
|
|
165
|
-
offset += ret.written;
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
WASM_VECTOR_LEN = offset;
|
|
169
|
-
return ptr;
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
let cachedInt32Memory0 = new Int32Array();
|
|
173
|
-
|
|
174
|
-
function getInt32Memory0() {
|
|
175
|
-
if (cachedInt32Memory0.byteLength === 0) {
|
|
176
|
-
cachedInt32Memory0 = new Int32Array(wasm.memory.buffer);
|
|
177
|
-
}
|
|
178
|
-
return cachedInt32Memory0;
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
function makeMutClosure(arg0, arg1, dtor, f) {
|
|
182
|
-
const state = { a: arg0, b: arg1, cnt: 1, dtor };
|
|
183
|
-
const real = (...args) => {
|
|
184
|
-
// First up with a closure we increment the internal reference
|
|
185
|
-
// count. This ensures that the Rust closure environment won't
|
|
186
|
-
// be deallocated while we're invoking it.
|
|
187
|
-
state.cnt++;
|
|
188
|
-
const a = state.a;
|
|
189
|
-
state.a = 0;
|
|
190
|
-
try {
|
|
191
|
-
return f(a, state.b, ...args);
|
|
192
|
-
} finally {
|
|
193
|
-
if (--state.cnt === 0) {
|
|
194
|
-
wasm.__wbindgen_export_2.get(state.dtor)(a, state.b);
|
|
195
|
-
|
|
196
|
-
} else {
|
|
197
|
-
state.a = a;
|
|
198
|
-
}
|
|
199
|
-
}
|
|
200
|
-
};
|
|
201
|
-
real.original = state;
|
|
202
|
-
|
|
203
|
-
return real;
|
|
204
|
-
}
|
|
205
|
-
function __wbg_adapter_26(arg0, arg1, arg2) {
|
|
206
|
-
wasm._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h3585afe01e623669(arg0, arg1, addHeapObject(arg2));
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
const u32CvtShim = new Uint32Array(2);
|
|
210
|
-
|
|
211
|
-
const int64CvtShim = new BigInt64Array(u32CvtShim.buffer);
|
|
212
|
-
|
|
213
|
-
let cachedBigUint64Memory0 = new BigUint64Array();
|
|
214
|
-
|
|
215
|
-
function getBigUint64Memory0() {
|
|
216
|
-
if (cachedBigUint64Memory0.byteLength === 0) {
|
|
217
|
-
cachedBigUint64Memory0 = new BigUint64Array(wasm.memory.buffer);
|
|
218
|
-
}
|
|
219
|
-
return cachedBigUint64Memory0;
|
|
220
|
-
}
|
|
221
|
-
|
|
222
|
-
function getArrayU64FromWasm0(ptr, len) {
|
|
223
|
-
return getBigUint64Memory0().subarray(ptr / 8, ptr / 8 + len);
|
|
224
|
-
}
|
|
225
|
-
|
|
226
|
-
function passArray8ToWasm0(arg, malloc) {
|
|
227
|
-
const ptr = malloc(arg.length * 1);
|
|
228
|
-
getUint8Memory0().set(arg, ptr / 1);
|
|
229
|
-
WASM_VECTOR_LEN = arg.length;
|
|
230
|
-
return ptr;
|
|
231
|
-
}
|
|
232
|
-
/**
|
|
233
|
-
* Read a Parquet file into Arrow data using the [`arrow2`](https://crates.io/crates/arrow2) and
|
|
234
|
-
* [`parquet2`](https://crates.io/crates/parquet2) Rust crates.
|
|
235
|
-
*
|
|
236
|
-
* Example:
|
|
237
|
-
*
|
|
238
|
-
* ```js
|
|
239
|
-
* import { tableFromIPC } from "apache-arrow";
|
|
240
|
-
* // Edit the `parquet-wasm` import as necessary
|
|
241
|
-
* import { readParquet } from "parquet-wasm/node2";
|
|
242
|
-
*
|
|
243
|
-
* const resp = await fetch("https://example.com/file.parquet");
|
|
244
|
-
* const parquetUint8Array = new Uint8Array(await resp.arrayBuffer());
|
|
245
|
-
* const arrowUint8Array = readParquet(parquetUint8Array);
|
|
246
|
-
* const arrowTable = tableFromIPC(arrowUint8Array);
|
|
247
|
-
* ```
|
|
248
|
-
*
|
|
249
|
-
* @param parquet_file Uint8Array containing Parquet data
|
|
250
|
-
* @returns Uint8Array containing Arrow data in [IPC Stream format](https://arrow.apache.org/docs/format/Columnar.html#ipc-streaming-format). To parse this into an Arrow table, pass to `tableFromIPC` in the Arrow JS bindings.
|
|
251
|
-
* @param {Uint8Array} parquet_file
|
|
252
|
-
* @returns {Uint8Array}
|
|
253
|
-
*/
|
|
254
|
-
export function readParquet(parquet_file) {
|
|
255
|
-
try {
|
|
256
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
257
|
-
const ptr0 = passArray8ToWasm0(parquet_file, wasm.__wbindgen_malloc);
|
|
258
|
-
const len0 = WASM_VECTOR_LEN;
|
|
259
|
-
wasm.readParquet(retptr, ptr0, len0);
|
|
260
|
-
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
261
|
-
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
262
|
-
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
263
|
-
if (r2) {
|
|
264
|
-
throw takeObject(r1);
|
|
265
|
-
}
|
|
266
|
-
return takeObject(r0);
|
|
267
|
-
} finally {
|
|
268
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
269
|
-
}
|
|
270
|
-
}
|
|
271
|
-
|
|
272
|
-
/**
|
|
273
|
-
* Read a Parquet file into Arrow data using the [`arrow2`](https://crates.io/crates/arrow2) and
|
|
274
|
-
* [`parquet2`](https://crates.io/crates/parquet2) Rust crates.
|
|
275
|
-
*
|
|
276
|
-
* Example:
|
|
277
|
-
*
|
|
278
|
-
* ```js
|
|
279
|
-
* import { tableFromIPC } from "apache-arrow";
|
|
280
|
-
* // Edit the `parquet-wasm` import as necessary
|
|
281
|
-
* import { _readParquetFFI } from "parquet-wasm/node2";
|
|
282
|
-
*
|
|
283
|
-
* const resp = await fetch("https://example.com/file.parquet");
|
|
284
|
-
* const parquetUint8Array = new Uint8Array(await resp.arrayBuffer());
|
|
285
|
-
* const wasmArrowTable = _readParquetFFI(parquetUint8Array);
|
|
286
|
-
* // Pointer to the ArrowArray FFI struct for the first record batch and first column
|
|
287
|
-
* const arrayPtr = wasmArrowTable.array(0, 0);
|
|
288
|
-
* ```
|
|
289
|
-
*
|
|
290
|
-
* @param parquet_file Uint8Array containing Parquet data
|
|
291
|
-
* @returns an {@linkcode FFIArrowTable} object containing the parsed Arrow table in WebAssembly memory. To read into an Arrow JS table, you'll need to use the Arrow C Data interface.
|
|
292
|
-
* @param {Uint8Array} parquet_file
|
|
293
|
-
* @returns {FFIArrowTable}
|
|
294
|
-
*/
|
|
295
|
-
export function _readParquetFFI(parquet_file) {
|
|
296
|
-
try {
|
|
297
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
298
|
-
const ptr0 = passArray8ToWasm0(parquet_file, wasm.__wbindgen_malloc);
|
|
299
|
-
const len0 = WASM_VECTOR_LEN;
|
|
300
|
-
wasm._readParquetFFI(retptr, ptr0, len0);
|
|
301
|
-
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
302
|
-
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
303
|
-
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
304
|
-
if (r2) {
|
|
305
|
-
throw takeObject(r1);
|
|
306
|
-
}
|
|
307
|
-
return FFIArrowTable.__wrap(r0);
|
|
308
|
-
} finally {
|
|
309
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
310
|
-
}
|
|
311
|
-
}
|
|
312
|
-
|
|
313
|
-
/**
|
|
314
|
-
* Read metadata from a Parquet file using the [`arrow2`](https://crates.io/crates/arrow2) and
|
|
315
|
-
* [`parquet2`](https://crates.io/crates/parquet2) Rust crates.
|
|
316
|
-
*
|
|
317
|
-
* Example:
|
|
318
|
-
*
|
|
319
|
-
* ```js
|
|
320
|
-
* // Edit the `parquet-wasm` import as necessary
|
|
321
|
-
* import { readMetadata } from "parquet-wasm/node2";
|
|
322
|
-
*
|
|
323
|
-
* const resp = await fetch("https://example.com/file.parquet");
|
|
324
|
-
* const parquetUint8Array = new Uint8Array(await resp.arrayBuffer());
|
|
325
|
-
* const parquetFileMetaData = readMetadata(parquetUint8Array);
|
|
326
|
-
* ```
|
|
327
|
-
*
|
|
328
|
-
* @param parquet_file Uint8Array containing Parquet data
|
|
329
|
-
* @returns a {@linkcode FileMetaData} object containing metadata of the Parquet file.
|
|
330
|
-
* @param {Uint8Array} parquet_file
|
|
331
|
-
* @returns {FileMetaData}
|
|
332
|
-
*/
|
|
333
|
-
export function readMetadata(parquet_file) {
|
|
334
|
-
try {
|
|
335
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
336
|
-
const ptr0 = passArray8ToWasm0(parquet_file, wasm.__wbindgen_malloc);
|
|
337
|
-
const len0 = WASM_VECTOR_LEN;
|
|
338
|
-
wasm.readMetadata(retptr, ptr0, len0);
|
|
339
|
-
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
340
|
-
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
341
|
-
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
342
|
-
if (r2) {
|
|
343
|
-
throw takeObject(r1);
|
|
344
|
-
}
|
|
345
|
-
return FileMetaData.__wrap(r0);
|
|
346
|
-
} finally {
|
|
347
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
348
|
-
}
|
|
349
|
-
}
|
|
350
|
-
|
|
351
|
-
function _assertClass(instance, klass) {
|
|
352
|
-
if (!(instance instanceof klass)) {
|
|
353
|
-
throw new Error(`expected instance of ${klass.name}`);
|
|
354
|
-
}
|
|
355
|
-
return instance.ptr;
|
|
356
|
-
}
|
|
357
|
-
/**
|
|
358
|
-
* Read a single row group from a Parquet file into Arrow data using the
|
|
359
|
-
* [`arrow2`](https://crates.io/crates/arrow2) and [`parquet2`](https://crates.io/crates/parquet2)
|
|
360
|
-
* Rust crates.
|
|
361
|
-
*
|
|
362
|
-
* Example:
|
|
363
|
-
*
|
|
364
|
-
* ```js
|
|
365
|
-
* import { tableFromIPC } from "apache-arrow";
|
|
366
|
-
* // Edit the `parquet-wasm` import as necessary
|
|
367
|
-
* import { readRowGroup, readMetadata } from "parquet-wasm/node2";
|
|
368
|
-
*
|
|
369
|
-
* const resp = await fetch("https://example.com/file.parquet");
|
|
370
|
-
* const parquetUint8Array = new Uint8Array(await resp.arrayBuffer());
|
|
371
|
-
* const parquetFileMetaData = readMetadata(parquetUint8Array);
|
|
372
|
-
*
|
|
373
|
-
* // Read only the first row group
|
|
374
|
-
* const arrowIpcBuffer = wasm.readRowGroup(parquetUint8Array, parquetFileMetaData, 0);
|
|
375
|
-
* const arrowTable = tableFromIPC(arrowUint8Array);
|
|
376
|
-
* ```
|
|
377
|
-
*
|
|
378
|
-
* Note that you can get the number of row groups in a Parquet file using {@linkcode FileMetaData.numRowGroups}
|
|
379
|
-
*
|
|
380
|
-
* @param parquet_file Uint8Array containing Parquet data
|
|
381
|
-
* @param meta {@linkcode FileMetaData} from a call to {@linkcode readMetadata}
|
|
382
|
-
* @param i Number index of the row group to parse
|
|
383
|
-
* @returns Uint8Array containing Arrow data in [IPC Stream format](https://arrow.apache.org/docs/format/Columnar.html#ipc-streaming-format). To parse this into an Arrow table, pass to `tableFromIPC` in the Arrow JS bindings.
|
|
384
|
-
* @param {Uint8Array} parquet_file
|
|
385
|
-
* @param {FileMetaData} meta
|
|
386
|
-
* @param {number} i
|
|
387
|
-
* @returns {Uint8Array}
|
|
388
|
-
*/
|
|
389
|
-
export function readRowGroup(parquet_file, meta, i) {
|
|
390
|
-
try {
|
|
391
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
392
|
-
const ptr0 = passArray8ToWasm0(parquet_file, wasm.__wbindgen_malloc);
|
|
393
|
-
const len0 = WASM_VECTOR_LEN;
|
|
394
|
-
_assertClass(meta, FileMetaData);
|
|
395
|
-
wasm.readRowGroup(retptr, ptr0, len0, meta.ptr, i);
|
|
396
|
-
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
397
|
-
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
398
|
-
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
399
|
-
if (r2) {
|
|
400
|
-
throw takeObject(r1);
|
|
401
|
-
}
|
|
402
|
-
return takeObject(r0);
|
|
403
|
-
} finally {
|
|
404
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
405
|
-
}
|
|
406
|
-
}
|
|
407
|
-
|
|
408
|
-
/**
|
|
409
|
-
* Asynchronously read metadata from a Parquet file using the
|
|
410
|
-
* [`arrow2`](https://crates.io/crates/arrow2) and [`parquet2`](https://crates.io/crates/parquet2)
|
|
411
|
-
* Rust crates.
|
|
412
|
-
*
|
|
413
|
-
* For now, this requires knowing the content length of the file, but hopefully this will be
|
|
414
|
-
* relaxed in the future.
|
|
415
|
-
*
|
|
416
|
-
* Example:
|
|
417
|
-
*
|
|
418
|
-
* ```js
|
|
419
|
-
* // Edit the `parquet-wasm` import as necessary
|
|
420
|
-
* import { readMetadataAsync } from "parquet-wasm";
|
|
421
|
-
*
|
|
422
|
-
* const url = "https://example.com/file.parquet";
|
|
423
|
-
* const headResp = await fetch(url, {method: 'HEAD'});
|
|
424
|
-
* const length = parseInt(headResp.headers.get('Content-Length'));
|
|
425
|
-
*
|
|
426
|
-
* const parquetFileMetaData = await readMetadataAsync(url, length);
|
|
427
|
-
* ```
|
|
428
|
-
*
|
|
429
|
-
* @param url String location of remote Parquet file containing Parquet data
|
|
430
|
-
* @param content_length Number content length of file in bytes
|
|
431
|
-
* @returns a {@linkcode FileMetaData} object containing metadata of the Parquet file.
|
|
432
|
-
* @param {string} url
|
|
433
|
-
* @param {number} content_length
|
|
434
|
-
* @returns {Promise<FileMetaData>}
|
|
435
|
-
*/
|
|
436
|
-
export function readMetadataAsync(url, content_length) {
|
|
437
|
-
const ptr0 = passStringToWasm0(url, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
438
|
-
const len0 = WASM_VECTOR_LEN;
|
|
439
|
-
const ret = wasm.readMetadataAsync(ptr0, len0, content_length);
|
|
440
|
-
return takeObject(ret);
|
|
441
|
-
}
|
|
442
|
-
|
|
443
|
-
/**
|
|
444
|
-
* Asynchronously read a single row group from a Parquet file into Arrow data using the
|
|
445
|
-
* [`arrow2`](https://crates.io/crates/arrow2) and [`parquet2`](https://crates.io/crates/parquet2)
|
|
446
|
-
* Rust crates.
|
|
447
|
-
*
|
|
448
|
-
* Example:
|
|
449
|
-
*
|
|
450
|
-
* ```js
|
|
451
|
-
* import { tableFromIPC } from "apache-arrow";
|
|
452
|
-
* // Edit the `parquet-wasm` import as necessary
|
|
453
|
-
* import { readRowGroupAsync, readMetadataAsync } from "parquet-wasm";
|
|
454
|
-
*
|
|
455
|
-
* const url = "https://example.com/file.parquet";
|
|
456
|
-
* const headResp = await fetch(url, {method: 'HEAD'});
|
|
457
|
-
* const length = parseInt(headResp.headers.get('Content-Length'));
|
|
458
|
-
*
|
|
459
|
-
* const parquetFileMetaData = await readMetadataAsync(url, length);
|
|
460
|
-
*
|
|
461
|
-
* // Read all batches from the file in parallel
|
|
462
|
-
* const promises = [];
|
|
463
|
-
* for (let i = 0; i < parquetFileMetaData.numRowGroups(); i++) {
|
|
464
|
-
* // IMPORTANT: For now, calling `copy()` on the metadata object is required whenever passing in to
|
|
465
|
-
* // a function. Hopefully this can be resolved in the future sometime
|
|
466
|
-
* const rowGroupPromise = wasm.readRowGroupAsync2(url, length, parquetFileMetaData.copy(), i);
|
|
467
|
-
* promises.push(rowGroupPromise);
|
|
468
|
-
* }
|
|
469
|
-
*
|
|
470
|
-
* const recordBatchChunks = await Promise.all(promises);
|
|
471
|
-
* const table = new arrow.Table(recordBatchChunks);
|
|
472
|
-
* ```
|
|
473
|
-
*
|
|
474
|
-
* Note that you can get the number of row groups in a Parquet file using {@linkcode FileMetaData.numRowGroups}
|
|
475
|
-
*
|
|
476
|
-
* @param url String location of remote Parquet file containing Parquet data
|
|
477
|
-
* @param content_length Number content length of file in bytes
|
|
478
|
-
* @param meta {@linkcode FileMetaData} from a call to {@linkcode readMetadata}
|
|
479
|
-
* @param i Number index of the row group to load
|
|
480
|
-
* @returns Uint8Array containing Arrow data in [IPC Stream format](https://arrow.apache.org/docs/format/Columnar.html#ipc-streaming-format). To parse this into an Arrow table, pass to `tableFromIPC` in the Arrow JS bindings.
|
|
481
|
-
* @param {string} url
|
|
482
|
-
* @param {RowGroupMetaData} row_group_meta
|
|
483
|
-
* @param {ArrowSchema} arrow_schema
|
|
484
|
-
* @returns {Promise<Uint8Array>}
|
|
485
|
-
*/
|
|
486
|
-
export function readRowGroupAsync(url, row_group_meta, arrow_schema) {
|
|
487
|
-
const ptr0 = passStringToWasm0(url, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
488
|
-
const len0 = WASM_VECTOR_LEN;
|
|
489
|
-
_assertClass(row_group_meta, RowGroupMetaData);
|
|
490
|
-
var ptr1 = row_group_meta.ptr;
|
|
491
|
-
row_group_meta.ptr = 0;
|
|
492
|
-
_assertClass(arrow_schema, ArrowSchema);
|
|
493
|
-
var ptr2 = arrow_schema.ptr;
|
|
494
|
-
arrow_schema.ptr = 0;
|
|
495
|
-
const ret = wasm.readRowGroupAsync(ptr0, len0, ptr1, ptr2);
|
|
496
|
-
return takeObject(ret);
|
|
497
|
-
}
|
|
498
|
-
|
|
499
|
-
function isLikeNone(x) {
|
|
500
|
-
return x === undefined || x === null;
|
|
501
|
-
}
|
|
502
|
-
/**
|
|
503
|
-
* Write Arrow data to a Parquet file using the [`arrow2`](https://crates.io/crates/arrow2) and
|
|
504
|
-
* [`parquet2`](https://crates.io/crates/parquet2) Rust crates.
|
|
505
|
-
*
|
|
506
|
-
* For example, to create a Parquet file with Snappy compression:
|
|
507
|
-
*
|
|
508
|
-
* ```js
|
|
509
|
-
* import { tableToIPC } from "apache-arrow";
|
|
510
|
-
* // Edit the `parquet-wasm` import as necessary
|
|
511
|
-
* import { WriterPropertiesBuilder, Compression, writeParquet } from "parquet-wasm/node2";
|
|
512
|
-
*
|
|
513
|
-
* // Given an existing arrow table under `table`
|
|
514
|
-
* const arrowUint8Array = tableToIPC(table, "file");
|
|
515
|
-
* const writerProperties = new WriterPropertiesBuilder()
|
|
516
|
-
* .setCompression(Compression.SNAPPY)
|
|
517
|
-
* .build();
|
|
518
|
-
* const parquetUint8Array = writeParquet(arrowUint8Array, writerProperties);
|
|
519
|
-
* ```
|
|
520
|
-
*
|
|
521
|
-
* If `writerProperties` is not provided or is `null`, the default writer properties will be used.
|
|
522
|
-
* This is equivalent to `new WriterPropertiesBuilder().build()`.
|
|
523
|
-
*
|
|
524
|
-
* @param arrow_file Uint8Array containing Arrow data in [IPC **File** format](https://arrow.apache.org/docs/format/Columnar.html#ipc-file-format). If you have an Arrow table in JS, call `tableToIPC(table, "file")` in the JS bindings and pass the result here.
|
|
525
|
-
* @param writer_properties Configuration for writing to Parquet. Use the {@linkcode WriterPropertiesBuilder} to build a writing configuration, then call `.build()` to create an immutable writer properties to pass in here.
|
|
526
|
-
* @returns Uint8Array containing written Parquet data.
|
|
527
|
-
* @param {Uint8Array} arrow_file
|
|
528
|
-
* @param {WriterProperties | undefined} writer_properties
|
|
529
|
-
* @returns {Uint8Array}
|
|
530
|
-
*/
|
|
531
|
-
export function writeParquet(arrow_file, writer_properties) {
|
|
532
|
-
try {
|
|
533
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
534
|
-
const ptr0 = passArray8ToWasm0(arrow_file, wasm.__wbindgen_malloc);
|
|
535
|
-
const len0 = WASM_VECTOR_LEN;
|
|
536
|
-
let ptr1 = 0;
|
|
537
|
-
if (!isLikeNone(writer_properties)) {
|
|
538
|
-
_assertClass(writer_properties, WriterProperties);
|
|
539
|
-
ptr1 = writer_properties.ptr;
|
|
540
|
-
writer_properties.ptr = 0;
|
|
541
|
-
}
|
|
542
|
-
wasm.writeParquet(retptr, ptr0, len0, ptr1);
|
|
543
|
-
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
544
|
-
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
545
|
-
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
546
|
-
if (r2) {
|
|
547
|
-
throw takeObject(r1);
|
|
548
|
-
}
|
|
549
|
-
return takeObject(r0);
|
|
550
|
-
} finally {
|
|
551
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
552
|
-
}
|
|
553
|
-
}
|
|
554
|
-
|
|
555
|
-
/**
|
|
556
|
-
* Write Arrow data to a Parquet file using the [`arrow2`](https://crates.io/crates/arrow2) and
|
|
557
|
-
* [`parquet2`](https://crates.io/crates/parquet2) Rust crates.
|
|
558
|
-
*
|
|
559
|
-
* For example, to create a Parquet file with Snappy compression:
|
|
560
|
-
*
|
|
561
|
-
* ```js
|
|
562
|
-
* import { tableToIPC } from "apache-arrow";
|
|
563
|
-
* // Edit the `parquet-wasm` import as necessary
|
|
564
|
-
* import { WriterPropertiesBuilder, Compression, _writeParquetFFI } from "parquet-wasm/node2";
|
|
565
|
-
*
|
|
566
|
-
* // Given an existing arrow table under `table`
|
|
567
|
-
* const arrowUint8Array = tableToIPC(table, "file");
|
|
568
|
-
* const writerProperties = new WriterPropertiesBuilder()
|
|
569
|
-
* .setCompression(Compression.SNAPPY)
|
|
570
|
-
* .build();
|
|
571
|
-
* const parquetUint8Array = writeParquet(arrowUint8Array, writerProperties);
|
|
572
|
-
* ```
|
|
573
|
-
*
|
|
574
|
-
* If `writerProperties` is not provided or is `null`, the default writer properties will be used.
|
|
575
|
-
* This is equivalent to `new WriterPropertiesBuilder().build()`.
|
|
576
|
-
*
|
|
577
|
-
* @param arrow_table {@linkcode FFIArrowTable} Arrow Table in Wasm memory
|
|
578
|
-
* @param writer_properties Configuration for writing to Parquet. Use the {@linkcode WriterPropertiesBuilder} to build a writing configuration, then call `.build()` to create an immutable writer properties to pass in here.
|
|
579
|
-
* @returns Uint8Array containing written Parquet data.
|
|
580
|
-
* @param {FFIArrowTable} arrow_table
|
|
581
|
-
* @param {WriterProperties | undefined} writer_properties
|
|
582
|
-
* @returns {Uint8Array}
|
|
583
|
-
*/
|
|
584
|
-
export function _writeParquetFFI(arrow_table, writer_properties) {
|
|
585
|
-
try {
|
|
586
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
587
|
-
_assertClass(arrow_table, FFIArrowTable);
|
|
588
|
-
var ptr0 = arrow_table.ptr;
|
|
589
|
-
arrow_table.ptr = 0;
|
|
590
|
-
let ptr1 = 0;
|
|
591
|
-
if (!isLikeNone(writer_properties)) {
|
|
592
|
-
_assertClass(writer_properties, WriterProperties);
|
|
593
|
-
ptr1 = writer_properties.ptr;
|
|
594
|
-
writer_properties.ptr = 0;
|
|
595
|
-
}
|
|
596
|
-
wasm._writeParquetFFI(retptr, ptr0, ptr1);
|
|
597
|
-
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
598
|
-
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
599
|
-
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
600
|
-
if (r2) {
|
|
601
|
-
throw takeObject(r1);
|
|
602
|
-
}
|
|
603
|
-
return takeObject(r0);
|
|
604
|
-
} finally {
|
|
605
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
606
|
-
}
|
|
607
|
-
}
|
|
608
|
-
|
|
609
|
-
function handleError(f, args) {
|
|
610
|
-
try {
|
|
611
|
-
return f.apply(this, args);
|
|
612
|
-
} catch (e) {
|
|
613
|
-
wasm.__wbindgen_exn_store(addHeapObject(e));
|
|
614
|
-
}
|
|
615
|
-
}
|
|
616
|
-
function __wbg_adapter_127(arg0, arg1, arg2, arg3) {
|
|
617
|
-
wasm.wasm_bindgen__convert__closures__invoke2_mut__haace1f71440c779f(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
|
|
618
|
-
}
|
|
619
|
-
|
|
620
|
-
/**
|
|
621
|
-
* Supported compression algorithms.
|
|
622
|
-
*
|
|
623
|
-
* Codecs added in format version X.Y can be read by readers based on X.Y and later.
|
|
624
|
-
* Codec support may vary between readers based on the format version and
|
|
625
|
-
* libraries available at runtime.
|
|
626
|
-
*/
|
|
627
|
-
export const Compression = Object.freeze({ UNCOMPRESSED:0,"0":"UNCOMPRESSED",SNAPPY:1,"1":"SNAPPY",GZIP:2,"2":"GZIP",BROTLI:3,"3":"BROTLI",
|
|
628
|
-
/**
|
|
629
|
-
* @deprecated as of Parquet 2.9.0.
|
|
630
|
-
* Switch to LZ4_RAW
|
|
631
|
-
*/
|
|
632
|
-
LZ4:4,"4":"LZ4",ZSTD:5,"5":"ZSTD",LZ4_RAW:6,"6":"LZ4_RAW", });
|
|
633
|
-
/**
|
|
634
|
-
* Encodings supported by Parquet.
|
|
635
|
-
* Not all encodings are valid for all types. These enums are also used to specify the
|
|
636
|
-
* encoding of definition and repetition levels.
|
|
637
|
-
*/
|
|
638
|
-
export const Encoding = Object.freeze({
|
|
639
|
-
/**
|
|
640
|
-
* Default byte encoding.
|
|
641
|
-
* - BOOLEAN - 1 bit per value, 0 is false; 1 is true.
|
|
642
|
-
* - INT32 - 4 bytes per value, stored as little-endian.
|
|
643
|
-
* - INT64 - 8 bytes per value, stored as little-endian.
|
|
644
|
-
* - FLOAT - 4 bytes per value, stored as little-endian.
|
|
645
|
-
* - DOUBLE - 8 bytes per value, stored as little-endian.
|
|
646
|
-
* - BYTE_ARRAY - 4 byte length stored as little endian, followed by bytes.
|
|
647
|
-
* - FIXED_LEN_BYTE_ARRAY - just the bytes are stored.
|
|
648
|
-
*/
|
|
649
|
-
PLAIN:0,"0":"PLAIN",
|
|
650
|
-
/**
|
|
651
|
-
* **Deprecated** dictionary encoding.
|
|
652
|
-
*
|
|
653
|
-
* The values in the dictionary are encoded using PLAIN encoding.
|
|
654
|
-
* Since it is deprecated, RLE_DICTIONARY encoding is used for a data page, and
|
|
655
|
-
* PLAIN encoding is used for dictionary page.
|
|
656
|
-
*/
|
|
657
|
-
PLAIN_DICTIONARY:1,"1":"PLAIN_DICTIONARY",
|
|
658
|
-
/**
|
|
659
|
-
* Group packed run length encoding.
|
|
660
|
-
*
|
|
661
|
-
* Usable for definition/repetition levels encoding and boolean values.
|
|
662
|
-
*/
|
|
663
|
-
RLE:2,"2":"RLE",
|
|
664
|
-
/**
|
|
665
|
-
* Bit packed encoding.
|
|
666
|
-
*
|
|
667
|
-
* This can only be used if the data has a known max width.
|
|
668
|
-
* Usable for definition/repetition levels encoding.
|
|
669
|
-
*/
|
|
670
|
-
BIT_PACKED:3,"3":"BIT_PACKED",
|
|
671
|
-
/**
|
|
672
|
-
* Delta encoding for integers, either INT32 or INT64.
|
|
673
|
-
*
|
|
674
|
-
* Works best on sorted data.
|
|
675
|
-
*/
|
|
676
|
-
DELTA_BINARY_PACKED:4,"4":"DELTA_BINARY_PACKED",
|
|
677
|
-
/**
|
|
678
|
-
* Encoding for byte arrays to separate the length values and the data.
|
|
679
|
-
*
|
|
680
|
-
* The lengths are encoded using DELTA_BINARY_PACKED encoding.
|
|
681
|
-
*/
|
|
682
|
-
DELTA_LENGTH_BYTE_ARRAY:5,"5":"DELTA_LENGTH_BYTE_ARRAY",
|
|
683
|
-
/**
|
|
684
|
-
* Incremental encoding for byte arrays.
|
|
685
|
-
*
|
|
686
|
-
* Prefix lengths are encoded using DELTA_BINARY_PACKED encoding.
|
|
687
|
-
* Suffixes are stored using DELTA_LENGTH_BYTE_ARRAY encoding.
|
|
688
|
-
*/
|
|
689
|
-
DELTA_BYTE_ARRAY:6,"6":"DELTA_BYTE_ARRAY",
|
|
690
|
-
/**
|
|
691
|
-
* Dictionary encoding.
|
|
692
|
-
*
|
|
693
|
-
* The ids are encoded using the RLE encoding.
|
|
694
|
-
*/
|
|
695
|
-
RLE_DICTIONARY:7,"7":"RLE_DICTIONARY",
|
|
696
|
-
/**
|
|
697
|
-
* Encoding for floating-point data.
|
|
698
|
-
*
|
|
699
|
-
* K byte-streams are created where K is the size in bytes of the data type.
|
|
700
|
-
* The individual bytes of an FP value are scattered to the corresponding stream and
|
|
701
|
-
* the streams are concatenated.
|
|
702
|
-
* This itself does not reduce the size of the data but can lead to better compression
|
|
703
|
-
* afterwards.
|
|
704
|
-
*/
|
|
705
|
-
BYTE_STREAM_SPLIT:8,"8":"BYTE_STREAM_SPLIT", });
|
|
706
|
-
/**
|
|
707
|
-
* The Parquet version to use when writing
|
|
708
|
-
*/
|
|
709
|
-
export const WriterVersion = Object.freeze({ V1:0,"0":"V1",V2:1,"1":"V2", });
|
|
710
|
-
/**
|
|
711
|
-
* Metadata for a Parquet file.
|
|
712
|
-
*/
|
|
713
|
-
export class ArrowSchema {
|
|
714
|
-
|
|
715
|
-
static __wrap(ptr) {
|
|
716
|
-
const obj = Object.create(ArrowSchema.prototype);
|
|
717
|
-
obj.ptr = ptr;
|
|
718
|
-
|
|
719
|
-
return obj;
|
|
720
|
-
}
|
|
721
|
-
|
|
722
|
-
__destroy_into_raw() {
|
|
723
|
-
const ptr = this.ptr;
|
|
724
|
-
this.ptr = 0;
|
|
725
|
-
|
|
726
|
-
return ptr;
|
|
727
|
-
}
|
|
728
|
-
|
|
729
|
-
free() {
|
|
730
|
-
const ptr = this.__destroy_into_raw();
|
|
731
|
-
wasm.__wbg_arrowschema_free(ptr);
|
|
732
|
-
}
|
|
733
|
-
/**
|
|
734
|
-
* Clone this struct in wasm memory.
|
|
735
|
-
* @returns {ArrowSchema}
|
|
736
|
-
*/
|
|
737
|
-
copy() {
|
|
738
|
-
const ret = wasm.arrowschema_copy(this.ptr);
|
|
739
|
-
return ArrowSchema.__wrap(ret);
|
|
740
|
-
}
|
|
741
|
-
}
|
|
742
|
-
/**
|
|
743
|
-
* Metadata for a column chunk.
|
|
744
|
-
*/
|
|
745
|
-
export class ColumnChunkMetaData {
|
|
746
|
-
|
|
747
|
-
static __wrap(ptr) {
|
|
748
|
-
const obj = Object.create(ColumnChunkMetaData.prototype);
|
|
749
|
-
obj.ptr = ptr;
|
|
750
|
-
|
|
751
|
-
return obj;
|
|
752
|
-
}
|
|
753
|
-
|
|
754
|
-
__destroy_into_raw() {
|
|
755
|
-
const ptr = this.ptr;
|
|
756
|
-
this.ptr = 0;
|
|
757
|
-
|
|
758
|
-
return ptr;
|
|
759
|
-
}
|
|
760
|
-
|
|
761
|
-
free() {
|
|
762
|
-
const ptr = this.__destroy_into_raw();
|
|
763
|
-
wasm.__wbg_columnchunkmetadata_free(ptr);
|
|
764
|
-
}
|
|
765
|
-
/**
|
|
766
|
-
* File where the column chunk is stored.
|
|
767
|
-
*
|
|
768
|
-
* If not set, assumed to belong to the same file as the metadata.
|
|
769
|
-
* This path is relative to the current file.
|
|
770
|
-
* @returns {string | undefined}
|
|
771
|
-
*/
|
|
772
|
-
filePath() {
|
|
773
|
-
try {
|
|
774
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
775
|
-
wasm.columnchunkmetadata_filePath(retptr, this.ptr);
|
|
776
|
-
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
777
|
-
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
778
|
-
let v0;
|
|
779
|
-
if (r0 !== 0) {
|
|
780
|
-
v0 = getStringFromWasm0(r0, r1).slice();
|
|
781
|
-
wasm.__wbindgen_free(r0, r1 * 1);
|
|
782
|
-
}
|
|
783
|
-
return v0;
|
|
784
|
-
} finally {
|
|
785
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
786
|
-
}
|
|
787
|
-
}
|
|
788
|
-
/**
|
|
789
|
-
* Byte offset in `file_path()`.
|
|
790
|
-
* @returns {bigint}
|
|
791
|
-
*/
|
|
792
|
-
fileOffset() {
|
|
793
|
-
try {
|
|
794
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
795
|
-
wasm.columnchunkmetadata_fileOffset(retptr, this.ptr);
|
|
796
|
-
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
797
|
-
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
798
|
-
u32CvtShim[0] = r0;
|
|
799
|
-
u32CvtShim[1] = r1;
|
|
800
|
-
const n0 = int64CvtShim[0];
|
|
801
|
-
return n0;
|
|
802
|
-
} finally {
|
|
803
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
804
|
-
}
|
|
805
|
-
}
|
|
806
|
-
/**
|
|
807
|
-
* @returns {string}
|
|
808
|
-
*/
|
|
809
|
-
pathInSchema() {
|
|
810
|
-
try {
|
|
811
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
812
|
-
wasm.columnchunkmetadata_pathInSchema(retptr, this.ptr);
|
|
813
|
-
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
814
|
-
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
815
|
-
return getStringFromWasm0(r0, r1);
|
|
816
|
-
} finally {
|
|
817
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
818
|
-
wasm.__wbindgen_free(r0, r1);
|
|
819
|
-
}
|
|
820
|
-
}
|
|
821
|
-
/**
|
|
822
|
-
* @returns {boolean}
|
|
823
|
-
*/
|
|
824
|
-
statistics_exist() {
|
|
825
|
-
try {
|
|
826
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
827
|
-
wasm.columnchunkmetadata_statistics_exist(retptr, this.ptr);
|
|
828
|
-
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
829
|
-
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
830
|
-
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
831
|
-
if (r2) {
|
|
832
|
-
throw takeObject(r1);
|
|
833
|
-
}
|
|
834
|
-
return r0 !== 0;
|
|
835
|
-
} finally {
|
|
836
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
837
|
-
}
|
|
838
|
-
}
|
|
839
|
-
/**
|
|
840
|
-
* @returns {any}
|
|
841
|
-
*/
|
|
842
|
-
getStatisticsMinValue() {
|
|
843
|
-
try {
|
|
844
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
845
|
-
wasm.columnchunkmetadata_getStatisticsMinValue(retptr, this.ptr);
|
|
846
|
-
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
847
|
-
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
848
|
-
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
849
|
-
if (r2) {
|
|
850
|
-
throw takeObject(r1);
|
|
851
|
-
}
|
|
852
|
-
return takeObject(r0);
|
|
853
|
-
} finally {
|
|
854
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
855
|
-
}
|
|
856
|
-
}
|
|
857
|
-
/**
|
|
858
|
-
* @returns {any}
|
|
859
|
-
*/
|
|
860
|
-
getStatisticsMaxValue() {
|
|
861
|
-
try {
|
|
862
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
863
|
-
wasm.columnchunkmetadata_getStatisticsMaxValue(retptr, this.ptr);
|
|
864
|
-
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
865
|
-
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
866
|
-
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
867
|
-
if (r2) {
|
|
868
|
-
throw takeObject(r1);
|
|
869
|
-
}
|
|
870
|
-
return takeObject(r0);
|
|
871
|
-
} finally {
|
|
872
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
873
|
-
}
|
|
874
|
-
}
|
|
875
|
-
/**
|
|
876
|
-
* @returns {any}
|
|
877
|
-
*/
|
|
878
|
-
getStatisticsNullCount() {
|
|
879
|
-
try {
|
|
880
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
881
|
-
wasm.columnchunkmetadata_getStatisticsNullCount(retptr, this.ptr);
|
|
882
|
-
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
883
|
-
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
884
|
-
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
885
|
-
if (r2) {
|
|
886
|
-
throw takeObject(r1);
|
|
887
|
-
}
|
|
888
|
-
return takeObject(r0);
|
|
889
|
-
} finally {
|
|
890
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
891
|
-
}
|
|
892
|
-
}
|
|
893
|
-
/**
|
|
894
|
-
* Total number of values in this column chunk. Note that this is not necessarily the number
|
|
895
|
-
* of rows. E.g. the (nested) array `[[1, 2], [3]]` has 2 rows and 3 values.
|
|
896
|
-
* @returns {bigint}
|
|
897
|
-
*/
|
|
898
|
-
numValues() {
|
|
899
|
-
try {
|
|
900
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
901
|
-
wasm.columnchunkmetadata_numValues(retptr, this.ptr);
|
|
902
|
-
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
903
|
-
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
904
|
-
u32CvtShim[0] = r0;
|
|
905
|
-
u32CvtShim[1] = r1;
|
|
906
|
-
const n0 = int64CvtShim[0];
|
|
907
|
-
return n0;
|
|
908
|
-
} finally {
|
|
909
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
910
|
-
}
|
|
911
|
-
}
|
|
912
|
-
/**
|
|
913
|
-
* Returns the total compressed data size of this column chunk.
|
|
914
|
-
* @returns {bigint}
|
|
915
|
-
*/
|
|
916
|
-
compressedSize() {
|
|
917
|
-
try {
|
|
918
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
919
|
-
wasm.columnchunkmetadata_compressedSize(retptr, this.ptr);
|
|
920
|
-
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
921
|
-
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
922
|
-
u32CvtShim[0] = r0;
|
|
923
|
-
u32CvtShim[1] = r1;
|
|
924
|
-
const n0 = int64CvtShim[0];
|
|
925
|
-
return n0;
|
|
926
|
-
} finally {
|
|
927
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
928
|
-
}
|
|
929
|
-
}
|
|
930
|
-
/**
|
|
931
|
-
* Returns the total uncompressed data size of this column chunk.
|
|
932
|
-
* @returns {bigint}
|
|
933
|
-
*/
|
|
934
|
-
uncompressedSize() {
|
|
935
|
-
try {
|
|
936
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
937
|
-
wasm.columnchunkmetadata_uncompressedSize(retptr, this.ptr);
|
|
938
|
-
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
939
|
-
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
940
|
-
u32CvtShim[0] = r0;
|
|
941
|
-
u32CvtShim[1] = r1;
|
|
942
|
-
const n0 = int64CvtShim[0];
|
|
943
|
-
return n0;
|
|
944
|
-
} finally {
|
|
945
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
946
|
-
}
|
|
947
|
-
}
|
|
948
|
-
/**
|
|
949
|
-
* Returns the offset for the column data.
|
|
950
|
-
* @returns {bigint}
|
|
951
|
-
*/
|
|
952
|
-
dataPageOffset() {
|
|
953
|
-
try {
|
|
954
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
955
|
-
wasm.columnchunkmetadata_dataPageOffset(retptr, this.ptr);
|
|
956
|
-
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
957
|
-
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
958
|
-
u32CvtShim[0] = r0;
|
|
959
|
-
u32CvtShim[1] = r1;
|
|
960
|
-
const n0 = int64CvtShim[0];
|
|
961
|
-
return n0;
|
|
962
|
-
} finally {
|
|
963
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
964
|
-
}
|
|
965
|
-
}
|
|
966
|
-
/**
|
|
967
|
-
* Returns `true` if this column chunk contains a index page, `false` otherwise.
|
|
968
|
-
* @returns {boolean}
|
|
969
|
-
*/
|
|
970
|
-
hasIndexPage() {
|
|
971
|
-
const ret = wasm.columnchunkmetadata_hasIndexPage(this.ptr);
|
|
972
|
-
return ret !== 0;
|
|
973
|
-
}
|
|
974
|
-
/**
|
|
975
|
-
* Returns the offset for the index page.
|
|
976
|
-
* @returns {bigint | undefined}
|
|
977
|
-
*/
|
|
978
|
-
indexPageOffset() {
|
|
979
|
-
try {
|
|
980
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
981
|
-
wasm.columnchunkmetadata_indexPageOffset(retptr, this.ptr);
|
|
982
|
-
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
983
|
-
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
984
|
-
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
985
|
-
u32CvtShim[0] = r1;
|
|
986
|
-
u32CvtShim[1] = r2;
|
|
987
|
-
const n0 = r0 === 0 ? undefined : int64CvtShim[0];
|
|
988
|
-
return n0;
|
|
989
|
-
} finally {
|
|
990
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
991
|
-
}
|
|
992
|
-
}
|
|
993
|
-
/**
|
|
994
|
-
* Returns the offset for the dictionary page, if any.
|
|
995
|
-
* @returns {bigint | undefined}
|
|
996
|
-
*/
|
|
997
|
-
dictionaryPageOffset() {
|
|
998
|
-
try {
|
|
999
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1000
|
-
wasm.columnchunkmetadata_dictionaryPageOffset(retptr, this.ptr);
|
|
1001
|
-
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
1002
|
-
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
1003
|
-
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
1004
|
-
u32CvtShim[0] = r1;
|
|
1005
|
-
u32CvtShim[1] = r2;
|
|
1006
|
-
const n0 = r0 === 0 ? undefined : int64CvtShim[0];
|
|
1007
|
-
return n0;
|
|
1008
|
-
} finally {
|
|
1009
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1010
|
-
}
|
|
1011
|
-
}
|
|
1012
|
-
/**
|
|
1013
|
-
* Returns the number of encodings for this column
|
|
1014
|
-
* @returns {number}
|
|
1015
|
-
*/
|
|
1016
|
-
numColumnEncodings() {
|
|
1017
|
-
const ret = wasm.columnchunkmetadata_numColumnEncodings(this.ptr);
|
|
1018
|
-
return ret >>> 0;
|
|
1019
|
-
}
|
|
1020
|
-
/**
|
|
1021
|
-
* Returns the offset and length in bytes of the column chunk within the file
|
|
1022
|
-
* @returns {BigUint64Array}
|
|
1023
|
-
*/
|
|
1024
|
-
byteRange() {
|
|
1025
|
-
try {
|
|
1026
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1027
|
-
wasm.columnchunkmetadata_byteRange(retptr, this.ptr);
|
|
1028
|
-
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
1029
|
-
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
1030
|
-
var v0 = getArrayU64FromWasm0(r0, r1).slice();
|
|
1031
|
-
wasm.__wbindgen_free(r0, r1 * 8);
|
|
1032
|
-
return v0;
|
|
1033
|
-
} finally {
|
|
1034
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1035
|
-
}
|
|
1036
|
-
}
|
|
1037
|
-
}
|
|
1038
|
-
/**
|
|
1039
|
-
* Wrapper around an ArrowArray FFI struct in Wasm memory.
|
|
1040
|
-
*/
|
|
1041
|
-
export class FFIArrowArray {
|
|
1042
|
-
|
|
1043
|
-
__destroy_into_raw() {
|
|
1044
|
-
const ptr = this.ptr;
|
|
1045
|
-
this.ptr = 0;
|
|
1046
|
-
|
|
1047
|
-
return ptr;
|
|
1048
|
-
}
|
|
1049
|
-
|
|
1050
|
-
free() {
|
|
1051
|
-
const ptr = this.__destroy_into_raw();
|
|
1052
|
-
wasm.__wbg_ffiarrowarray_free(ptr);
|
|
1053
|
-
}
|
|
1054
|
-
/**
|
|
1055
|
-
* @returns {number}
|
|
1056
|
-
*/
|
|
1057
|
-
addr() {
|
|
1058
|
-
const ret = wasm.ffiarrowarray_addr(this.ptr);
|
|
1059
|
-
return ret;
|
|
1060
|
-
}
|
|
1061
|
-
/**
|
|
1062
|
-
*/
|
|
1063
|
-
// commented out becuase of
|
|
1064
|
-
// [WARNING] Duplicate member "free" in class body [duplicate-class-member]
|
|
1065
|
-
// free() {
|
|
1066
|
-
// const ptr = this.__destroy_into_raw();
|
|
1067
|
-
// wasm.ffiarrowarray_free(ptr);
|
|
1068
|
-
// }
|
|
1069
|
-
/**
|
|
1070
|
-
*/
|
|
1071
|
-
drop() {
|
|
1072
|
-
const ptr = this.__destroy_into_raw();
|
|
1073
|
-
wasm.ffiarrowarray_drop(ptr);
|
|
1074
|
-
}
|
|
1075
|
-
}
|
|
1076
|
-
/**
|
|
1077
|
-
* Wrapper to represent an Arrow Chunk in Wasm memory, e.g. a collection of FFI ArrowArray
|
|
1078
|
-
* structs
|
|
1079
|
-
*/
|
|
1080
|
-
export class FFIArrowChunk {
|
|
1081
|
-
|
|
1082
|
-
__destroy_into_raw() {
|
|
1083
|
-
const ptr = this.ptr;
|
|
1084
|
-
this.ptr = 0;
|
|
1085
|
-
|
|
1086
|
-
return ptr;
|
|
1087
|
-
}
|
|
1088
|
-
|
|
1089
|
-
free() {
|
|
1090
|
-
const ptr = this.__destroy_into_raw();
|
|
1091
|
-
wasm.__wbg_ffiarrowchunk_free(ptr);
|
|
1092
|
-
}
|
|
1093
|
-
/**
|
|
1094
|
-
* @returns {number}
|
|
1095
|
-
*/
|
|
1096
|
-
length() {
|
|
1097
|
-
const ret = wasm.ffiarrowchunk_length(this.ptr);
|
|
1098
|
-
return ret >>> 0;
|
|
1099
|
-
}
|
|
1100
|
-
/**
|
|
1101
|
-
* @param {number} i
|
|
1102
|
-
* @returns {number}
|
|
1103
|
-
*/
|
|
1104
|
-
addr(i) {
|
|
1105
|
-
const ret = wasm.ffiarrowchunk_addr(this.ptr, i);
|
|
1106
|
-
return ret;
|
|
1107
|
-
}
|
|
1108
|
-
}
|
|
1109
|
-
/**
|
|
1110
|
-
* Wrapper around an ArrowSchema FFI struct in Wasm memory.
|
|
1111
|
-
*/
|
|
1112
|
-
export class FFIArrowField {
|
|
1113
|
-
|
|
1114
|
-
__destroy_into_raw() {
|
|
1115
|
-
const ptr = this.ptr;
|
|
1116
|
-
this.ptr = 0;
|
|
1117
|
-
|
|
1118
|
-
return ptr;
|
|
1119
|
-
}
|
|
1120
|
-
|
|
1121
|
-
free() {
|
|
1122
|
-
const ptr = this.__destroy_into_raw();
|
|
1123
|
-
wasm.__wbg_ffiarrowfield_free(ptr);
|
|
1124
|
-
}
|
|
1125
|
-
/**
|
|
1126
|
-
* @returns {number}
|
|
1127
|
-
*/
|
|
1128
|
-
addr() {
|
|
1129
|
-
const ret = wasm.ffiarrowfield_addr(this.ptr);
|
|
1130
|
-
return ret;
|
|
1131
|
-
}
|
|
1132
|
-
}
|
|
1133
|
-
/**
|
|
1134
|
-
* Wrapper around a collection of FFI ArrowSchema structs in Wasm memory
|
|
1135
|
-
*/
|
|
1136
|
-
export class FFIArrowSchema {
|
|
1137
|
-
|
|
1138
|
-
__destroy_into_raw() {
|
|
1139
|
-
const ptr = this.ptr;
|
|
1140
|
-
this.ptr = 0;
|
|
1141
|
-
|
|
1142
|
-
return ptr;
|
|
1143
|
-
}
|
|
1144
|
-
|
|
1145
|
-
free() {
|
|
1146
|
-
const ptr = this.__destroy_into_raw();
|
|
1147
|
-
wasm.__wbg_ffiarrowschema_free(ptr);
|
|
1148
|
-
}
|
|
1149
|
-
/**
|
|
1150
|
-
* @returns {number}
|
|
1151
|
-
*/
|
|
1152
|
-
length() {
|
|
1153
|
-
const ret = wasm.ffiarrowschema_length(this.ptr);
|
|
1154
|
-
return ret >>> 0;
|
|
1155
|
-
}
|
|
1156
|
-
/**
|
|
1157
|
-
* @param {number} i
|
|
1158
|
-
* @returns {number}
|
|
1159
|
-
*/
|
|
1160
|
-
addr(i) {
|
|
1161
|
-
const ret = wasm.ffiarrowschema_addr(this.ptr, i);
|
|
1162
|
-
return ret;
|
|
1163
|
-
}
|
|
1164
|
-
}
|
|
1165
|
-
/**
|
|
1166
|
-
* Wrapper around an Arrow Table in Wasm memory (a lisjst of FFI ArrowSchema structs plus a list of
|
|
1167
|
-
* lists of ArrowArray FFI structs.)
|
|
1168
|
-
*/
|
|
1169
|
-
export class FFIArrowTable {
|
|
1170
|
-
|
|
1171
|
-
static __wrap(ptr) {
|
|
1172
|
-
const obj = Object.create(FFIArrowTable.prototype);
|
|
1173
|
-
obj.ptr = ptr;
|
|
1174
|
-
|
|
1175
|
-
return obj;
|
|
1176
|
-
}
|
|
1177
|
-
|
|
1178
|
-
__destroy_into_raw() {
|
|
1179
|
-
const ptr = this.ptr;
|
|
1180
|
-
this.ptr = 0;
|
|
1181
|
-
|
|
1182
|
-
return ptr;
|
|
1183
|
-
}
|
|
1184
|
-
|
|
1185
|
-
free() {
|
|
1186
|
-
const ptr = this.__destroy_into_raw();
|
|
1187
|
-
wasm.__wbg_ffiarrowtable_free(ptr);
|
|
1188
|
-
}
|
|
1189
|
-
/**
|
|
1190
|
-
* Get the number of Fields in the table schema
|
|
1191
|
-
* @returns {number}
|
|
1192
|
-
*/
|
|
1193
|
-
schemaLength() {
|
|
1194
|
-
const ret = wasm.ffiarrowtable_schemaLength(this.ptr);
|
|
1195
|
-
return ret >>> 0;
|
|
1196
|
-
}
|
|
1197
|
-
/**
|
|
1198
|
-
* Get the pointer to one ArrowSchema FFI struct
|
|
1199
|
-
* @param i number the index of the field in the schema to use
|
|
1200
|
-
* @param {number} i
|
|
1201
|
-
* @returns {number}
|
|
1202
|
-
*/
|
|
1203
|
-
schemaAddr(i) {
|
|
1204
|
-
const ret = wasm.ffiarrowtable_schemaAddr(this.ptr, i);
|
|
1205
|
-
return ret;
|
|
1206
|
-
}
|
|
1207
|
-
/**
|
|
1208
|
-
* Get the total number of chunks in the table
|
|
1209
|
-
* @returns {number}
|
|
1210
|
-
*/
|
|
1211
|
-
chunksLength() {
|
|
1212
|
-
const ret = wasm.ffiarrowtable_chunksLength(this.ptr);
|
|
1213
|
-
return ret >>> 0;
|
|
1214
|
-
}
|
|
1215
|
-
/**
|
|
1216
|
-
* Get the number of columns in a given chunk
|
|
1217
|
-
* @param {number} i
|
|
1218
|
-
* @returns {number}
|
|
1219
|
-
*/
|
|
1220
|
-
chunkLength(i) {
|
|
1221
|
-
const ret = wasm.ffiarrowtable_chunkLength(this.ptr, i);
|
|
1222
|
-
return ret >>> 0;
|
|
1223
|
-
}
|
|
1224
|
-
/**
|
|
1225
|
-
* Get the pointer to one ArrowArray FFI struct for a given chunk index and column index
|
|
1226
|
-
* @param chunk number The chunk index to use
|
|
1227
|
-
* @param column number The column index to use
|
|
1228
|
-
* @returns number pointer to an ArrowArray FFI struct in Wasm memory
|
|
1229
|
-
* @param {number} chunk
|
|
1230
|
-
* @param {number} column
|
|
1231
|
-
* @returns {number}
|
|
1232
|
-
*/
|
|
1233
|
-
arrayAddr(chunk, column) {
|
|
1234
|
-
const ret = wasm.ffiarrowtable_arrayAddr(this.ptr, chunk, column);
|
|
1235
|
-
return ret;
|
|
1236
|
-
}
|
|
1237
|
-
/**
|
|
1238
|
-
*/
|
|
1239
|
-
drop() {
|
|
1240
|
-
const ptr = this.__destroy_into_raw();
|
|
1241
|
-
wasm.ffiarrowtable_drop(ptr);
|
|
1242
|
-
}
|
|
1243
|
-
}
|
|
1244
|
-
/**
|
|
1245
|
-
* Metadata for a Parquet file.
|
|
1246
|
-
*/
|
|
1247
|
-
export class FileMetaData {
|
|
1248
|
-
|
|
1249
|
-
static __wrap(ptr) {
|
|
1250
|
-
const obj = Object.create(FileMetaData.prototype);
|
|
1251
|
-
obj.ptr = ptr;
|
|
1252
|
-
|
|
1253
|
-
return obj;
|
|
1254
|
-
}
|
|
1255
|
-
|
|
1256
|
-
__destroy_into_raw() {
|
|
1257
|
-
const ptr = this.ptr;
|
|
1258
|
-
this.ptr = 0;
|
|
1259
|
-
|
|
1260
|
-
return ptr;
|
|
1261
|
-
}
|
|
1262
|
-
|
|
1263
|
-
free() {
|
|
1264
|
-
const ptr = this.__destroy_into_raw();
|
|
1265
|
-
wasm.__wbg_filemetadata_free(ptr);
|
|
1266
|
-
}
|
|
1267
|
-
/**
|
|
1268
|
-
* Clone this struct in wasm memory.
|
|
1269
|
-
* @returns {FileMetaData}
|
|
1270
|
-
*/
|
|
1271
|
-
copy() {
|
|
1272
|
-
const ret = wasm.filemetadata_copy(this.ptr);
|
|
1273
|
-
return FileMetaData.__wrap(ret);
|
|
1274
|
-
}
|
|
1275
|
-
/**
|
|
1276
|
-
* Version of this file.
|
|
1277
|
-
* @returns {number}
|
|
1278
|
-
*/
|
|
1279
|
-
version() {
|
|
1280
|
-
const ret = wasm.filemetadata_version(this.ptr);
|
|
1281
|
-
return ret;
|
|
1282
|
-
}
|
|
1283
|
-
/**
|
|
1284
|
-
* number of rows in the file.
|
|
1285
|
-
* @returns {number}
|
|
1286
|
-
*/
|
|
1287
|
-
numRows() {
|
|
1288
|
-
const ret = wasm.filemetadata_numRows(this.ptr);
|
|
1289
|
-
return ret >>> 0;
|
|
1290
|
-
}
|
|
1291
|
-
/**
|
|
1292
|
-
* String message for application that wrote this file.
|
|
1293
|
-
* @returns {string | undefined}
|
|
1294
|
-
*/
|
|
1295
|
-
createdBy() {
|
|
1296
|
-
try {
|
|
1297
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1298
|
-
wasm.filemetadata_createdBy(retptr, this.ptr);
|
|
1299
|
-
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
1300
|
-
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
1301
|
-
let v0;
|
|
1302
|
-
if (r0 !== 0) {
|
|
1303
|
-
v0 = getStringFromWasm0(r0, r1).slice();
|
|
1304
|
-
wasm.__wbindgen_free(r0, r1 * 1);
|
|
1305
|
-
}
|
|
1306
|
-
return v0;
|
|
1307
|
-
} finally {
|
|
1308
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1309
|
-
}
|
|
1310
|
-
}
|
|
1311
|
-
/**
|
|
1312
|
-
* Number of row groups in the file
|
|
1313
|
-
* @returns {number}
|
|
1314
|
-
*/
|
|
1315
|
-
numRowGroups() {
|
|
1316
|
-
const ret = wasm.filemetadata_numRowGroups(this.ptr);
|
|
1317
|
-
return ret >>> 0;
|
|
1318
|
-
}
|
|
1319
|
-
/**
|
|
1320
|
-
* Returns a single RowGroupMetaData by index
|
|
1321
|
-
* @param {number} i
|
|
1322
|
-
* @returns {RowGroupMetaData}
|
|
1323
|
-
*/
|
|
1324
|
-
rowGroup(i) {
|
|
1325
|
-
const ret = wasm.filemetadata_rowGroup(this.ptr, i);
|
|
1326
|
-
return RowGroupMetaData.__wrap(ret);
|
|
1327
|
-
}
|
|
1328
|
-
/**
|
|
1329
|
-
* @returns {SchemaDescriptor}
|
|
1330
|
-
*/
|
|
1331
|
-
schema() {
|
|
1332
|
-
const ret = wasm.filemetadata_schema(this.ptr);
|
|
1333
|
-
return SchemaDescriptor.__wrap(ret);
|
|
1334
|
-
}
|
|
1335
|
-
/**
|
|
1336
|
-
* @returns {any}
|
|
1337
|
-
*/
|
|
1338
|
-
keyValueMetadata() {
|
|
1339
|
-
try {
|
|
1340
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1341
|
-
wasm.filemetadata_keyValueMetadata(retptr, this.ptr);
|
|
1342
|
-
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
1343
|
-
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
1344
|
-
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
1345
|
-
if (r2) {
|
|
1346
|
-
throw takeObject(r1);
|
|
1347
|
-
}
|
|
1348
|
-
return takeObject(r0);
|
|
1349
|
-
} finally {
|
|
1350
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1351
|
-
}
|
|
1352
|
-
}
|
|
1353
|
-
/**
|
|
1354
|
-
* @returns {ArrowSchema}
|
|
1355
|
-
*/
|
|
1356
|
-
arrowSchema() {
|
|
1357
|
-
try {
|
|
1358
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1359
|
-
wasm.filemetadata_arrowSchema(retptr, this.ptr);
|
|
1360
|
-
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
1361
|
-
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
1362
|
-
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
1363
|
-
if (r2) {
|
|
1364
|
-
throw takeObject(r1);
|
|
1365
|
-
}
|
|
1366
|
-
return ArrowSchema.__wrap(r0);
|
|
1367
|
-
} finally {
|
|
1368
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1369
|
-
}
|
|
1370
|
-
}
|
|
1371
|
-
}
|
|
1372
|
-
/**
|
|
1373
|
-
* Metadata for a row group.
|
|
1374
|
-
*/
|
|
1375
|
-
export class RowGroupMetaData {
|
|
1376
|
-
|
|
1377
|
-
static __wrap(ptr) {
|
|
1378
|
-
const obj = Object.create(RowGroupMetaData.prototype);
|
|
1379
|
-
obj.ptr = ptr;
|
|
1380
|
-
|
|
1381
|
-
return obj;
|
|
1382
|
-
}
|
|
1383
|
-
|
|
1384
|
-
__destroy_into_raw() {
|
|
1385
|
-
const ptr = this.ptr;
|
|
1386
|
-
this.ptr = 0;
|
|
1387
|
-
|
|
1388
|
-
return ptr;
|
|
1389
|
-
}
|
|
1390
|
-
|
|
1391
|
-
free() {
|
|
1392
|
-
const ptr = this.__destroy_into_raw();
|
|
1393
|
-
wasm.__wbg_rowgroupmetadata_free(ptr);
|
|
1394
|
-
}
|
|
1395
|
-
/**
|
|
1396
|
-
* Number of rows in this row group.
|
|
1397
|
-
* @returns {number}
|
|
1398
|
-
*/
|
|
1399
|
-
numRows() {
|
|
1400
|
-
const ret = wasm.rowgroupmetadata_numRows(this.ptr);
|
|
1401
|
-
return ret >>> 0;
|
|
1402
|
-
}
|
|
1403
|
-
/**
|
|
1404
|
-
* Number of columns in this row group.
|
|
1405
|
-
* @returns {number}
|
|
1406
|
-
*/
|
|
1407
|
-
numColumns() {
|
|
1408
|
-
const ret = wasm.rowgroupmetadata_numColumns(this.ptr);
|
|
1409
|
-
return ret >>> 0;
|
|
1410
|
-
}
|
|
1411
|
-
/**
|
|
1412
|
-
* Returns a single column chunk metadata by index
|
|
1413
|
-
* @param {number} i
|
|
1414
|
-
* @returns {ColumnChunkMetaData}
|
|
1415
|
-
*/
|
|
1416
|
-
column(i) {
|
|
1417
|
-
const ret = wasm.rowgroupmetadata_column(this.ptr, i);
|
|
1418
|
-
return ColumnChunkMetaData.__wrap(ret);
|
|
1419
|
-
}
|
|
1420
|
-
/**
|
|
1421
|
-
* Total byte size of all uncompressed column data in this row group.
|
|
1422
|
-
* @returns {number}
|
|
1423
|
-
*/
|
|
1424
|
-
totalByteSize() {
|
|
1425
|
-
const ret = wasm.rowgroupmetadata_totalByteSize(this.ptr);
|
|
1426
|
-
return ret >>> 0;
|
|
1427
|
-
}
|
|
1428
|
-
/**
|
|
1429
|
-
* Total size of all compressed column data in this row group.
|
|
1430
|
-
* @returns {number}
|
|
1431
|
-
*/
|
|
1432
|
-
compressedSize() {
|
|
1433
|
-
const ret = wasm.rowgroupmetadata_compressedSize(this.ptr);
|
|
1434
|
-
return ret >>> 0;
|
|
1435
|
-
}
|
|
1436
|
-
}
|
|
1437
|
-
/**
|
|
1438
|
-
* A schema descriptor. This encapsulates the top-level schemas for all the columns,
|
|
1439
|
-
* as well as all descriptors for all the primitive columns.
|
|
1440
|
-
*/
|
|
1441
|
-
export class SchemaDescriptor {
|
|
1442
|
-
|
|
1443
|
-
static __wrap(ptr) {
|
|
1444
|
-
const obj = Object.create(SchemaDescriptor.prototype);
|
|
1445
|
-
obj.ptr = ptr;
|
|
1446
|
-
|
|
1447
|
-
return obj;
|
|
1448
|
-
}
|
|
1449
|
-
|
|
1450
|
-
__destroy_into_raw() {
|
|
1451
|
-
const ptr = this.ptr;
|
|
1452
|
-
this.ptr = 0;
|
|
1453
|
-
|
|
1454
|
-
return ptr;
|
|
1455
|
-
}
|
|
1456
|
-
|
|
1457
|
-
free() {
|
|
1458
|
-
const ptr = this.__destroy_into_raw();
|
|
1459
|
-
wasm.__wbg_schemadescriptor_free(ptr);
|
|
1460
|
-
}
|
|
1461
|
-
/**
|
|
1462
|
-
* The schemas' name.
|
|
1463
|
-
* @returns {string}
|
|
1464
|
-
*/
|
|
1465
|
-
name() {
|
|
1466
|
-
try {
|
|
1467
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1468
|
-
wasm.schemadescriptor_name(retptr, this.ptr);
|
|
1469
|
-
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
1470
|
-
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
1471
|
-
return getStringFromWasm0(r0, r1);
|
|
1472
|
-
} finally {
|
|
1473
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1474
|
-
wasm.__wbindgen_free(r0, r1);
|
|
1475
|
-
}
|
|
1476
|
-
}
|
|
1477
|
-
/**
|
|
1478
|
-
* The number of columns in the schema
|
|
1479
|
-
* @returns {number}
|
|
1480
|
-
*/
|
|
1481
|
-
numColumns() {
|
|
1482
|
-
const ret = wasm.schemadescriptor_numColumns(this.ptr);
|
|
1483
|
-
return ret >>> 0;
|
|
1484
|
-
}
|
|
1485
|
-
/**
|
|
1486
|
-
* The number of fields in the schema
|
|
1487
|
-
* @returns {number}
|
|
1488
|
-
*/
|
|
1489
|
-
numFields() {
|
|
1490
|
-
const ret = wasm.schemadescriptor_numFields(this.ptr);
|
|
1491
|
-
return ret >>> 0;
|
|
1492
|
-
}
|
|
1493
|
-
}
|
|
1494
|
-
/**
|
|
1495
|
-
* Immutable struct to hold writing configuration for `writeParquet2`.
|
|
1496
|
-
*
|
|
1497
|
-
* Use {@linkcode WriterPropertiesBuilder} to create a configuration, then call {@linkcode
|
|
1498
|
-
* WriterPropertiesBuilder.build} to create an instance of `WriterProperties`.
|
|
1499
|
-
*/
|
|
1500
|
-
export class WriterProperties {
|
|
1501
|
-
|
|
1502
|
-
static __wrap(ptr) {
|
|
1503
|
-
const obj = Object.create(WriterProperties.prototype);
|
|
1504
|
-
obj.ptr = ptr;
|
|
1505
|
-
|
|
1506
|
-
return obj;
|
|
1507
|
-
}
|
|
1508
|
-
|
|
1509
|
-
__destroy_into_raw() {
|
|
1510
|
-
const ptr = this.ptr;
|
|
1511
|
-
this.ptr = 0;
|
|
1512
|
-
|
|
1513
|
-
return ptr;
|
|
1514
|
-
}
|
|
1515
|
-
|
|
1516
|
-
free() {
|
|
1517
|
-
const ptr = this.__destroy_into_raw();
|
|
1518
|
-
wasm.__wbg_writerproperties_free(ptr);
|
|
1519
|
-
}
|
|
1520
|
-
}
|
|
1521
|
-
/**
|
|
1522
|
-
* Builder to create a writing configuration for `writeParquet2`
|
|
1523
|
-
*
|
|
1524
|
-
* Call {@linkcode build} on the finished builder to create an immputable {@linkcode WriterProperties} to pass to `writeParquet2`
|
|
1525
|
-
*/
|
|
1526
|
-
export class WriterPropertiesBuilder {
|
|
1527
|
-
|
|
1528
|
-
static __wrap(ptr) {
|
|
1529
|
-
const obj = Object.create(WriterPropertiesBuilder.prototype);
|
|
1530
|
-
obj.ptr = ptr;
|
|
1531
|
-
|
|
1532
|
-
return obj;
|
|
1533
|
-
}
|
|
1534
|
-
|
|
1535
|
-
__destroy_into_raw() {
|
|
1536
|
-
const ptr = this.ptr;
|
|
1537
|
-
this.ptr = 0;
|
|
1538
|
-
|
|
1539
|
-
return ptr;
|
|
1540
|
-
}
|
|
1541
|
-
|
|
1542
|
-
free() {
|
|
1543
|
-
const ptr = this.__destroy_into_raw();
|
|
1544
|
-
wasm.__wbg_writerpropertiesbuilder_free(ptr);
|
|
1545
|
-
}
|
|
1546
|
-
/**
|
|
1547
|
-
* Returns default state of the builder.
|
|
1548
|
-
*/
|
|
1549
|
-
constructor() {
|
|
1550
|
-
const ret = wasm.writerpropertiesbuilder_new();
|
|
1551
|
-
return WriterPropertiesBuilder.__wrap(ret);
|
|
1552
|
-
}
|
|
1553
|
-
/**
|
|
1554
|
-
* Finalizes the configuration and returns immutable writer properties struct.
|
|
1555
|
-
* @returns {WriterProperties}
|
|
1556
|
-
*/
|
|
1557
|
-
build() {
|
|
1558
|
-
const ptr = this.__destroy_into_raw();
|
|
1559
|
-
const ret = wasm.writerpropertiesbuilder_build(ptr);
|
|
1560
|
-
return WriterProperties.__wrap(ret);
|
|
1561
|
-
}
|
|
1562
|
-
/**
|
|
1563
|
-
* Sets writer version.
|
|
1564
|
-
* @param {number} value
|
|
1565
|
-
* @returns {WriterPropertiesBuilder}
|
|
1566
|
-
*/
|
|
1567
|
-
setWriterVersion(value) {
|
|
1568
|
-
const ptr = this.__destroy_into_raw();
|
|
1569
|
-
const ret = wasm.writerpropertiesbuilder_setWriterVersion(ptr, value);
|
|
1570
|
-
return WriterPropertiesBuilder.__wrap(ret);
|
|
1571
|
-
}
|
|
1572
|
-
/**
|
|
1573
|
-
* Sets encoding for any column.
|
|
1574
|
-
*
|
|
1575
|
-
* If dictionary is not enabled, this is treated as a primary encoding for all
|
|
1576
|
-
* columns. In case when dictionary is enabled for any column, this value is
|
|
1577
|
-
* considered to be a fallback encoding for that column.
|
|
1578
|
-
*
|
|
1579
|
-
* Panics if user tries to set dictionary encoding here, regardless of dictionary
|
|
1580
|
-
* encoding flag being set.
|
|
1581
|
-
* @param {number} value
|
|
1582
|
-
* @returns {WriterPropertiesBuilder}
|
|
1583
|
-
*/
|
|
1584
|
-
setEncoding(value) {
|
|
1585
|
-
const ptr = this.__destroy_into_raw();
|
|
1586
|
-
const ret = wasm.writerpropertiesbuilder_setEncoding(ptr, value);
|
|
1587
|
-
return WriterPropertiesBuilder.__wrap(ret);
|
|
1588
|
-
}
|
|
1589
|
-
/**
|
|
1590
|
-
* Sets compression codec for any column.
|
|
1591
|
-
* @param {number} value
|
|
1592
|
-
* @returns {WriterPropertiesBuilder}
|
|
1593
|
-
*/
|
|
1594
|
-
setCompression(value) {
|
|
1595
|
-
const ptr = this.__destroy_into_raw();
|
|
1596
|
-
const ret = wasm.writerpropertiesbuilder_setCompression(ptr, value);
|
|
1597
|
-
return WriterPropertiesBuilder.__wrap(ret);
|
|
1598
|
-
}
|
|
1599
|
-
/**
|
|
1600
|
-
* Sets flag to enable/disable statistics for any column.
|
|
1601
|
-
* @param {boolean} value
|
|
1602
|
-
* @returns {WriterPropertiesBuilder}
|
|
1603
|
-
*/
|
|
1604
|
-
setStatisticsEnabled(value) {
|
|
1605
|
-
const ptr = this.__destroy_into_raw();
|
|
1606
|
-
const ret = wasm.writerpropertiesbuilder_setStatisticsEnabled(ptr, value);
|
|
1607
|
-
return WriterPropertiesBuilder.__wrap(ret);
|
|
1608
|
-
}
|
|
1609
|
-
}
|
|
1610
|
-
|
|
1611
|
-
async function load(module, imports) {
|
|
1612
|
-
if (typeof Response === 'function' && module instanceof Response) {
|
|
1613
|
-
if (typeof WebAssembly.instantiateStreaming === 'function') {
|
|
1614
|
-
try {
|
|
1615
|
-
return await WebAssembly.instantiateStreaming(module, imports);
|
|
1616
|
-
|
|
1617
|
-
} catch (e) {
|
|
1618
|
-
if (module.headers.get('Content-Type') != 'application/wasm') {
|
|
1619
|
-
console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n", e);
|
|
1620
|
-
|
|
1621
|
-
} else {
|
|
1622
|
-
throw e;
|
|
1623
|
-
}
|
|
1624
|
-
}
|
|
1625
|
-
}
|
|
1626
|
-
|
|
1627
|
-
const bytes = await module.arrayBuffer();
|
|
1628
|
-
return await WebAssembly.instantiate(bytes, imports);
|
|
1629
|
-
|
|
1630
|
-
} else {
|
|
1631
|
-
const instance = await WebAssembly.instantiate(module, imports);
|
|
1632
|
-
|
|
1633
|
-
if (instance instanceof WebAssembly.Instance) {
|
|
1634
|
-
return { instance, module };
|
|
1635
|
-
|
|
1636
|
-
} else {
|
|
1637
|
-
return instance;
|
|
1638
|
-
}
|
|
1639
|
-
}
|
|
1640
|
-
}
|
|
1641
|
-
|
|
1642
|
-
function getImports() {
|
|
1643
|
-
const imports = {};
|
|
1644
|
-
imports.wbg = {};
|
|
1645
|
-
imports.wbg.__wbg_filemetadata_new = function(arg0) {
|
|
1646
|
-
const ret = FileMetaData.__wrap(arg0);
|
|
1647
|
-
return addHeapObject(ret);
|
|
1648
|
-
};
|
|
1649
|
-
imports.wbg.__wbindgen_string_new = function(arg0, arg1) {
|
|
1650
|
-
const ret = getStringFromWasm0(arg0, arg1);
|
|
1651
|
-
return addHeapObject(ret);
|
|
1652
|
-
};
|
|
1653
|
-
imports.wbg.__wbindgen_object_drop_ref = function(arg0) {
|
|
1654
|
-
takeObject(arg0);
|
|
1655
|
-
};
|
|
1656
|
-
imports.wbg.__wbindgen_error_new = function(arg0, arg1) {
|
|
1657
|
-
const ret = new Error(getStringFromWasm0(arg0, arg1));
|
|
1658
|
-
return addHeapObject(ret);
|
|
1659
|
-
};
|
|
1660
|
-
imports.wbg.__wbindgen_bigint_new = function(arg0, arg1) {
|
|
1661
|
-
const ret = BigInt(getStringFromWasm0(arg0, arg1));
|
|
1662
|
-
return addHeapObject(ret);
|
|
1663
|
-
};
|
|
1664
|
-
imports.wbg.__wbindgen_number_new = function(arg0) {
|
|
1665
|
-
const ret = arg0;
|
|
1666
|
-
return addHeapObject(ret);
|
|
1667
|
-
};
|
|
1668
|
-
imports.wbg.__wbindgen_object_clone_ref = function(arg0) {
|
|
1669
|
-
const ret = getObject(arg0);
|
|
1670
|
-
return addHeapObject(ret);
|
|
1671
|
-
};
|
|
1672
|
-
imports.wbg.__wbg_String_7462bcc0fcdbaf7d = function(arg0, arg1) {
|
|
1673
|
-
const ret = String(getObject(arg1));
|
|
1674
|
-
const ptr0 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1675
|
-
const len0 = WASM_VECTOR_LEN;
|
|
1676
|
-
getInt32Memory0()[arg0 / 4 + 1] = len0;
|
|
1677
|
-
getInt32Memory0()[arg0 / 4 + 0] = ptr0;
|
|
1678
|
-
};
|
|
1679
|
-
imports.wbg.__wbg_set_e93b31d47b90bff6 = function(arg0, arg1, arg2) {
|
|
1680
|
-
getObject(arg0)[takeObject(arg1)] = takeObject(arg2);
|
|
1681
|
-
};
|
|
1682
|
-
imports.wbg.__wbindgen_cb_drop = function(arg0) {
|
|
1683
|
-
const obj = takeObject(arg0).original;
|
|
1684
|
-
if (obj.cnt-- == 1) {
|
|
1685
|
-
obj.a = 0;
|
|
1686
|
-
return true;
|
|
1687
|
-
}
|
|
1688
|
-
const ret = false;
|
|
1689
|
-
return ret;
|
|
1690
|
-
};
|
|
1691
|
-
imports.wbg.__wbg_get_aab8f8a9b87125ad = function() { return handleError(function (arg0, arg1, arg2, arg3) {
|
|
1692
|
-
const ret = getObject(arg1).get(getStringFromWasm0(arg2, arg3));
|
|
1693
|
-
var ptr0 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1694
|
-
var len0 = WASM_VECTOR_LEN;
|
|
1695
|
-
getInt32Memory0()[arg0 / 4 + 1] = len0;
|
|
1696
|
-
getInt32Memory0()[arg0 / 4 + 0] = ptr0;
|
|
1697
|
-
}, arguments) };
|
|
1698
|
-
imports.wbg.__wbg_set_b5c36262f65fae92 = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
|
|
1699
|
-
getObject(arg0).set(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4));
|
|
1700
|
-
}, arguments) };
|
|
1701
|
-
imports.wbg.__wbg_instanceof_Response_240e67e5796c3c6b = function(arg0) {
|
|
1702
|
-
const ret = getObject(arg0) instanceof Response;
|
|
1703
|
-
return ret;
|
|
1704
|
-
};
|
|
1705
|
-
imports.wbg.__wbg_headers_aa309e800cf75016 = function(arg0) {
|
|
1706
|
-
const ret = getObject(arg0).headers;
|
|
1707
|
-
return addHeapObject(ret);
|
|
1708
|
-
};
|
|
1709
|
-
imports.wbg.__wbg_arrayBuffer_ccd485f4d2929b08 = function() { return handleError(function (arg0) {
|
|
1710
|
-
const ret = getObject(arg0).arrayBuffer();
|
|
1711
|
-
return addHeapObject(ret);
|
|
1712
|
-
}, arguments) };
|
|
1713
|
-
imports.wbg.__wbg_headers_0aeca08d4e61e2e7 = function(arg0) {
|
|
1714
|
-
const ret = getObject(arg0).headers;
|
|
1715
|
-
return addHeapObject(ret);
|
|
1716
|
-
};
|
|
1717
|
-
imports.wbg.__wbg_newwithstrandinit_de7c409ec8538105 = function() { return handleError(function (arg0, arg1, arg2) {
|
|
1718
|
-
const ret = new Request(getStringFromWasm0(arg0, arg1), getObject(arg2));
|
|
1719
|
-
return addHeapObject(ret);
|
|
1720
|
-
}, arguments) };
|
|
1721
|
-
imports.wbg.__wbg_instanceof_Window_42f092928baaee84 = function(arg0) {
|
|
1722
|
-
const ret = getObject(arg0) instanceof Window;
|
|
1723
|
-
return ret;
|
|
1724
|
-
};
|
|
1725
|
-
imports.wbg.__wbg_fetch_9a5cb9d8a96004d0 = function(arg0, arg1) {
|
|
1726
|
-
const ret = getObject(arg0).fetch(getObject(arg1));
|
|
1727
|
-
return addHeapObject(ret);
|
|
1728
|
-
};
|
|
1729
|
-
imports.wbg.__wbg_newnoargs_971e9a5abe185139 = function(arg0, arg1) {
|
|
1730
|
-
const ret = new Function(getStringFromWasm0(arg0, arg1));
|
|
1731
|
-
return addHeapObject(ret);
|
|
1732
|
-
};
|
|
1733
|
-
imports.wbg.__wbg_new_ac586205e4424583 = function() {
|
|
1734
|
-
const ret = new Map();
|
|
1735
|
-
return addHeapObject(ret);
|
|
1736
|
-
};
|
|
1737
|
-
imports.wbg.__wbg_call_33d7bcddbbfa394a = function() { return handleError(function (arg0, arg1) {
|
|
1738
|
-
const ret = getObject(arg0).call(getObject(arg1));
|
|
1739
|
-
return addHeapObject(ret);
|
|
1740
|
-
}, arguments) };
|
|
1741
|
-
imports.wbg.__wbg_new_e6a9fecc2bf26696 = function() {
|
|
1742
|
-
const ret = new Object();
|
|
1743
|
-
return addHeapObject(ret);
|
|
1744
|
-
};
|
|
1745
|
-
imports.wbg.__wbindgen_is_string = function(arg0) {
|
|
1746
|
-
const ret = typeof(getObject(arg0)) === 'string';
|
|
1747
|
-
return ret;
|
|
1748
|
-
};
|
|
1749
|
-
imports.wbg.__wbg_self_fd00a1ef86d1b2ed = function() { return handleError(function () {
|
|
1750
|
-
const ret = self.self;
|
|
1751
|
-
return addHeapObject(ret);
|
|
1752
|
-
}, arguments) };
|
|
1753
|
-
imports.wbg.__wbg_window_6f6e346d8bbd61d7 = function() { return handleError(function () {
|
|
1754
|
-
const ret = window.window;
|
|
1755
|
-
return addHeapObject(ret);
|
|
1756
|
-
}, arguments) };
|
|
1757
|
-
imports.wbg.__wbg_globalThis_3348936ac49df00a = function() { return handleError(function () {
|
|
1758
|
-
const ret = globalThis.globalThis;
|
|
1759
|
-
return addHeapObject(ret);
|
|
1760
|
-
}, arguments) };
|
|
1761
|
-
imports.wbg.__wbg_global_67175caf56f55ca9 = function() { return handleError(function () {
|
|
1762
|
-
const ret = global.global;
|
|
1763
|
-
return addHeapObject(ret);
|
|
1764
|
-
}, arguments) };
|
|
1765
|
-
imports.wbg.__wbindgen_is_undefined = function(arg0) {
|
|
1766
|
-
const ret = getObject(arg0) === undefined;
|
|
1767
|
-
return ret;
|
|
1768
|
-
};
|
|
1769
|
-
imports.wbg.__wbg_new_3ee7ebe9952c1fbd = function(arg0, arg1) {
|
|
1770
|
-
const ret = new Error(getStringFromWasm0(arg0, arg1));
|
|
1771
|
-
return addHeapObject(ret);
|
|
1772
|
-
};
|
|
1773
|
-
imports.wbg.__wbg_call_65af9f665ab6ade5 = function() { return handleError(function (arg0, arg1, arg2) {
|
|
1774
|
-
const ret = getObject(arg0).call(getObject(arg1), getObject(arg2));
|
|
1775
|
-
return addHeapObject(ret);
|
|
1776
|
-
}, arguments) };
|
|
1777
|
-
imports.wbg.__wbg_set_a55cff623a9eaa21 = function(arg0, arg1, arg2) {
|
|
1778
|
-
const ret = getObject(arg0).set(getObject(arg1), getObject(arg2));
|
|
1779
|
-
return addHeapObject(ret);
|
|
1780
|
-
};
|
|
1781
|
-
imports.wbg.__wbg_new_52205195aa880fc2 = function(arg0, arg1) {
|
|
1782
|
-
try {
|
|
1783
|
-
var state0 = {a: arg0, b: arg1};
|
|
1784
|
-
var cb0 = (arg0, arg1) => {
|
|
1785
|
-
const a = state0.a;
|
|
1786
|
-
state0.a = 0;
|
|
1787
|
-
try {
|
|
1788
|
-
return __wbg_adapter_127(a, state0.b, arg0, arg1);
|
|
1789
|
-
} finally {
|
|
1790
|
-
state0.a = a;
|
|
1791
|
-
}
|
|
1792
|
-
};
|
|
1793
|
-
const ret = new Promise(cb0);
|
|
1794
|
-
return addHeapObject(ret);
|
|
1795
|
-
} finally {
|
|
1796
|
-
state0.a = state0.b = 0;
|
|
1797
|
-
}
|
|
1798
|
-
};
|
|
1799
|
-
imports.wbg.__wbg_resolve_0107b3a501450ba0 = function(arg0) {
|
|
1800
|
-
const ret = Promise.resolve(getObject(arg0));
|
|
1801
|
-
return addHeapObject(ret);
|
|
1802
|
-
};
|
|
1803
|
-
imports.wbg.__wbg_then_18da6e5453572fc8 = function(arg0, arg1) {
|
|
1804
|
-
const ret = getObject(arg0).then(getObject(arg1));
|
|
1805
|
-
return addHeapObject(ret);
|
|
1806
|
-
};
|
|
1807
|
-
imports.wbg.__wbg_then_e5489f796341454b = function(arg0, arg1, arg2) {
|
|
1808
|
-
const ret = getObject(arg0).then(getObject(arg1), getObject(arg2));
|
|
1809
|
-
return addHeapObject(ret);
|
|
1810
|
-
};
|
|
1811
|
-
imports.wbg.__wbg_buffer_34f5ec9f8a838ba0 = function(arg0) {
|
|
1812
|
-
const ret = getObject(arg0).buffer;
|
|
1813
|
-
return addHeapObject(ret);
|
|
1814
|
-
};
|
|
1815
|
-
imports.wbg.__wbg_newwithbyteoffsetandlength_88fdad741db1b182 = function(arg0, arg1, arg2) {
|
|
1816
|
-
const ret = new Uint8Array(getObject(arg0), arg1 >>> 0, arg2 >>> 0);
|
|
1817
|
-
return addHeapObject(ret);
|
|
1818
|
-
};
|
|
1819
|
-
imports.wbg.__wbg_new_cda198d9dbc6d7ea = function(arg0) {
|
|
1820
|
-
const ret = new Uint8Array(getObject(arg0));
|
|
1821
|
-
return addHeapObject(ret);
|
|
1822
|
-
};
|
|
1823
|
-
imports.wbg.__wbg_set_1a930cfcda1a8067 = function(arg0, arg1, arg2) {
|
|
1824
|
-
getObject(arg0).set(getObject(arg1), arg2 >>> 0);
|
|
1825
|
-
};
|
|
1826
|
-
imports.wbg.__wbg_length_51f19f73d6d9eff3 = function(arg0) {
|
|
1827
|
-
const ret = getObject(arg0).length;
|
|
1828
|
-
return ret;
|
|
1829
|
-
};
|
|
1830
|
-
imports.wbg.__wbg_newwithlength_66e5530e7079ea1b = function(arg0) {
|
|
1831
|
-
const ret = new Uint8Array(arg0 >>> 0);
|
|
1832
|
-
return addHeapObject(ret);
|
|
1833
|
-
};
|
|
1834
|
-
imports.wbg.__wbg_set_2762e698c2f5b7e0 = function() { return handleError(function (arg0, arg1, arg2) {
|
|
1835
|
-
const ret = Reflect.set(getObject(arg0), getObject(arg1), getObject(arg2));
|
|
1836
|
-
return ret;
|
|
1837
|
-
}, arguments) };
|
|
1838
|
-
imports.wbg.__wbindgen_debug_string = function(arg0, arg1) {
|
|
1839
|
-
const ret = debugString(getObject(arg1));
|
|
1840
|
-
const ptr0 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1841
|
-
const len0 = WASM_VECTOR_LEN;
|
|
1842
|
-
getInt32Memory0()[arg0 / 4 + 1] = len0;
|
|
1843
|
-
getInt32Memory0()[arg0 / 4 + 0] = ptr0;
|
|
1844
|
-
};
|
|
1845
|
-
imports.wbg.__wbindgen_throw = function(arg0, arg1) {
|
|
1846
|
-
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
1847
|
-
};
|
|
1848
|
-
imports.wbg.__wbindgen_memory = function() {
|
|
1849
|
-
const ret = wasm.memory;
|
|
1850
|
-
return addHeapObject(ret);
|
|
1851
|
-
};
|
|
1852
|
-
imports.wbg.__wbindgen_closure_wrapper1383 = function(arg0, arg1, arg2) {
|
|
1853
|
-
const ret = makeMutClosure(arg0, arg1, 531, __wbg_adapter_26);
|
|
1854
|
-
return addHeapObject(ret);
|
|
1855
|
-
};
|
|
1856
|
-
|
|
1857
|
-
return imports;
|
|
1858
|
-
}
|
|
1859
|
-
|
|
1860
|
-
function initMemory(imports, maybe_memory) {
|
|
1861
|
-
|
|
1862
|
-
}
|
|
1863
|
-
|
|
1864
|
-
function finalizeInit(instance, module) {
|
|
1865
|
-
wasm = instance.exports;
|
|
1866
|
-
init.__wbindgen_wasm_module = module;
|
|
1867
|
-
cachedBigUint64Memory0 = new BigUint64Array();
|
|
1868
|
-
cachedInt32Memory0 = new Int32Array();
|
|
1869
|
-
cachedUint8Memory0 = new Uint8Array();
|
|
1870
|
-
|
|
1871
|
-
|
|
1872
|
-
return wasm;
|
|
1873
|
-
}
|
|
1874
|
-
|
|
1875
|
-
function initSync(bytes) {
|
|
1876
|
-
const imports = getImports();
|
|
1877
|
-
|
|
1878
|
-
initMemory(imports);
|
|
1879
|
-
|
|
1880
|
-
const module = new WebAssembly.Module(bytes);
|
|
1881
|
-
const instance = new WebAssembly.Instance(module, imports);
|
|
1882
|
-
|
|
1883
|
-
return finalizeInit(instance, module);
|
|
1884
|
-
}
|
|
1885
|
-
|
|
1886
|
-
// async function init(input) {
|
|
1887
|
-
|
|
1888
|
-
|
|
1889
|
-
// // https://unpkg.com/parquet-wasm@0.4.0-beta.5/esm/arrow2_bg.wasm
|
|
1890
|
-
// console.log('here in the parquet-wasm source code')
|
|
1891
|
-
// console.log('import.meta.url')
|
|
1892
|
-
// console.log(import.meta.url)
|
|
1893
|
-
// if (typeof input === 'undefined') {
|
|
1894
|
-
// input = new URL('arrow2_bg.wasm', import.meta.url);
|
|
1895
|
-
// }
|
|
1896
|
-
// const imports = getImports();
|
|
1897
|
-
|
|
1898
|
-
// if (typeof input === 'string' || (typeof Request === 'function' && input instanceof Request) || (typeof URL === 'function' && input instanceof URL)) {
|
|
1899
|
-
// input = fetch(input);
|
|
1900
|
-
// }
|
|
1901
|
-
|
|
1902
|
-
// initMemory(imports);
|
|
1903
|
-
|
|
1904
|
-
// const { instance, module } = await load(await input, imports);
|
|
1905
|
-
|
|
1906
|
-
// return finalizeInit(instance, module);
|
|
1907
|
-
// }
|
|
1908
|
-
|
|
1909
|
-
// async function init(input) {
|
|
1910
|
-
// // console.log('here in the parquet-wasm source code');
|
|
1911
|
-
|
|
1912
|
-
// // Use a fixed path for development. You may need to adjust this path based on your project's structure and where it's served from.
|
|
1913
|
-
// // For example, if your server serves the `vendor` directory at the root, and `arrow2_bg.wasm` is within `vendor/parquet-wasm/`,
|
|
1914
|
-
// // the path should reflect that.
|
|
1915
|
-
// const fixedPath = 'files/js/vendor/parquet-wasm/arrow2_bg.wasm'; // Adjust this path as necessary.
|
|
1916
|
-
|
|
1917
|
-
// // js/vendor/parquet-wasm
|
|
1918
|
-
|
|
1919
|
-
// if (typeof input === 'undefined') {
|
|
1920
|
-
// // Assume we're in a browser environment and construct the URL relative to the server's root.
|
|
1921
|
-
// input = new URL(fixedPath, window.location.origin);
|
|
1922
|
-
// }
|
|
1923
|
-
// // console.log('WASM module will be loaded from:', input);
|
|
1924
|
-
|
|
1925
|
-
// const imports = getImports();
|
|
1926
|
-
|
|
1927
|
-
// if (typeof input === 'string' || (typeof Request === 'function' && input instanceof Request) || (typeof URL === 'function' && input instanceof URL)) {
|
|
1928
|
-
// input = fetch(input);
|
|
1929
|
-
// }
|
|
1930
|
-
|
|
1931
|
-
// initMemory(imports);
|
|
1932
|
-
|
|
1933
|
-
// const { instance, module } = await load(await input, imports);
|
|
1934
|
-
|
|
1935
|
-
// return finalizeInit(instance, module);
|
|
1936
|
-
// }
|
|
1937
|
-
|
|
1938
|
-
|
|
1939
|
-
import { wasmBase64 } from './wasmModuleBase64.js'; // Assuming you've exported the Base64 string here
|
|
1940
|
-
|
|
1941
|
-
async function init(input) {
|
|
1942
|
-
// No need to adjust the path, as we'll be loading the WASM from a Base64 string
|
|
1943
|
-
const imports = getImports();
|
|
1944
|
-
|
|
1945
|
-
// Decode the Base64 string to get the binary representation
|
|
1946
|
-
const binaryString = window.atob(wasmBase64);
|
|
1947
|
-
const bytes = new Uint8Array(binaryString.length);
|
|
1948
|
-
for (let i = 0; i < binaryString.length; i++) {
|
|
1949
|
-
bytes[i] = binaryString.charCodeAt(i);
|
|
1950
|
-
}
|
|
1951
|
-
|
|
1952
|
-
initMemory(imports);
|
|
1953
|
-
|
|
1954
|
-
// Use the binary bytes to instantiate the WebAssembly module
|
|
1955
|
-
const { instance, module } = await WebAssembly.instantiate(bytes, imports);
|
|
1956
|
-
|
|
1957
|
-
return finalizeInit(instance, module);
|
|
1958
|
-
}
|
|
1959
|
-
|
|
1960
|
-
|
|
1961
|
-
|
|
1962
|
-
export { initSync }
|
|
1963
|
-
export default init;
|