Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 8 additions & 10 deletions CONNECTION_PARAMETERS.md
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ to change without notice.
| ------------------------------------- | ------ | :----: | :----: | ------------- | ------------------------------------------------------------------------------------------------------------- |
| `use_cloud_fetch` | `bool` | ✅ | ✅ | `True` | Set `False` at connection creation to fetch complete results without cloud-storage downloads. On the kernel path, changing this attribute after connecting does not change result delivery. |
| `max_download_threads` | `int` | ✅ | ✅ | `16` kernel, `10` Thrift | CloudFetch download window; on the kernel, counts downloading and queued chunks ahead of consumption, excluding consumer buffers. Not a byte limit. |
| `enable_query_result_lz4_compression` | `bool` | ✅ | ❌ | `True` | LZ4-compress result payloads. Not forwarded; the kernel handles compression internally. |
| `enable_query_result_lz4_compression` | `bool` | ✅ | ✅ | `True` | Request LZ4 compression for Arrow results. Set `False` to request uncompressed results. |
| `_disable_pandas` | `bool` | ✅ | ✅ | `False` | Skip the pandas-based Arrow→row deserialization and materialize rows directly with PyArrow. This is a **Python-side** result-conversion toggle, not a wire option: the kernel returns results as Arrow (`RecordBatch`es) and the connector runs the *same* `_convert_arrow_table` for both backends, so the flag is honored on the kernel path too. Affects only row fetches (`fetchone`/`fetchmany`/`fetchall`); the `fetch*_arrow` methods return the Arrow table unchanged regardless of this flag. |
| `enable_geospatial_support` | `bool` | ❌ | ✅ | `False` | Return GEOMETRY / GEOGRAPHY as `{"srid": int, "wkb": bytes}` values when `True`, or as WKT / EWKT strings when `False`. This is a local result conversion and is never forwarded to SEA. |
| `_use_arrow_native_complex_types` | `bool` | ✅ | ✅ | `True` | Return `ARRAY`/`MAP`/`STRUCT` as native Arrow types instead of JSON strings. Forwarded to the kernel. |
Expand Down Expand Up @@ -204,18 +204,16 @@ are forwarded when supported by the installed kernel binding.
2. `experimental_oauth_persistence` (custom OAuth token store).
3. TLS-client-cert *authentication* (`_use_cert_as_auth`) — note the TLS
*transport* options (`_tls_*`) themselves **are** honored on both backends.
4. Result-transport tuning:
`enable_query_result_lz4_compression`.
5. Arrow-native rendering for `_use_arrow_native_decimals` /
4. Arrow-native rendering for `_use_arrow_native_decimals` /
`_use_arrow_native_timestamps` (complex types **are** forwarded).
6. `staging_allowed_local_path` (Volume `PUT`/`GET`).
7. Retry fine-tuning beyond the four forwarded knobs: `_retry_delay_default`,
5. `staging_allowed_local_path` (Volume `PUT`/`GET`).
6. Retry fine-tuning beyond the four forwarded knobs: `_retry_delay_default`,
`_retry_dangerous_codes`, `_respect_server_retry_after_header`,
`_retry_max_redirects`, `_enable_v3_retries`.
8. `force_enable_telemetry`.
9. `_port` and `_connection_uri`.
10. `_pool_connections` and `_proxy_auth_method` do not configure the
kernel-owned network stack.
7. `force_enable_telemetry`.
8. `_port` and `_connection_uri`.
9. `_pool_connections` and `_proxy_auth_method` do not configure the
kernel-owned network stack.

### Supported on Kernel, missing / ignored on Thrift

Expand Down
2 changes: 1 addition & 1 deletion KERNEL_REV
Original file line number Diff line number Diff line change
@@ -1 +1 @@
5c3a909771f749174567af074bfe18c24a335f5c
4691f70cda81ad2b22c419d876d7aebbdbf878fe
1 change: 1 addition & 0 deletions src/databricks/sql/backend/kernel/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -666,6 +666,7 @@ def execute_command(
try:
stmt.set_sql(operation)
stmt.set_row_limit(row_limit)
stmt.set_lz4_compression(bool(lz4_compression))

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟠 High — The setter is called unconditionally on every kernel statement, but pyproject.toml still allows ^1.5.0 kernel wheels that may lack set_lz4_compression, so those installs would fail on every query. Raise the kernel version floor to a release that has the setter, and update the lockfile.

🔀 Found by both reviewers · confirmed by the judge

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

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Agreed. This PR is blocked on a published kernel release containing Statement.set_lz4_compression, followed by an update to the connector kernel dependency floor and resolved package pins before merge/release. The source integration uses the supporting commit from kernel PR databricks/databricks-sql-kernel#511; a supporting release version is not assigned yet.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Still open at 4ed87de: pyproject.toml:73 still allows ^1.5.0, and client.py:669 still calls the setter unconditionally. Merge is blocked until a kernel release raises the floor.

if query_tags:
# Per-statement query tags. The kernel serialises the
# dict (None value -> bare key) into the SEA
Expand Down
38 changes: 37 additions & 1 deletion tests/unit/test_kernel_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import types
from concurrent.futures import ThreadPoolExecutor
from typing import Optional
from unittest.mock import MagicMock
from unittest.mock import call, MagicMock

import pytest

Expand Down Expand Up @@ -1009,6 +1009,42 @@ def test_execute_command_forwards_row_limit(row_limit):
stmt.set_row_limit.assert_called_once_with(row_limit)


@pytest.mark.parametrize("async_op", [False, True])
def test_execute_command_forwards_lz4_compression_before_dispatch(async_op):
client = _make_client()
client._kernel_session = MagicMock()
cursor = MagicMock(arraysize=100, buffer_size_bytes=1024)
cases = [(True, True), (False, False), (0, False)]
statements = [MagicMock() for _ in cases]
client._kernel_session.statement.side_effect = statements

for stmt, (value, expected) in zip(statements, cases):
stmt.execute.return_value = MagicMock(
statement_id="stmt-id",
arrow_schema=MagicMock(return_value=pa.schema([("x", pa.int64())])),
)
stmt.submit.return_value.statement_id = "stmt-id"
client.execute_command(
operation="SELECT 1",
session_id=MagicMock(),
max_rows=1,
max_bytes=1,
lz4_compression=value,
cursor=cursor,
use_cloud_fetch=True,
parameters=[],
async_op=async_op,
enforce_embedded_schema_correctness=False,
)

dispatch = call.submit() if async_op else call.execute()
stmt.set_lz4_compression.assert_called_once_with(expected)
assert stmt.set_lz4_compression.call_args.args[0] is expected
assert stmt.method_calls.index(call.set_lz4_compression(expected)) < (
stmt.method_calls.index(dispatch)
)


# ---------------------------------------------------------------------------
# Staging / volume operations — fail loud (not silently no-op)
# ---------------------------------------------------------------------------
Expand Down
Loading