Repository navigation
Enable telemetry by default + prepare to release v1.0.9-oss - #948
Merged
samikshya-db merged 3 commits intoAug 19, 2025
Merged
Conversation
samikshya-db
marked this pull request as ready for review
August 18, 2025 19:44
gopalldb
approved these changes
Aug 19, 2025
nikhilsuri-db
approved these changes
Aug 19, 2025
nikhilsuri-db
pushed a commit
to nikhilsuri-db/databricks-jdbc
that referenced
this pull request
Aug 20, 2025
…ks#948) - [Release checklist (all tests pass)](https://docs.google.com/document/d/1t-ZHd8133w6-8v7-NOkvBCJrB5qxLKPqRkNUOpb4yVA/edit?tab=t.0) - [Telemetry readiness doc](https://docs.google.com/document/d/1oAu1pTCM9VFrPDCt0I_aWsSIoNGOapmGc_2Zob6QUiA/edit?tab=t.0#heading=h.j2e11ackxml8) - The release testing passes <!-- Share any additional context or insights that may help the reviewer understand the changes better. This could include challenges faced, limitations, or compromises made during the development process. Also, mention any areas of the code that you would like the reviewer to focus on specifically. -->
diegofanesi
pushed a commit
to diegofanesi/databricks-jdbc
that referenced
this pull request
Sep 17, 2026
## What
Transparently auto-recover the Reyden onboarding case for JDBC: when a
**default-Thrift**
connection to a Real-Time (Reyden) SQL warehouse is rejected by the
gateway with SQLSTATE
`KP001` ("Lakehouse/RT is not supported for Thrift protocol"), the
driver re-opens the session
on its SEA path (`DatabricksSdkClient`) and remembers the warehouse so
later connections skip
Thrift — no customer configuration change. This mirrors the same feature
already in the Python
(databricks#948), Go (databricks#479), and Node (databricks#523) drivers; design follows ADBC
databricks#670.
## Changes
- **`ReydenWarehouseCache`** (new): process-wide, thread-safe cache
keyed by
`host_lowercased|warehouse_id`, ~6h TTL, lazy eviction on read plus an
opportunistic sweep on
write.
- **`DatabricksSession.open`**:
- **Pre-check** — on the default Thrift path, if the warehouse is
already known-Reyden, open
SEA directly and skip the Thrift round-trip.
- **Reactive catch** — a `KP001` on the Thrift `OpenSession` marks the
cache and (default path
only) retries once on SEA. On a double failure both error chains are
preserved (SEA error as
cause, original Thrift `KP001` as a suppressed exception).
- Detection (`getSQLState() == "KP001"`) is scoped to the `OpenSession`
`createSession` call
only — there is no shared status checker that maps `KP001` elsewhere.
## Guardrail
Recovery engages only on the **default** Thrift path
(`isDefaultThriftPath()` = `UseThriftClient`
unset). An explicit `UseThriftClient=1` is honored: `KP001` is surfaced
to the caller, never
auto-switched to SEA.
### Known edge case (documented, not fixed here)
`isDefaultThriftPath()` gates on `UseThriftClient` alone. A user who
sets a Thrift-forcing
metadata param (`UseQueryForMetadata=0` or
`TreatMetadataCatalogNameAsPattern=1`) on a Reyden
warehouse will therefore be auto-recovered to SEA, silently dropping the
native-Thrift-metadata
behavior. This is judged acceptable — the connection would otherwise
hard-fail with `KP001`, and
a Reyden warehouse cannot serve Thrift metadata at all — but flagging it
for reviewer input.
## Testing
- **Unit** (`ReydenThriftAutoRecoveryTest`, 8 tests): reactive fallback
success, cache pre-check,
explicit-Thrift guardrail (2 cases incl. cached-Reyden), double-failure
error chaining,
non-`KP001` propagation, and cache host/warehouse isolation.
`DatabricksSessionTest` (21)
passes unchanged.
- **End-to-end** against a prod Reyden warehouse:
- Forced Thrift (`UseThriftClient=1`) returns the real
`TStatus(ERROR_STATUS, sqlState:KP001)`
and the guardrail surfaces it (no fallback).
- Reactive path: connect #1 recovers `KP001` → SEA (10 rows, cache
marked); connect #2
pre-checks (skips Thrift), opens SEA directly (10 rows).
## Notes
- No new `DatabricksDriverErrorCode` is introduced; the double-failure
exception reuses the
existing `CONNECTION_ERROR` code, so no telemetry-taxonomy change is
required.
- `NEXT_CHANGELOG.md` updated under `### Added`.
This pull request and its description were written by Isaac.
---------
Signed-off-by: Rahul Singhal <[email protected]>
Co-authored-by: Isaac <[email protected]>
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.
Description
Testing
Additional Notes to the Reviewer