duckdb-wasm icon indicating copy to clipboard operation
duckdb-wasm copied to clipboard

ST_READ (spatial extension) fails to load in DuckDB-WASM

Open jheer opened this issue 6 months ago • 4 comments

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

jheer avatar May 08 '25 22:05 jheer

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.

carlopi avatar May 11 '25 08:05 carlopi

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

carlopi avatar May 16 '25 11:05 carlopi

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]

jheer avatar May 16 '25 17:05 jheer

Thanks for checking!

carlopi avatar May 16 '25 17:05 carlopi

Is this eventually fixed by https://github.com/duckdb/duckdb-wasm/pull/2060?

tobilg avatar Jul 07 '25 08:07 tobilg

@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!

carlopi avatar Sep 27 '25 12:09 carlopi

@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!

jheer avatar Sep 30 '25 16:09 jheer