Repository navigation
fix(engine): read remote files in ranges through httpfs - #77
Merged
Merged
Conversation
|
PkgFire: WARN · scan details No dependency changed. 723 packages checked. Why
Listed, not counted
|
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.
Closes #75.
DuckDB-WASM's built-in HTTP layer misreads its range probe and downloads every remote file whole (duckdb/duckdb-wasm#2228). The httpfs extension reads only the byte ranges a query needs. Thanks to @llimllib for the report and the workaround.
Measured on the query from the issue (
nba.duckdb, parquet views,LIMIT 100), default settings: 27.24 MB before, 2.19 MB after, all range requests answered206.What changes
builtin_httpfs = falseon its statement connection before the next query. If httpfs cannot be loaded (offline, blocked), the built-in layer stays and works as before.Rangemakes httpfs fail with "Server sent back more data than expected". The statement is retried once withforce_download, only when no rows were streamed yet and the SQL is a single statement, so nothing runs twice.The single-statement check is a small scanner in
rangeReads.ts, not the editor's splitter: importing that from the engine pulled the editor chunk into the startup bundle (+29 kB).indexstays at 306.81 kB.No dependency changes. httpfs is a DuckDB extension fetched at runtime from extensions.duckdb.org (about 500 kB, cached by the browser), like
parquetandducklakealready are.Verified
e2e/rangeReads.spec.tsrun on CI too: two in-test Node servers, one honouring Range, one ignoring it, plus the settings switch. New fixturee2e/fixtures/ranges.parquet(184 kB); the existing 1.1 kB one fits in a single range and never triggers the retry.Not tried: Safari, Firefox, S3 pre-signed URLs.