-
Notifications
You must be signed in to change notification settings - Fork 19
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
No functioning example #489
Comments
These two Observable examples are online, reproducible examples: https://github.com/kylebarron/parquet-wasm#published-examples |
Thank you for the reply :) I did see the observable examples I did admittedly find the platform very clunky and very unintuitive to use and like it was hiding a lot of code from me. I did by now figure out how to download of the code form the example. Though from what I can tell it is not simple javascript at work but instead some proprietary wrapper that I can't really replicate around the javascript.
I'll probably try again next weekend to unwrap that code to see if I can get it working for my project. Both examples do seem to use outdated version of the library though: It would just have been very useful to a javascript beginner like me to have a very simple example on github pages that uses the currently recommended version of the library to simply read a complete parquet file (either a small example from the github repo or a drop in file) and displays the result on screen. |
The
I agree that would be nice, but I don't have time to create a standalone example at this point. Contributions (from you or someone else) would be welcome. I generally recommend that the easiest way to get started is to use the type hints on each function to guide the user for how to fetch data. |
In case it's useful to you, I'm using this in production here: https://github.com/developmentseed/lonboard/blob/dca942da9b5bd40769068a76c45e76c9b1c9c49c/src/parquet.ts |
I published 0.6.0, added new content to the README, and updated https://observablehq.com/@kylebarron/geoparquet-on-the-web to use parquet-wasm 0.6. Hopefully this is easier to follow |
This should work in vanilla JavaScript: import initParquetWasm, {readParquet} from "https://cdn.jsdelivr.net/npm/parquet-wasm@0.6.0/+esm";
await initParquetWasm("https://cdn.jsdelivr.net/npm/parquet-wasm@0.6.0/esm/parquet_wasm_bg.wasm"); (Unfortunately the default path to |
It does work for me (at least in Deno) with import initParquetWasm, {readParquet} from "https://cdn.jsdelivr.net/npm/parquet-wasm@0.6.0/esm/parquet_wasm.js";
await initParquetWasm(); I don't know how if it's possible rewrite the import with parquet-wasm/templates/package.json Lines 37 to 40 in 09bc32e
That part is auto-generated by wasm-bindgen, so it's not something easy for me to change. |
Yes, that would work too. The It also works if you do this: import initParquetWasm, {readParquet} from "https://cdn.jsdelivr.net/npm/parquet-wasm@0.6.0/esm/+esm";
await initParquetWasm(); This uses your I would consider using Also, I think you’ll want to add the |
Thanks for the tips!
Oh very cool. I probably should suggest that from the README.
I see. That makes sense. MDN does say
I'll make an issue in wasm-bindgen tomorrow.
Thanks for pointing this out. I see duckdb-wasm does this too. https://github.com/duckdb/duckdb-wasm/blob/58fcb9a46b73eac1abb9b0dee9d7c46d1a84f628/packages/duckdb-wasm/package.json#L99-L101 |
@kylebarron FYI: I had gotten it working a week ago with that code snippet sorry that I hadn't answerd yet!! Thanks for that!! Do I understand it correctly that (#489 (comment)) means it would work without working with a bundler, just with a cdn.jsdelivr.net import? :) That would be really cool!! |
Yes. But you need to ensure you manually initialize the wasm code, whereas with the bundler entry point the wasm should be initialized behind the scenes I think. I made a PR to update the jsdelivr link in the readme, and made new issues for the other comments above. So I think this issue can be closed. |
I just spend an entire day trying to get parquet-wasm to read a parquet file and console.log() the result and couldn't get it done.
Admittedly I'm an python programmer and new to javascript.
However as far as I could tell none of the examples that are currently in the README.MD work out of the box.
This is very unfortunate, since this is a javascript library so it should be able to run a functioning example right in the GitHub pages of a repo. (Not necessarily this repo but just some example repo with some code that runs already).
Something similar to https://hyparam.github.io/hyparquet/ would go a long way make this library a lot more user friendly to people like me.
For now I will be giving up on this library since I can not get it to work in a reasonable amount of time.
The text was updated successfully, but these errors were encountered: