From 89a50edd9eb433de8f3e5e1e889bb9a318815342 Mon Sep 17 00:00:00 2001 From: Madhavendra Rathore Date: Thu, 21 May 2026 19:53:54 +0530 Subject: [PATCH] Bump databricks-sdk-java from 0.69.0 to 0.106.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit SDK 0.106 introduces native AI-coding-agent detection in com.databricks.sdk.core.UserAgent (new agentProvider() field + listKnownAgents()/lookupAgentProvider() methods + an agent/ block in asString()). SDK 0.69 had none of these. The driver's existing AgentDetector.detect() injection into UserAgent.withOtherInfo("agent", ...) at UserAgentManager.setUserAgent() now layers on top of the SDK's built-in detection. Both fire on the same env-var contract, producing two agent/ tokens in every SDK-routed request's User-Agent header (verified live via mitmproxy: agent/x2 on both SEA and Thrift on SDK 0.106 vs agent/x1 on SDK 0.69). Remove the driver-side injection in setUserAgent so the SDK is the single source for the agent/ token (and gains coverage for two agents the driver's list misses: Augment and Windsurf). The hand-built buildUserAgentForConnectorService path keeps its own AgentDetector.detect() call because that bootstrap UA is constructed via StringBuilder and never goes through UserAgent.asString() — no SDK-side injection happens there. Audit performed by diffing every driver-imported SDK class between 0.69 and 0.106. The agent collision was the only behavior-impacting delta on the driver's hot path. Other SDK additions (workspaceId / accountId / discoveryUrl / tokenAudience auto-population in DatabricksConfig.resolve(), CachedTokenSource dynamic stale period, X-Databricks-Org-Id auto-injection in SDK service impls) either don't reach driver code paths (driver bypasses SDK service impls via apiClient.execute() direct) or only populate when the corresponding config field is null (driver-set values win). Live verified on SDK 0.106 against pecotesting (Azure SPOG + Legacy) and PECOAWS workspaces: - PAT, M2M Databricks-OIDC, AAD SP, U2M browser, U2M refresh-token cache reuse — all PASS - Multi-chunk download (10k rows), prepared statements, complex types (ARRAY/MAP/STRUCT), metadata APIs, 50x connection lifecycle — all PASS - mitm-captured wire: agent/x1 on both SEA and Thrift after the one-line removal in setUserAgent NO_CHANGELOG=false Co-authored-by: Isaac Signed-off-by: Madhavendra Rathore --- NEXT_CHANGELOG.md | 1 + pom.xml | 2 +- .../java/com/databricks/jdbc/common/util/UserAgentManager.java | 3 --- 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/NEXT_CHANGELOG.md b/NEXT_CHANGELOG.md index c56180872..ea019e959 100644 --- a/NEXT_CHANGELOG.md +++ b/NEXT_CHANGELOG.md @@ -59,6 +59,7 @@ upgrading. These changes do not affect metadata on All-Purpose Clusters. protocol. To revert to native Thrift metadata RPCs, set `UseQueryForMetadata=0`. ### Updated +- Bump `databricks-sdk-java` from 0.69.0 to 0.106.0. The driver's own `AgentDetector` injection in `UserAgentManager.setUserAgent` is removed because SDK 0.106 now natively emits the `agent/` User-Agent token via its built-in `UserAgent.agentProvider()`; keeping both layered produced a duplicate token on every SDK-routed request. The bootstrap `buildUserAgentForConnectorService` path retains its own `AgentDetector` call because it bypasses `UserAgent.asString()`. - `getColumnTypeName()` for DECIMAL columns now preserves precision/scale suffix (e.g., `"DECIMAL(10,2)"`) consistently across both Thrift and SEA backends. - `EnableGeoSpatialSupport` no longer requires `EnableComplexDatatypeSupport=1`. Geospatial types (GEOMETRY, GEOGRAPHY) can now be enabled independently of complex type support (ARRAY, MAP, STRUCT). - Arrow schema deserialization failures (Thrift metadata path) now surface a dedicated driver error code `ARROW_SCHEMA_PARSING_ERROR` (vendor code `22000`) and a proper SQLSTATE `22000` (Data Exception) on the thrown `SQLException`, instead of the generic `RESULT_SET_ERROR` (1004) and the enum name as SQLSTATE. The exception message is unchanged. diff --git a/pom.xml b/pom.xml index 93f56bd4e..16334f4a4 100644 --- a/pom.xml +++ b/pom.xml @@ -69,7 +69,7 @@ 3.18.0 2.15.0 2.14.0 - 0.69.0 + 0.106.0 4.5.14 5.5.2 5.3.6 diff --git a/src/main/java/com/databricks/jdbc/common/util/UserAgentManager.java b/src/main/java/com/databricks/jdbc/common/util/UserAgentManager.java index 446e29df6..201bf6c66 100644 --- a/src/main/java/com/databricks/jdbc/common/util/UserAgentManager.java +++ b/src/main/java/com/databricks/jdbc/common/util/UserAgentManager.java @@ -63,9 +63,6 @@ public static void setUserAgent(IDatabricksConnectionContext connectionContext) } } } - - // Detect AI coding agent and append to user agent - AgentDetector.detect().ifPresent(product -> UserAgent.withOtherInfo(AGENT_KEY, product)); } /**