Skip to content

Enable CURL response decompression#278

Open
rustyconover wants to merge 2 commits into
duckdb:mainfrom
rustyconover:enable-curl-decompression
Open

Enable CURL response decompression#278
rustyconover wants to merge 2 commits into
duckdb:mainfrom
rustyconover:enable-curl-decompression

Conversation

@rustyconover
Copy link
Copy Markdown
Contributor

Summary

  • Change CURLOPT_ACCEPT_ENCODING from NULL to "" so CURL advertises all supported compression encodings (gzip, deflate, br, zstd) and automatically decompresses responses
  • Reduces bandwidth usage for HTTP transfers with no behavioral change for callers

Fixes #277

Test plan

  • Verify CURL sends Accept-Encoding header with supported encodings
  • Verify compressed responses are automatically decompressed
  • Run existing httpfs test suite to confirm no regressions

🤖 Generated with Claude Code

rustyconover and others added 2 commits March 6, 2026 19:36
Change CURLOPT_ACCEPT_ENCODING from NULL to "" so that CURL advertises
all supported compression encodings (e.g. gzip, deflate, br, zstd) in
the Accept-Encoding header and automatically decompresses responses.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Enable zstd compression support in the curl build so that CURL can
advertise and decompress zstd-encoded responses.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@carlopi
Copy link
Copy Markdown
Member

carlopi commented Mar 7, 2026

Thanks for the PR, that would make sense, but before enabling this behaviour we would first need to fix duckdb/duckdb to handle receiving those pre-compressed streams.

Internal timeline is "nice for 1.5.1, but unclear"

@rustyconover
Copy link
Copy Markdown
Contributor Author

rustyconover commented Mar 7, 2026 via email

@carlopi
Copy link
Copy Markdown
Member

carlopi commented Mar 7, 2026

I would be OK with adding an option, (that defaults to using NULL) but allows to opt in to "". Would that work for you?

The option we might need in any case to avoid regressions.
On defaulting to "" vs NULL, issue was that (as mentioned in the PR at #263 (comment)) uploading gzip-ped JSON files to S3 will have them doubly decompressed.
Given it's a niche but relevant data-source, I'd say first we need a fix before changing the default.

@rustyconover
Copy link
Copy Markdown
Contributor Author

rustyconover commented Mar 7, 2026

Hey @carlopi,

You should let curl handle the decompression.

The whole argument around:

aws s3 cp file.json.gz s3://<bucket>/file.json.gz --content-type gzip

is flawed. HTTP Compression is a content encoding for the transmission over the HTTP request, not a content-type. The content type here should still be application/octet-stream not gzip.

I realize how it can be confusing for people, but we need to be pedantic about this.

I'd be happy to talk this through more. But I think this original motivation for #263 is flawed.

Rusty

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.

Enable CURL response decompression

2 participants