duckdb-wasm
duckdb-wasm copied to clipboard
ST_READ (spatial extension) fails to load in DuckDB-WASM
What happens?
Earlier DuckDB-WASM versions could successfully use the spatial extension, including the ST_READ method to read various geometry data formats. This no longer appears to work, as ST_READ fails with an error.
To Reproduce
Here is a transcript from the online DuckDB-WASM shell:
duckdb> INSTALL spatial;
┌┐
└┘
duckdb> LOAD spatial;
┌┐
└┘
duckdb> CREATE TABLE nyc AS SELECT * FROM ST_READ(‘https://raw.githubusercontent.com/duckdb/duckdb-spatial/main/test/data/nyc_taxi/taxi_zones/taxi_zones.shp');
Invalid Error: [object WebAssembly.Exception]
I would expect the data to load. Instead, Invalid Error: [object WebAssembly.Exception] occurs.
I have seen the same error with other files including GeoJSON and TopoJSON data. This is a breaker for adopting more recent dev versions of DuckDB-WASM; version 1.29.0 does not exhibit this error.
Thanks!
Browser/Environment:
Chrome, Firefox
Device:
MacBook
DuckDB-Wasm Version:
1.29.1-dev135.0
DuckDB-Wasm Deployment:
shell.duckdb.org
Full Name:
Jeffrey Heer
Affiliation:
University of Washington
Thanks, I reproduce, somehow glob is handled wrongly, or at the very least differently than expected.
I will ping back later when I have a fix, thanks for raising.
Fixed, for example check: https://shell.duckdb.org/#queries=v0,LOAD-spatial~%0ACREATE-TABLE-nyc-AS-SELECT-*-FROM-ST_READ('https%3A%2F%2Fraw.githubusercontent.com%2Fduckdb%2Fduckdb%20spatial%2Fmain%2Ftest%2Fdata%2Fnyc_taxi%2Ftaxi_zones%2Ftaxi_zones.shp')~%0A
Thanks! While this works for me in Chrome and Safari, I'm now seeing a different error in Firefox:
duckdb> LOAD spatial;
...> CREATE TABLE nyc AS SELECT * FROM ST_READ('https://raw.githubusercontent.com/duckdb/duckdb-spatial/main/test/data/nyc_taxi/taxi_zones/taxi_zones.shp');
...>
Invalid Error: missing , or ]
The WASM shell version is: @duckdb/[email protected]
Thanks for checking!
Is this eventually fixed by https://github.com/duckdb/duckdb-wasm/pull/2060?
@jheer: I can't reproduce anymore on Firefox, but hard to say what exactly has been changed in the meantime / track the fix.
Could you possibly give it another go on your side? Thanks!
@jheer: I can't reproduce anymore on Firefox, but hard to say what exactly has been changed in the meantime / track the fix.
Could you possibly give it another go on your side? Thanks!
Yes, it appears to be working! I can now run my earlier (breaking) example without issue. Thanks!