-
Notifications
You must be signed in to change notification settings - Fork 196
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(parquet): restore ParquetWasm loader #2868
Conversation
You're not initializing the wasm module. This import syntax sugar doesn't change the fact that the ESM import is async and the node import is sync. With the ESM bundle you need to await the default export. |
if (typeof initWasm === 'function') { | ||
// @ts-expect-error | ||
await initWasm('https://unpkg.com/[email protected]/esm/arrow1_bg.wasm'); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Assuming that this file is only called from Node (as suggested by the filename), this line should never be true.
@@ -34,7 +34,7 @@ export const ParquetWasmWorkerLoader: Loader<ArrowTable, never, ParquetWasmLoade | |||
options: { | |||
parquet: { | |||
type: 'arrow-table', | |||
wasmUrl: 'https://unpkg.com/[email protected]/esm2/arrow1_bg.wasm' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's great that esm
is working; the original esm2
endpoint was an undocumented hack that just stripped the import.meta.url
line out of the generated JS bundle with sed
, which we seemed to need for bundling at the time.
const writerProperties = new wasm.WriterPropertiesBuilder().build(); | ||
const parquetBytes = wasm.writeParquet(arrowIPCBytes, writerProperties); | ||
const wasmProperties = new wasm.WriterPropertiesBuilder().build(); | ||
const parquetBytes = wasm.writeParquet(wasmTable, wasmProperties); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Btw if you aren't passing specific properties, you don't have to pass in a second argument. https://kylebarron.dev/parquet-wasm/functions/bundler_arrow1.writeParquet.html
4708de0
to
2cd669a
Compare
cc9b2e9
to
3066e3b
Compare
@kylebarron Finally getting around to this. Running into
[TypeError: Cannot read properties of undefined (reading '__wbindgen_add_to_stack_pointer')]
. Any thoughts?