Repository navigation
feat(results): make Arrow LZ4 compression configurable - #511
aakash-saravanan-db wants to merge 3 commits into
Conversation
Signed-off-by: Aakash Saravanan <aakash.saravanan@databricks.com>
There was a problem hiding this comment.
🔀 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.
Signed-off-by: Aakash Saravanan <aakash.saravanan@databricks.com>
Signed-off-by: Aakash Saravanan <aakash.saravanan@databricks.com>
There was a problem hiding this comment.
🔀 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 — 1 medium concern. Requests, defaults and overrides are wired correctly, and the wiremock, pyo3 and napi tests send the request and check the result_compression value it carries.
There was a problem hiding this comment.
🔀 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 · 1 Low
The change is mostly correct, with one medium and one low concern. The SEA request resolves the statement override against the session default as expected, and the wiremock tests check the codec sent with reuse and reset.
| * Recognised keys (case-insensitive): | ||
| * - "cloudfetch_enabled" = "true"|"false" — false serves every result | ||
| * through paged inline delivery without cloud-storage downloads. | ||
| * - "lz4_compression_enabled" = "true"|"false", for LZ4 compression |
There was a problem hiding this comment.
🔵 Low — PyO3 (set_lz4_compression) and napi (lz4Compression) expose the per-statement override, but the C ABI only gets the session-level client-conf key. ODBC and Go hosts therefore can't override compression per statement. Add a kernel_statement_set_lz4_compression setter, or document that the C ABI only supports the session default.
🔀 Found by Claude Opus 5.5 · the judge couldn't confirm it
There was a problem hiding this comment.
The C ABI exposes the session default through kernel_session_config_set_client_conf, which takes KernelSessionConfig in the header. ODBC's connection-string setting uses that path. Per-statement overrides are exposed by the Rust, PyO3 and napi interfaces. This is the scope confirmed in the accepted clarification.
There was a problem hiding this comment.
Still open at b305326: include/databricks_kernel.h:597-598 does not say the C ABI supports only the session default, and there is no statement setter.
Status: blocked on the dependencies and validation limitations listed below.
Feature or gap
Applications using the SQL kernel need to request compressed or uncompressed Arrow results.
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, Python, Node.js, C, and Arrow Database Connectivity (ADBC) interfaces expose the setting where they configure result compression.
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: truequeries with compressed inline results compared with the Thrift backend (542→664 ms, +22.4%); that gap is not yet resolved.