duckdb / duckdb-wasm

WebAssembly version of DuckDB
https://shell.duckdb.org
MIT License
1.02k stars 110 forks source link

Autoloading ICU not working around timezone casts #1770

Open carlopi opened 1 week ago

carlopi commented 1 week ago

What happens?

ICU is not properly autoloaded while handling time zones.

This is a duckdb issue, but particularly visible in DuckDB-Wasm due to the fact that ICU is usally built-in. Opened here for tracking, has been reported https://github.com/duckdb/duckdb-wasm/issues/1274#issuecomment-1972272711 or https://github.com/duckdb/duckdb-wasm/issues/1274#issuecomment-2165589650 independently.

Workaround user side is for now is an explicit LOAD icu; to have this to properly work.

To Reproduce

select cast(to_timestamp(100000) at time zone 'PST' as date) as event_date;
--- Error!
LOAD icu;
select cast(to_timestamp(100000) at time zone 'PST' as date) as event_date;
--- Works!

See https://shell.duckdb.org/#queries=v0,select-cast(to_timestamp(100000)-at-time-zone-'PST'-as-date)-as-event_date~,LOAD-icu~,select-cast(to_timestamp(100000)-at-time-zone-'PST'-as-date)-as-event_date

Browser/Environment:

any

Device:

any

DuckDB-Wasm Version:

1.28.1-dev231.0

DuckDB-Wasm Deployment:

shell.duckdb.org

Full Name:

Carlo Piovesan

Affiliation:

DuckDB Labs