Repository navigation
playground: load ICU and JSON from the site before any SQL runs - #151
Merged
Merged
Conversation
The DuckDB-WASM build the playground serves starts without ICU. The first statement that calls an ICU function, such as current_date(), autoloads it while that statement binds, and ICU's new overloads for +, - and date_diff corrupt the binder's lookups: garbled binder errors or "memory access out of bounds" for queries native DuckDB 2.0 runs, such as DATEADD(day, -30, CURRENT_DATE). The page now loads ICU, and json for the sample schema's JSON column, right after connecting, and says so when either fails to load. prepare_playground vendors both extension files for this DuckDB-WASM version, pinned by sha256, under the versioned duckdb directory, so the page never fetches from extensions.duckdb.org. The engine tests run each case in a fresh DuckDB loaded as the page loads it, so an earlier case can no longer load ICU for a later one, and cover last-30-days DATEADD, DATEDIFF against CURRENT_DATE and month-end DATEADD.
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The playground's Run stage failed on queries native DuckDB 2.0 runs, such as
WHERE ordered_at >= DATEADD(day, -30, CURRENT_DATE).Cause. DuckDB-WASM 1.33.1-dev114.0 starts without ICU. The first statement that calls an ICU function (
current_date(),timezone(), …) autoloads ICU while it binds, and ICU's new overloads for+,-anddate_diffcorrupt the binder's lookups. The result is garbled binder errors ormemory access out of bounds, depending on statement order.Change.
playground.jsloads ICU, and json for the sample schema's JSON column, right after connecting and before any fixture or user SQL. If either fails, the Run stage saysDuckDB did not load: the icu extension did not load: …with Try again.prepare_playground.mjsvendors both extension files for this exact DuckDB-WASM version, pinned by sha256, atplayground/duckdb/1.33.1-dev114.0/extensions/v2.0.0/wasm_eh/. The page setscustom_extension_repositoryto that site path, so it never fetches from extensions.duckdb.org. Sizes: icu 1,900,643 bytes (696 KB gzip), json 1,026,764 bytes (243 KB gzip), well within GitHub Pages' 100 MB per-file limit. The existing immutable cache rule for/playground/duckdb/*covers them.Binder Error: No function matches … '(DATE, INTERVAL)'.Checked.
npm run -s test:engine: 14 pass. Build and link check: 17 pages, 0 broken links. In Chromium with extensions.duckdb.org blocked, a cold load of the last-30-days query passes all four stages (0 rows, DuckDB v2.0.0), and no extension request leaves the site. All six example chips still stop where their labels say. With the ICU file removed, the Run stage shows the load error.