roee88 edited a comment on issue #177:
URL:
https://github.com/apache/arrow-datafusion/issues/177#issuecomment-963947330
I got the basic sample from the gist in the previous message working with
wasm-pack (wasm32-unknown-unknown) on single threaded tokio after:
1. Removing the "lz4" and "zstd" features from parquet dependency. This is
the same change I had to do for running in wasm32-wasi.
2. Disabling the default time feature from tokio-stream by changing the
dependency to: `tokio-stream = { version = "0.1", default-features = false }`
3. Removing the use of `Instant::now()` which is unsupported in
wasm32-unknown-unknown and panics. For the basic sample that I'm running I just
removed some lines from ScopedTimerGuard, but it's used in other places too if
you run more complex stuff. Maybe https://github.com/sebcrozet/instant can be
used instead.
4. Enabling `js` feature of getrandom: `getrandom = { version = "0.2",
features = ["js"] }`. I did this in the sample application itself and not in
datafusion (as it breaks other targets like wasm32-wasi).
5. Enabling `wasmbind` feature of chrono: `chrono = {version = "0.4",
features = ["wasmbind"]}`. I did this in the sample application itself and not
in datafusion (as it breaks other targets like wasm32-wasi).
Tested in chrome and seems to work. Again, there are definitely some code
paths that lead to panic as not all of std is supported in wasm32 targets and I
only tested something basic. Also, for multi-threading to work in the browser
some parts of tokio can't be used directly from the datafusion codebase (this
is a more complex topic).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]