Skip to content

feat(results): make Arrow LZ4 compression configurable - #511

Merged
aakash-saravanan-db merged 5 commits into
mainfrom
aakash-saravanan_data/feat/lz4-compression-toggle-20261127
Dec 3, 2026
Merged

aakash-saravanan-db merged 5 commits into
mainfrom
aakash-saravanan_data/feat/lz4-compression-toggle-20261127

Conversation

@aakash-saravanan-db

@aakash-saravanan-db aakash-saravanan-db commented Nov 27, 2026 •

Copy link
Copy Markdown
Collaborator

Status: merge awaits current-head CI and review.

Feature or gap

The released SQL kernel always requests LZ4 compression for Arrow results, so applications cannot opt out.

What this PR addresses

LZ4 remains enabled by default. The kernel accepts a session default and a statement override, and uses the corresponding codec for inline and CloudFetch requests. The Rust API and the Python (PyO3) and Node.js (napi) bindings expose statement overrides. The C and Arrow Database Connectivity (ADBC) interfaces expose only the session default.

Dependencies

None.

Tests and validation

Request tests cover defaults, overrides, reset, and metadata. Optimized source-built drivers returned complete values with both codecs and delivery modes. Comparable timings met parity or improved except Node.js runAsync: true queries with compressed inline results compared with the Thrift backend (542→664 ms, +22.4%); that gap is not yet resolved.

@oss-reviewer-bot oss-reviewer-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔀 Cross-reviewed: two independent reviews (Claude Opus 5.5 · GPT-6.1 Sol), checked by a judge model (Claude Sonnet 5.5).

Verdict: 1 Low

Looks good, with 1 low concern. The codec is resolved correctly: the statement override wins over the session default, and metadata calls pick up the session default through ExecuteParams::default(). Wiremock tests cover the default, override and reset cases for the Rust, napi, C ABI and metadata paths.

Comment thread pyo3/src/statement.rs Resolved

@oss-reviewer-bot oss-reviewer-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔀 Cross-reviewed: two independent reviews (Claude Opus 5.5 · GPT-6.1 Sol), checked by a judge model (Claude Sonnet 5.5).

Verdict: 3 Low

Looks good overall, with 3 low-severity concerns. The codec choice (statement override, then session default, then LZ4) is wired correctly through SEA execute, metadata and ADBC. The concerns are uneven binding coverage and tests that don't check the request body sent over the wire.

Comment thread pyo3/tests/test_module.py Resolved
Comment thread pyo3/src/statement.rs Resolved
@aakash-saravanan-db
aakash-saravanan-db force-pushed the aakash-saravanan_data/feat/lz4-compression-toggle-20261127 branch from b305326 to 0af849a Compare December 2, 2026 19:34

@oss-reviewer-bot oss-reviewer-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔀 Cross-reviewed: two independent reviews (Claude Opus 5.5 · GPT-6.1 Sol), checked by a judge model (Claude Sonnet 5.5).

Verdict: 1 High · 1 Medium

Looks good, with 1 medium concern: the ADBC option key doesn't match the C# sibling driver's key. Session and statement precedence, reset behavior and wire codec selection are wired correctly and tested across the Rust API and each binding.

This overview is Claude Opus 5.5's initial take; GPT-6.1 Sol added findings it doesn't mention — see the findings below.

Comment thread adbc/src/config.rs Resolved
Comment thread src/types/sea.rs Resolved

@oss-reviewer-bot oss-reviewer-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔀 Cross-reviewed: two independent reviews (Claude Opus 5.5 · GPT-6.1 Sol), checked by a judge model (Claude Sonnet 5.5).

✅ No issues identified.

Comment thread napi/src/connection.rs Resolved

@oss-reviewer-bot oss-reviewer-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔀 Cross-reviewed: two independent reviews (Claude Opus 5.5 · GPT-6.1 Sol), checked by a judge model (Claude Sonnet 5.5).

Verdict: 1 Medium

Looks good, with 1 medium concern. Sending NONE when LZ4 is off matches the C# driver, None correctly falls back to the session default, and the tests cover all bindings. The concern is that ADBC doesn't accept the C# driver's LZ4 option key.

Comment thread adbc/src/config.rs Resolved
Signed-off-by: Aakash Saravanan <aakash.saravanan@databricks.com>
Signed-off-by: Aakash Saravanan <aakash.saravanan@databricks.com>
Signed-off-by: Aakash Saravanan <aakash.saravanan@databricks.com>
Signed-off-by: Aakash Saravanan <aakash.saravanan@databricks.com>
Signed-off-by: Aakash Saravanan <aakash.saravanan@databricks.com>

@oss-reviewer-bot oss-reviewer-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔀 Cross-reviewed: two independent reviews (Claude Opus 5.5 · GPT-6.1 Sol), checked by a judge model (Claude Sonnet 5.5).

Verdict: 1 Nit

Looks good, with one low-severity test gap. The codec choice (statement override, else session default) reaches the SEA request in one place and is tested at the wiremock, C ABI, PyO3, napi and ADBC layers. The public structs stay #[non_exhaustive], so the new fields don't break callers.

Other findings

  • ⚪ Nit — The last valid value set is Int(1), so the field is true (the default) when the invalid-value loop runs, and the assert!(...) can't tell "unchanged" from "reset to default". Set the option to false before the loop and assert it stays false. (Found by Claude Opus 5.5 · confirmed by the judge)

This branch was successfully deployed

1 active deployment
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.

2 participants