Skip to content

Upgrade DuckDB to 2.0+, wasm 1.33.1-dev118.0 - #2

Merged
solsson merged 12 commits into
mainfrom
duckdb2
Nov 19, 2026
Merged

solsson merged 12 commits into
mainfrom
duckdb2

Conversation

@solsson

@solsson solsson commented Nov 19, 2026

Copy link
Copy Markdown
Contributor

No description provided.

solsson and others added 12 commits November 19, 2026 06:57
Sources run on @duckdb/node-api 2.0.0-r.1 and pages, prerendering and
the parquet COPY on @duckdb/duckdb-wasm 1.33.1-dev118.0, both DuckDB
v2.0.0. The wasm package's latest tag, 1.33.1-dev57.0, is DuckDB 1.4;
dev118 is on its next tag and is pinned exactly as a dev build.

duckdb-wasm 1.33 replaces the mvp, eh and coi bundles with base and
threads. base needs WebAssembly exceptions, which the eh bundle was
picked for wherever available; there is no fallback without them.

DuckDB 2.0 raises an error for division by zero where the wasm client,
with ieee_floating_point_ops off, returned NULL, and types an untyped
NULL as "NULL" instead of INTEGER, which page queries saw as a number
column. Both are set back, like the earlier compatibility settings.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
duckdb-wasm 1.33 serializes results with nanoarrow and applies the
query config casts by DuckDB type: castBigIntToDouble covers BIGINT and
UBIGINT, castDecimalToDouble DECIMAL. HUGEINT and UHUGEINT, which Arrow
C++ used to export as decimals and castDecimalToDouble then cast, now
arrive as Decimal(38,0). SUM of integers is a HUGEINT, so page queries
like sum(case when ... then 1 else 0 end) returned objects typed as
strings.

arrowTableToJSON types decimal columns as numbers and converts their
values, which is a no-op once duckdb-wasm casts them again. The test
covers it and the compatibility settings, on the node client.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
DuckDB 2.0 raises an error for integer // and % by zero, and types an
untyped NULL as "NULL", which DESCRIBE reports and the column type
mapping made a string where it was a number. A source with
`null as x` in every branch of a UNION got a Utf8 parquet column
instead of Float64. The connection sets both back before
initialize.sql, which can change them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The node client spec of universal-sql and the duckdb datasource tests
run DuckDB itself, wasm and native. build-parquet.spec.js stays out, as
it uses mock-fs like the excluded preprocess spec.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The duckdb datasource is a major release, as source SQL with the
x -> x + 1 lambda syntax fails on DuckDB 2.0. csv and motherduck are
released for their dependency on it: changesets doesn't bump dependents
of an aliased dependency. universal-sql is a minor release, since sdk
has it as a peer dependency and changesets bumps the dependents of a
non-patch peer dependency release as major.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
duckdb-wasm 1.33 links the icu extension but loads it only when a query
first uses current_date, current_timestamp or the like, and that query
fails to bind, for example "No function matches the given name and
argument types '-(DATE, INTEGER_LITERAL)'" for current_date - 90. Later
queries bind. A page whose first such query is one of its own got the
error; native DuckDB 2.0 loads icu at startup and doesn't have it.

duckdb-wasm 1.32 didn't load icu at all, so current_date was the core
function.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
duckdb-wasm 1.32 set TimeZone to the local UTC offset, Etc/GMT-1 in
Stockholm in winter; 1.33, with DuckDB 2.0's own time zone handling,
starts in UTC. A string compared to a timestamptz, such as a page's
date range against to_timestamp(epoch / 1000), then meant midnight UTC
instead of local midnight, and a line chart got an extra point for the
bucket ending at midnight UTC on the range's last day.

The clients set TimeZone to the zone Intl reports, an IANA name, so
dates in the other half of the year get their own UTC offset where
1.32 used the current one for all.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
With TimeZone set to the local zone, duckdb-wasm 1.33 also shifts
timestamptz results by it: castTimestampToDate is now a DuckDB cast to
TIMESTAMP_MS, which gives local wall-clock time, where 1.32 passed the
UTC instant through. A to_timestamp column in August came back as
02:00Z instead of 00:00Z. Results matter more than how a string
literal compared to a timestamptz is read, so the clients stay in UTC,
as DuckDB 2.0 in wasm starts.

This reverts commit b59b130.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
setTimeZone(zone) sets DuckDB's TimeZone, UTC for null. In it,
current_date is that zone's date, a string compared to a timestamptz
means midnight there, and a timestamptz result is its wall-clock time:
duckdb-wasm 1.33 casts timestamptz to TIMESTAMP_MS in the session's
zone, and Evidence formats a Date by its UTC fields, so the page shows
the zone's clock without a second shift. Timestamps without a zone are
left as they are. The tests pin this for Stockholm and New York in
summer and winter time.

The node client takes the zone in query()'s cache options and sets it
right before each query, since prerendering interleaves pages of
different scopes on one connection. A zone DuckDB doesn't know is
logged and the previous one kept.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
deployment.timeZone is the IANA zone page queries run in, UTC when not
set. deployment.timeZoneQuery gives a data scope's own zone: SQL whose
first column of the first row is the zone, ${scope} replaced by the
scope as a string literal. Pages whose scope it gives no zone for use
timeZone.

The browser runs the query on the scope's data once its tables are
loaded, and the server on the full data set, which has the scope's rows
too, remembering each scope's zone while building, so prerendered
results and the browser's own queries agree.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@solsson
solsson merged commit 941ead8 into main Nov 19, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant