Repository navigation
Add bounded SEA API support for CloudFetch (UseBoundedSeaApi) - #1468
Conversation
e8e6bde to
e9dcd7c
Compare
d6b9994 to
1fa1b2b
Compare
Part 1 of bounded SEA API compliance for CloudFetch:
1. New connection property UseBoundedSeaApi (default 0/off). When enabled:
- Sends row_offset query parameter on GetResultData requests
- Forces StreamingChunkProvider (which uses next_chunk_index, not
total_chunk_count) even when streaming is explicitly disabled
2. StreamingChunkProvider already uses next_chunk_index for continuation
and end-of-stream detection — no changes needed to its core logic.
3. Legacy RemoteChunkProvider (uses total_chunk_count) is bypassed when
bounded SEA is enabled.
row_offset is derived from the previous link's row_offset + row_count
and sent as a query parameter on /sql/statements/{id}/result/chunks/{idx}.
This is required for future >100GB results and cluster-side fetch.
Co-authored-by: Isaac
Signed-off-by: Gopal Lal <[email protected]>
During coalesced link refresh, the server may return links for chunks not yet in the provider's map (newly-discovered chunks beyond highestKnownChunkIndex). Previously these were silently skipped. Now: create new chunks from refresh response links, update highestKnownChunkIndex, and set endOfStreamReached from the response's hasMore flag. Follows the per-chunk state-machine reconciliation from the bounded SEA API spec. Co-authored-by: Isaac Signed-off-by: Gopal Lal <[email protected]>
Fixes 3 gaps found by comparing with the legacy ChunkDownloadTask: 1. Outer catch(Throwable) + exception chaining in finally: uncaught exceptions were lost — the finally block created a generic exception without the original cause. Now captures uncaughtException and chains it, matching ChunkDownloadTask's pattern. 2. Thread context propagation: download threads had no connection context or statementId for telemetry/logging. Now captures caller's context via DatabricksThreadContextHolder and clears in finally. 3. Download timing: added task-level timing log (totalMs, retries) matching ChunkDownloadTask's diagnostics. Also includes the RuntimeException catch (parity with PR databricks#1302). Co-authored-by: Isaac Signed-off-by: Gopal Lal <[email protected]>
P0-1: Remove redundant chunk.setStatus(DOWNLOAD_FAILED) in inner catch — defer entirely to finally block. Fixes StreamingChunkDownloadTaskTest. P0-2: Add NEXT_CHANGELOG.md entry under ### Added for UseBoundedSeaApi. P1-1: Call triggerDownloads() after reconciliation creates new chunks from refresh response — prevents newly-discovered chunks sitting PENDING. P1-2/P1-3: Un-gated changes (new chunk creation, EOS from refresh, triggerDownloads) are intentional parity fixes for all EnableStreamingChunkProvider=1 users. EnableStreamingChunkProvider defaults to off, so default users are unaffected. P1-4: Revert RuntimeException from inner catch — DatabricksError is caught by outer catch(Throwable) and fails immediately (no retry), matching ChunkDownloadTask behavior exactly. NPE/ISE won't be retried. P2-1: Always send row_offset (even 0 for chunk 0) when bounded SEA enabled — explicit is safer than relying on server default. P2-3: Update nextLinkFetchIndex after reconciliation to avoid prefetch thread re-fetching chunks already discovered via refresh. P2-5: Add "Requires server support" to connection property help text. Co-authored-by: Isaac Signed-off-by: Gopal Lal <[email protected]>
…on updates P1-1: Use putIfAbsent in createChunkFromLink to prevent double row-count and chunk replacement when called concurrently from prefetch and download threads. Without this, a race could leave a CompletableFuture that is never completed, causing consumer hangs. P1-2: Bundle nextLinkFetchIndex + nextRowOffsetToFetch into an immutable FetchPosition holder updated via volatile reference. This ensures the prefetch thread always reads a consistent (index, rowOffset) pair, which matters for bounded SEA API where row_offset is used by the server. P2-1: Bump reconciliation failure log from DEBUG to WARN for production visibility. Signed-off-by: Gopal Lal <[email protected]> Co-authored-by: Isaac Signed-off-by: Gopal Lal <[email protected]>
5801928 to
7e0b2c1
Compare
…h path
Per the bounded SEA API contract, drivers must not depend on
manifest.{chunks, total_chunk_count, total_row_count}. Pass null for
totalChunkCount when converting initial ExternalLinks for
StreamingChunkProvider — the provider derives end-of-stream from
next_chunk_index on ExternalLink instead.
Signed-off-by: Gopal Lal <[email protected]>
Co-authored-by: Isaac
Signed-off-by: Gopal Lal <[email protected]>
…ast/isAfterLast When boundedSeaApiEnabled=true, isLast() and isAfterLast() now use hasNext() instead of resultSetMetaData.getTotalRows(). The bounded SEA API contract does not guarantee manifest.total_row_count is populated; the chunk providers derive end-of-stream from next_chunk_index instead. Gated behind isBoundedSeaApiEnabled() + ArrowStreamResult instanceof check so existing Thrift and non-bounded SEA behavior is unchanged. Signed-off-by: Gopal Lal <[email protected]> Co-authored-by: Isaac Signed-off-by: Gopal Lal <[email protected]>
| if (downloadSuccessful) { | ||
| chunk.getChunkReadyFuture().complete(null); | ||
| } else { | ||
| LOGGER.info( |
There was a problem hiding this comment.
this should be at error level
- Add EmptyChunkProvider for total_chunk_count==0 short-circuit - Wire empty result handling into ArrowStreamResult SEA constructor - Add 4 unit tests for empty result behavior in ArrowStreamResultTest - Add 3 refresh reconciliation tests in StreamingChunkProviderTest - Add BoundedSeaApiCloudFetchIntegrationTests with WireMock stubs recorded from staging (single-chunk, multi-chunk, empty result) - Fix FakeServiceConfigLoader user agent to match real driver format (server gates INLINE_OR_EXTERNAL_LINKS on user agent) - Remove unrelated changelog entries from NEXT_CHANGELOG.md Co-authored-by: Isaac Signed-off-by: Gopal Lal <[email protected]>
…treamingChunkProvider Replace sequential currentChunkIndex.incrementAndGet() and nextDownloadIndex with ConcurrentLinkedQueue-based consumption and download ordering. Chunks are now consumed and downloaded in the order the server provides them via next_chunk_index, which may not be sequential under the bounded SEA API. Signed-off-by: Gopal Lal <[email protected]> Co-authored-by: Isaac Signed-off-by: Gopal Lal <[email protected]>
…g path - Track whether all chunks were created during refresh reconciliation; only advance nextFetchPosition if so, preventing a permanent hang when createChunkFromLink fails for an intermediate chunk. - Convert single-chunk bounded-SEA test from inline attachment to external_links so it actually exercises the StreamingChunkProvider CloudFetch path. Add isCloudFetchUsed assertion. Co-authored-by: Isaac Signed-off-by: Gopal Lal <[email protected]>
| // Bounded SEA API: manifest.total_row_count is not populated, so use hasNext() | ||
| // which derives end-of-stream from next_chunk_index via the chunk provider. | ||
| if (boundedSeaApiEnabled && executionResult instanceof ArrowStreamResult) { | ||
| return executionResult.getCurrentRow() >= 0 && !executionResult.hasNext(); |
There was a problem hiding this comment.
isAfterLast() returns true while the cursor is ON the last row — drops the final row.
The bounded-SEA branch of isAfterLast() (:953) uses the exact same predicate as the bounded branch of isLast() (:997): executionResult.getCurrentRow() >= 0 && !executionResult.hasNext().
Because ArrowStreamResult.next() returns early (if (!hasNext()) return false;) before incrementing currentRowIndex, getCurrentRow() holds the last row's index both while positioned on the last row and after a next() that returned false. Once the cursor reaches the last row, hasNext() is already false, so isAfterLast() returns true while still on the last row — and isLast() returns true for the same state. The two are meant to be mutually exclusive there.
Impact: the common cursor loop while (!rs.isAfterLast()) { rs.next(); process(rs); } exits before processing the last row, silently dropping it. The integration test only checks isAfterLast() after the while(rs.next()) loop has fully exited, so it never exercises the on-last-row state.
Suggested fix
make isAfterLast() mean "a prior next() returned false" — track an explicit exhausted/past-end flag rather than reusing the isLast() expression.
/full-review · feedback: #code-review-squad-feedback
| } | ||
|
|
||
| @Test | ||
| void testBoundedSeaApiMultiChunkQuery() throws SQLException { |
There was a problem hiding this comment.
The headline row_offset behavior has zero test coverage.
The PR's stated core change — GetResultData sends ?row_offset=<offset> (DatabricksSdkClient.getResultChunks) — is never exercised or asserted. The multi-chunk fixture returns all three chunks' external_links inline in the initial POST /statements response with hasMore=false, so getResultChunks is never invoked and ?row_offset= is never sent. No WireMock mapping matches result/chunks/N?row_offset=... and no test verifys the query param.
A bug in the row_offset path (wrong offset, missing param, appended when the flag is off, wrong encoding) would ship undetected.
Suggested fix
add a unit test on DatabricksSdkClient.getResultChunks (mock IDatabricksConnectionContext with isBoundedSeaApiEnabled() true/false) asserting the request path contains ?row_offset=<expected> when enabled and not when disabled. Alternatively add an integration scenario whose chunk fetch is actually triggered (links not fully inline) with a mapping keyed on withQueryParam("row_offset", ...) + a verify.
/full-review · feedback: #code-review-squad-feedback
| } | ||
|
|
||
| @Test | ||
| public void testEmptyChunkProvider() { |
There was a problem hiding this comment.
Bounded-SEA StreamingChunkProvider selection + null totalChunkCount contract is not asserted.
The new tests cover only the EmptyChunkProvider (total_chunk_count == 0) path. No test asserts that with isBoundedSeaApiEnabled() == true and remote links, ArrowStreamResult selects a StreamingChunkProvider AND passes null for totalChunkCount (the "must not depend on total_chunk_count" contract). The multi-chunk integration fixture even supplies a valid total_chunk_count: 3, so a regression reverting to resultManifest.getTotalChunkCount() for the bounded path would still pass every test — then break against real bounded servers that don't populate it.
Suggested fix
add a test with UseBoundedSeaApi=1 and remote external links asserting the chosen provider is a StreamingChunkProvider and that iteration completes correctly when total_chunk_count is null/absent (chaining purely on next_chunk_index).
/full-review · feedback: #code-review-squad-feedback
| if (isInlineArrow) { | ||
|
|
||
| Long totalChunkCount = resultManifest.getTotalChunkCount(); | ||
| if (totalChunkCount != null && totalChunkCount == 0) { |
There was a problem hiding this comment.
Empty-result short-circuit keys off total_chunk_count — the field bounded mode forbids relying on — and is ungated.
The new empty-result branch routes to EmptyChunkProvider only when totalChunkCount != null && totalChunkCount == 0. But this PR's own createRemoteChunkProvider comment (and :131) asserts that under bounded SEA the driver must not depend on manifest.total_chunk_count and passes null for it. A real bounded-SEA server that omits total_chunk_count for an empty result therefore does NOT hit this fast path — it falls through to StreamingChunkProvider with empty links and incurs an extra GetResultData RPC to discover end-of-stream. This branch also runs on the default (non-bounded) path, while the PR frames all changes as off-by-default. The testBoundedSeaApiEmptyResult test masks the gap because its fixture still carries total_chunk_count: 0.
Suggested fix
either gate the empty short-circuit on isBoundedSeaApiEnabled() to match the stated contract, or (if unconditional is intended) add a code comment saying so and derive the bounded empty case from the link stream rather than total_chunk_count; make the empty-result integration fixture omit total_chunk_count so it exercises the real contract.
/full-review · feedback: #code-review-squad-feedback
| // Prefetch for chunk 2 should NOT be called since refresh discovered end-of-stream | ||
| lenient() | ||
| .when(mockLinkFetcher.fetchLinks(eq(2L), anyLong())) | ||
| .thenThrow(new AssertionError("Prefetch should not fetch chunk 2 after end-of-stream")); |
There was a problem hiding this comment.
thenThrow(new AssertionError(...)) prefetch guards are inert — they cannot fail the test.
testRefreshSetsEndOfStream (:1742) and testRefreshAdvancesFetchPosition (:1790) install thenThrow(new AssertionError(...)) as a guard that prefetch must not fetch a given chunk. But that fetchLinks call runs on the background prefetch thread, and AssertionError is a Throwable — it is not caught by linkPrefetchLoop's catch(Exception), so it silently kills the prefetch thread without failing the main test thread. If a regression caused prefetch to fetch the guarded chunk, these tests would still pass. The intended negative assertion is a no-op.
Suggested fix
replace the thenThrow(AssertionError) guards with an explicit verify(mockLinkFetcher, never()).fetchLinks(eq(2L), anyLong()) (and eq(3L)) after consumption completes.
/full-review · feedback: #code-review-squad-feedback
Code Review Squad — ReviewScore: 51/100 — HIGH RISK Bounded SEA CloudFetch support is off-by-default, but two verified High-severity correctness bugs affect the shared StreamingChunkProvider / ResultSet paths (not just bounded mode): a lost-wakeup that hangs Could not post inline comments for: F1, F7 — see body below. Critical & High FindingsF1 (High) —
|
| } | ||
|
|
||
| /** Waits until the prefetch thread enqueues a chunk index into the consumption queue. */ | ||
| private void waitForNextChunkEnqueued() throws DatabricksSQLException { |
There was a problem hiding this comment.
Consumer ResultSet.next() can hang indefinitely at end-of-stream (lost wakeup).
This method parks on the chunkCreated condition while !closed && consumptionOrder.isEmpty() && !endOfStreamReached. But the sites that set endOfStreamReached = true on the clean end-of-stream path — fetchNextLinkBatch() (isEndOfStream() at :443 and hasMore=false at :456) and getRefreshedLink (:676) — do not call notifyChunkCreated(), and they write the flag outside prefetchLock. That's a classic lost-wakeup:
- Consumer drains the last enqueued chunk, polls an empty
consumptionOrder. - Checks
endOfStreamReached— stillfalse(the finalhasMore=falselink-fetch RPC is in flight). - Enters
waitForNextChunkEnqueued, re-checks the guard under the lock (still false), callschunkCreated.await(). - Prefetch thread completes the RPC, sets
endOfStreamReached = true, exits the loop without signaling. - The parked consumer wakes only on
close()→rs.next()hangs until the statement/connection is closed.
This affects the whole StreamingChunkProvider path (EnableStreamingChunkProvider or UseBoundedSeaApi), not only bounded mode. (Re-posted here because line 443 was not on a diffed line; the fix touches the EOS-set sites listed above.)
Suggested fix
call notifyChunkCreated() immediately after every endOfStreamReached = true (both branches in fetchNextLinkBatch and the one in getRefreshedLink), OR change this method to chunkCreated.await(timeout, unit) with a bounded poll so the loop guard is re-checked periodically.
/full-review · feedback: #code-review-squad-feedback
- Fix lost-wakeup in waitForNextChunkEnqueued: call notifyChunkCreated() after every endOfStreamReached = true (fetchNextLinkBatch both branches, getRefreshedLink, processInitialLinks) to wake parked consumers. - Fix isAfterLast() returning true while ON last row: add boundedSeaExhausted flag set only when next() returns false, so isAfterLast() is true only after the cursor moves past the last row. - Raise download failure log from INFO to ERROR in StreamingChunkDownloadTask. - Fix AssertionError guards in tests: replace thenThrow(AssertionError) with verify(never()).fetchLinks() as the prefetch thread silently swallows AssertionErrors, making the guards inert. - Add testBoundedSeaApiUsesStreamingChunkProviderWithNullTotalChunkCount asserting that UseBoundedSeaApi=1 + null totalChunkCount routes to StreamingChunkProvider (guards against regression to getTotalChunkCount()). - Fix testLinkFetchFailure to expect exception from next() (not getChunk()) now that prefetch error is woken up via notifyChunkCreated(). Co-authored-by: Isaac Signed-off-by: Gopal Lal <[email protected]>
- ArrowStreamResult: treat empty external_links + null totalChunkCount as end-of-stream for the bounded-SEA path. Previously this returned null initialLinks causing StreamingChunkProvider to fetch chunk 0 via getResultChunks — which fails on servers that omit total_chunk_count for empty results per the bounded contract. - Remove total_chunk_count from empty-result WireMock fixture so the integration test exercises the real bounded-SEA empty path (no total_chunk_count reliance). - Add testGetResultChunks_boundedSeaEnabled_appendsRowOffset and testGetResultChunks_boundedSeaDisabled_noRowOffset to DatabricksSdkClientTest asserting the ?row_offset= query param is present/absent based on the flag. - Fix remaining test race conditions in RefreshReconciliation tests. Co-authored-by: Isaac Signed-off-by: Gopal Lal <[email protected]>
|
Fixed. Added This comment was generated with GitHub MCP. |
|
Fixed in two parts:
This comment was generated with GitHub MCP. |
|
Fixed — changed This comment was generated with GitHub MCP. |
|
Fixed. Added This comment was generated with GitHub MCP. |
|
Fixed. Added This comment was generated with GitHub MCP. |
|
Fixed. Replaced This comment was generated with GitHub MCP. |
|
Fixed. Added two unit tests in
This comment was generated with GitHub MCP. |
vikrantpuppala
left a comment
There was a problem hiding this comment.
LGTM — all 3 High findings (EOS lost-wakeup hang, isAfterLast dropping the last row, missing row_offset test coverage) and the substantive Medium findings from the review are addressed and verified against the current head. Remaining items (F7 lock-scope, minor Low nits) are acceptable follow-ups.
Note: branch currently has merge conflicts with main and CI hasn't reported on this head yet — please rebase and confirm CI is green before merging.
Co-authored-by: Isaac Signed-off-by: Gopal Lal <[email protected]>
Remove EnableSQLExecHybridResults=1 from setUp() — hybrid mode attempts a Thrift TOpenSession first and these tests only have SEA session stubs, causing a 404 in CI. UseThriftClient=0 is already injected by getValidJDBCConnection via FakeServiceConfigLoader for the SQL_EXEC fake service type. Co-authored-by: Isaac Signed-off-by: Gopal Lal <[email protected]>
…rvice mode CI runs two integration test jobs: one with FAKE_SERVICE_TYPE=SQL_EXEC and one with FAKE_SERVICE_TYPE=THRIFT_SERVER. The Bounded SEA tests have SEA-only WireMock stubs, so they must be skipped in Thrift mode. Use assumeTrue with isSqlExecSdkClient() to skip gracefully instead of failing with a 404 on TOpenSession. Co-authored-by: Isaac Signed-off-by: Gopal Lal <[email protected]>
testGetResultSet_externalLink stubs getHttpMaxConnectionsPerRoute() and getCloudFetchThreadPoolSize() but the test uses total_chunk_count=0 with no external links, which now routes to EmptyChunkProvider without touching the cloud-fetch config. Mark those stubs lenient so Mockito strict-stubbing check doesn't fail. Co-authored-by: Isaac Signed-off-by: Gopal Lal <[email protected]>
…se hasMore=true The refresh stubs for chunks 1 and 4 used hasMore=false, which after the lost-wakeup fix causes getRefreshedLink to set endOfStreamReached=true and signal the consumer immediately — terminating iteration before chunks 3-5 are fetched. The stubs now use hasMore=true with the correct nextFetchIndex so the refresh doesn't falsely signal end-of-stream. Co-authored-by: Isaac Signed-off-by: Gopal Lal <[email protected]>
…se tests The closeStatement stubs in testReExecutionHandlesCloseFailureGracefully and testReExecutionHandlesTransportErrorGracefully are set up for an async close path. On slow CI runners the background close thread may not execute before Mockito's afterEach check, causing UnnecessaryStubbingException. Mark them lenient so the strict-stubbing check doesn't fire when the async task is slow. Co-authored-by: Isaac Signed-off-by: Gopal Lal <[email protected]>
## Description Syncs `jdk-8` with `main` at `a64ae0e0` (**3.4.3**) and applies the JDK 8 changes from `.claude/commands/sync-jdk8-branch.md`. I followed the updated version of that skill from `main` (#1298), which this merge also brings into `jdk-8`. Replaces #1717. - **Scope:** 173 commits from `main` since the last sync point, `3ef86030` (#1270, synced via #1275). That covers releases 3.3.1, 3.3.2, 3.3.3, 3.4.2 and 3.4.3. - **Merge base:** #1275 was squash-merged, so git's merge base for `jdk-8`/`main` is still #1150 (`23a0bbdc`). A plain `git merge origin/main` would re-conflict changes that were already synced. I merged with `3ef86030` as the base (using a temporary graft), so only changes since the last sync were merged. This is a real merge commit: its parents are the `jdk-8` tip and the `main` tip. ### JDK 8 changes **Root `pom.xml`** - Source/target stay at `1.8`. The JDK 8 pins stay: Arrow `13.0.0`, Mockito `4.11.0`, nimbus-jose-jwt `9.47`. - Spotless stays removed entirely. Main's spotless plugin block was not merged. - OWASP `dependency-check-maven` is removed (plugin, `pluginManagement` entry and version property). Version 12.x needs Java 11, so it breaks `mvn install` on JDK 8. On `main`, OSV replaced OWASP as the security gate (#1460). - Kept from `main`: the dependency bumps, the CycloneDX aggregate-SBOM plugin (works on JDK 8), and the `dependencyManagement` CVE overrides for commons-lang3 and gson. **`jdbc-core/pom.xml`** - No WireMock dependency and no `--add-opens`. - The `jdk17-NioNotOpen` and `jdk21-NioNotOpen` profiles, the Arrow-patch JaCoCo exclusions, and the `!Jvm17PlusAndArrowToNioReflectionDisabled` group filter are removed. - Surefire excludes the fakeservice and e2e tests. **Workflows** - `coverageReport.yml`: JDK 8, 80% threshold, and `mvn -pl jdbc-core clean test -Dspotless.skip=true jacoco:report`. - All other workflows match `main`. That fixes a duplicated "Compile" step the merge produced in `prCheckJDK8.yml`. **Java 9+ APIs in code added on `main` since the last sync** - `List.of`, `Set.of`, `Map.of` and `List.copyOf` became Guava `ImmutableList`/`ImmutableSet`/`ImmutableMap` in main code, and `Arrays.asList` or `Collections.empty*` in tests. - `String.isBlank()`/`strip()` became `trim().isEmpty()`/`trim()`. - `Objects.requireNonNullElse` became a null-check ternary. - `Optional.isEmpty()` became `!isPresent()`. - `Files.writeString` became `Files.write`. - An anonymous-class diamond became an explicit type. - JDBC 4.3: removed `supportsSharding()` again and dropped the `beginRequest`/`endRequest` test asserts. - Conflicts were resolved keeping the existing `jdk-8` rewrites and applying main's logic changes on top. **Removed** - The fakeservice and e2e tests, plus `IntegrationTestUtil` and `DatabricksDriverExamples` (which uses it). - All WireMock resources. That includes `sqlexecapi`, `thriftserverapi` and `cloudfetchapi`, plus leftover `sqlgatewayapi`, `cloudfetchsqlgatewayapi`, `cloudfetchthriftserverapi`, `jwttokenendpoint`, `__files` and the `*fakeservicetest.properties` files. Only the removed fakeservice tests used them. - The Arrow patch sources (#1243), their tests, and `src/test/resources/arrow`. ### Cleanup beyond the skill I removed 23 Java sources that exist only on `jdk-8`: they were never on `main`, or were deleted from it long ago. They came back in the 2025-09 "post merge" commit `de3efe43`. Nothing references them: - `api/IDatabricksConnectionContext` and `api/IDatabricksSession`, stale duplicates of the `api.internal` interfaces - `ChunkDownloadCallback` - `VolumeOperationProcessorDirect` - `OAuthEndpointResolver` - `ErrorCodes`, `ErrorTypes` - `DeviceInfoLogUtil` - 15 old Thrift-generated classes (`TDBSql*`, `TExpressionInfo`, `TSQLVariable`, etc.) Non-code leftovers (`release-notes/v1.0.x`, `.vscode/settings.json`, `runBenchmarks.yml`) are unchanged. ## Testing All runs were local on OpenJDK 1.8.0: - `mvn clean install -DskipTests -Dspotless.skip=true` (the `prCheckJDK8` "Compile" step): BUILD SUCCESS for all 6 modules. - `mvn -pl jdbc-core test -Dspotless.skip=true` (the `prCheckJDK8` unit-test step): 3,569 tests, 0 failures, 0 errors, 0 skipped. - The built core, thin and uber jars are all Java 8 bytecode (class-file major version 52; `javap` on `com.databricks.client.jdbc.Driver` reports 52). - Dependency audit: none of the 85 jars on jdbc-core's test classpath contains classes newer than Java 8 (multi-release `META-INF/versions` entries excluded). - `TestThinPackaging`/`TestUberPackaging`: the offline packaging checks pass. `executeLargeQuery` needs live workspace credentials, so it wasn't run. ## Telemetry Errors - [x] Not applicable — this PR does not add or change a telemetry-visible error. It only syncs changes already reviewed on `main`. - [ ] Applicable — the error uses `DatabricksDriverErrorCode` where appropriate, and any new code is uniquely numbered and tested. - [ ] Applicable — its driver/server/user classification is linked, or maintainer help is requested because the author cannot access the classification. ## Additional Notes to the Reviewer - The reviewable part is the JDK 8 delta against `main` (`git diff origin/main...` on this branch): the poms, `coverageReport.yml`, and the Java 8 rewrites listed above. Everything else is `main`'s code as already reviewed. - Spotless doesn't run on `jdk-8`. I formatted the lines I touched with google-java-format 1.18.1, the version `main` uses. <details><summary>Synced commits (173)</summary> - Honor Auth_Scope for OAuth M2M client credentials (#1707) - chore(security): remediate OSV findings (#1716) - Fix SEA UserAgentEntry attribution in Query History (#1709) - Fix M2M private-key integration test session stub (#1703) - Bump org.apache.httpcomponents.client5:httpclient5 from 5.6.3 to 5.6.4 (#1656) - Run Jira automation on protected runner (#1696) - Automate Jira tickets for new GitHub issues (#1694) - chore(security): remediate OSV findings (#1690) - Bump JDBC driver version to 3.4.3 (#1689) - Add session version exchange to SQL Exec API client (#1678) - Auto-recover Reyden Thrift rejection to SEA (KP001) (#1683) - fix(metadata): order getTypeInfo rows by DATA_TYPE (#1680) - Update Apache Thrift to 0.24.0 (#1682) - Fix logging when an OFF connection initializes first (#1670) - Enable native SEA metadata defaults behind server flag (#1672) - Fix NPE on materialising nested arrays or arrays of maps with `NULL` elements. (#1659) - Add Thrift-native metadata support (#1641) - Fix blocking security scan findings on main (#1663) - Fix NPE for incomplete JDBC URLs (#1646) - [2/7] Add native batching configuration and parameter model (#1621) - Fix duplicate JDBC connection parameters (#1652) - Add telemetry error classification guardrails (#1629) - [1/7] Isolate legacy prepared statement batch execution (#1620) - ci: wire merge_group triggers into required-check workflows (#1582) - feat(learning): add daily engineer-bot retrospective flow + bump engine to 654a31d0 (#1635) - Add Thrift V10 batch parameter wire model (#1602) - Update 3.4.1 metadata release notes (#1578) - ci: warm test deps for Engineer Bot's offline agent + bump timeout (#1588) - Improve SEA connection-failure error messages (#1587) - Fix invalid AuthMech crashing with Recursive update / StackOverflowError (#1586) - Throw SQLException for out-of-range column in Arrow getObject (#1557) - Use SHOW COLUMNS IN ALL CATALOGS for getColumns with null catalog (same-repo, integration-test verification) (#1580) - Fix PreparedStatement.getMetaData() returning null for CTE (WITH ...) queries [PECOBLR-3778] (#1581) - feat(bots): onboard reviewer + engineer bots to databricks-bot-engine (#1583) - ci: dispatch coverage-fanout on merged source PRs (#1575) - Fix NPE reading STRING COLLATE columns via Arrow (#1548) - Throw SQLException for wrong complex-type getter calls (#1561) - [test] Make nested timestamp assertions timezone-safe (#1565) - [connection] Guarantee resource cleanup during close (#1564) - Harden OSV security-scan gate (fail-closed) + drop SMTP email (#1563) - Fix IdleConnectionEvictor thread leak when connection.close() fails due to expired token (#1559) - Bump to version 3.4.2 (#1551) - Align Thrift statement-error vendor code with SEA (EXECUTE_STATEMENT_FAILED) (#1549) - Fix MAP with complex value type rendering as empty via Arrow (#1505) (#1546) - Stream CloudFetch chunk decompression to bound memory and prevent OOM on large results (#1509) - Add bounded SEA API support for CloudFetch (UseBoundedSeaApi) (#1468) - Preserve TIMESTAMP_NTZ type name in ResultSetMetaData (#1495) (#1519) - Bump anthropics/claude-code-action from 1.0.79 to 1.0.166 (#1538) - Bump actions/setup-java from 4.8.0 to 5.4.0 (#1542) - Bump peter-evans/create-pull-request from 7.0.11 to 8.1.1 (#1541) - Bump actions/cache/save from 4.3.0 to 6.1.0 (#1540) - Bump dawidd6/action-send-mail from 3.12.0 to 18 (#1539) - Fix JulLogger CPU burn from unconditional stack-trace walk (#1511) (#1515) - Fix telemetry misattribution across connections on the same thread (#1531) - Accept OAuth M2M client id/secret via JDBC user/password (#1132) (#1533) - Bump actions/checkout from 4.3.1 to 7.0.0 (#1484) - Bump dawidd6/action-send-mail from 3.11.0 to 3.12.0 (#1486) - Bump actions/github-script from 7.0.1 to 9.0.0 (#1488) - Bump softprops/action-gh-release from 1 to 3 (#1487) - Bump actions/stale from 8.0.0 to 10.3.0 (#1479) - Add release notes for v3.4.1 (#1522) - Harden OAuth U2M token cache encryption and file permissions (#1520) - Make Connection.setReadOnly a no-op instead of throwing (#1523) - Bump shaded jackson 2.18.7 to 2.18.8 to fix CVE-2026-54512 and CVE-2026-54513 in uber jar (#1507) - Use offline cache for Security Scan on fork PRs (#1514) - Fix Maven cache warmer to cache surefire-junit-platform provider (#1513) - Redact credentials in DatabaseMetaData.getURL() and parse errors (#1502) - Redact Azure and GCS presigned URL credentials in logs (#1501) - Redact access token before logging in setClientInfoProperty (#1498) - Bump Databricks SDK for Java from 0.106.0 to 0.118.0 (#1500) - Fix getColumns() flooding DriverManager log writer with stack traces (#1494) - Fix timezone-shifted TIMESTAMP in nested complex types (ES-1978662) (#1492) - Fix closeOnCompletion() infinite recursion on ResultSet/Statement close (ES-1978361) (#1493) - Harden binary parameter interpolation against SQL injection (#1497) - Fix supportsBatchUpdates() to honor EnableBatchedInserts (#1496) - Surface truncated flag from SEA result manifest (#1503) - Use async wait timeout for SEA when direct results disabled (fix hybrid-path truncation) (#1476) - Fix metadata identifiers containing backticks (#1474) - Fix chunk download failures mis-bucketed as CONNECTION_ERROR in telemetry (#1469) - Fix double backtick wrapping in setCatalog and setSchema (#1454) - v3.4.1 Bump (#1467) - Bump databricks-sdk-java from 0.69.0 to 0.106.0 (#1465) - Add debug logging for connector-service feature flags request and response (#1462) - [PECOBLR-2321] Result Set Heartbeat / Keep-Alive for Ongoing Query Executions (#1415) - Unify weekly + per-PR security scanning into a single workflow (#1460) - Fix PreparedStatement.getMetaData() crash for SQL type aliases (#1289) - Bump shaded bouncycastle and libthrift to clear remaining CVE findings (#1461) - Fix telemetry HTTP client socket leak preventing CRaC checkpoint (#1333) - Deprecate EnableArrow — Arrow always enabled except on AIX/IBM Power (#1450) - Fix DML misclassification for statements containing UNION/INTERSECT/EXCEPT (#1420) - Fix client-side maxRows enforcement in ResultSet.next() (#1448) - Bump shaded jackson, httpcore5-h2, netty, commons-configuration2, lz4 to address CVEs (#1456) - Proactive server-side statement close when results consumed (#1444) - Update NEXT_CHANGELOG with detailed breaking changes for 3.4.1 (#1449) - Fix getTables(types=[]) returning rows in Thrift mode (#1451) - Close server-side operation on Statement re-execution (#1422) - Fix SQLInterpolator treating ? in comments and literals as placeholders + shorten next_changelog (#1424) - Enable native geospatial type support by default (#1446) - Add MetadataOperationTimeout support for SHOW commands metadata path (#1417) - [ES-1884446] Classify transient/mis-categorized server errors with retryable SQL states (#1430) - Distinguish Arrow schema parsing failures from generic ResultSet errors (#1443) - Add server-side SAFE flag for UseQueryForMetadata rollout on DBSQL (#1437) - Decouple geospatial support from complex datatype flag (#1438) - Update release-notes.txt for 3.3.3 and mark 3.3.2 as DEPRECATED (#1441) - Cut new release 3.3.3 (#1434) - Fix unresolvable 3.3.2 Maven Central POM for uber jar (#1432) - Fix main CI: JFrog mirror bypass and Windows pwsh parse error (#1428) - Cut new release 3.3.2 (#1419) - Enable release freeze for 3.3.2 (#1427) - Fix cancel error handling: vendor code, telemetry level, SEA async path (#1425) - Improve error messages for transient HTTP failures during Thrift polling (#1426) - Fix SEA result expiry error handling — preserve server error message (#1302) - Fix ambiguous errors when statements are cancelled or connection closed (#1291) - Fix race condition between chunk release and download error handling (#1407) - Revert UseQueryForMetadata default to 0, make SHOW commands opt-in (#1421) - Force Thrift mode when metadata params require native RPCs (#1416) - [PECOBLR-2086] MST transaction tests — parameterized for SEA/Thrift (#1366) - Change UseQueryForMetadata default to 1 (SHOW commands) (#1413) - Fix statement close behavior for direct results in SEA (#1400) - Add SPOG support for ?o= routing in httpPath (#1316) - Fix batched insert regex to support backtick-quoted identifiers with special characters (#1403) - Fix getCrossReference case-insensitive parent matching (#1411) - [PECOBLR-2318] Unify EnableDirectResults and EnableSQLExecDirectResults params (#1409) - Fix IntervalConverter crash on CloudFetch interval columns (#1397) - [PECOBLR-1928] Add AI coding agent detection to User-Agent header (#1230) - [PECOBLR-2409] Add CallableStatement support with IN parameters (#1371) - Add VARIANT type to ColumnInfoTypeName for correct SEA metadata (#1388) - Fix GEOMETRY/GEOGRAPHY DATA_TYPE mapping in Thrift getColumns() (#1387) - SEA metadata: throw for invalid null/empty params (Thrift parity) (#1390) - Add vulnerability scan gate to release workflows (#1396) - Fix cache warmer: add Windows runner, timestamp-based cache keys (#1395) - Fix cache warmer: add clean to resolve maven-clean-plugin and exec-maven-plugin (#1394) - Fix: normalize _remote.repositories repo ID for offline mode (#1393) - Fix: non-fork cache path must be restore-only (#1392) - Remove _remote.repositories from cache + use offline mode for forked PRs (#1391) - Fix fork Maven config: set updatePolicy=never to prevent 401 on cached artifacts (#1389) - Fix cache warmer: run real test to resolve surefire provider (#1385) - Revert Windows git install, restore original Enable long paths step (#1383) - Fix cache warmer: use install only, drop dependency:resolve (#1382) - Fix cache warmer: use install for inter-module SNAPSHOT resolution (#1381) - Fix cache warmer: Linux-only, OS-agnostic cache key (#1380) - Bump version to 3.3.2-SNAPSHOT (#1292) - Bump netty.version from 4.2.6.Final to 4.2.12.Final (#1347) - Use Databricks protected runner group for CI actions (#1369) - Resolve null catalog/schema in SEA key-based metadata operations (#1370) - Fix getSchemas returning JDBC-escaped catalog name in SEA mode (#1365) - Fix IllegalFormatConversionException in JulLogger error logging with Throwable (#1372) - Simplify SEA disposition: use connection parameters instead of statement type (#1322) - Fix CI failures: replace gh API calls blocked by IP allow list (#1363) - Fix SEA metadata JDBC spec compliance: catalog handling, empty types, non-existent objects (#1308) - Fix SEA volume operations failing with Statement is closed (#1323) - Address open supply chain security action items (#1359) - Disable publishing workflows per third-party package freeze (#1354) - Migrate all CI workflows from Databricks runners to GitHub-hosted runners (#1350) - Pin all GitHub Actions to commit SHAs (#1324) - Harden CI/CD supply chain security across all workflows (#1328) - Migrate dco-check and vulnerabilityCatcher to Databricks runners (#1327) - Prevent script injection in coverageReport workflow (#1295) - Improve instructions for jdk8 branch update (#1298) - Use version property for jts-core dependency (#1297) - Add OWASP suppression for CVE-2026-25087 and re-enable dependency check in release (#1296) - Add Claude GitHub Actions workflows (#1288) - Move dependencyManagement to parent pom to fix CVE-2025-48924 in uber jar (#1294) - Fix backtick quoting for column names in batched INSERT reconstruction (#1285) - Fix primitive type parsing in complex types for Arrow-serialized formats (#1250) - Skip OWASP dependency check in release build step (#1286) - Cut new release 3.3.1 (#1281) - [PECOBLR-1746] Implementing support for listing procedures (#1238) - Fix IdleConnectionEvictor thread leak in long-running services (#1271) - [ES-1717770] Fix TIMEDOUT_STATE not recognized as error on interactive clusters (#1244) - [ES-1765150] Coalesce concurrent expired-link refreshes into single batch RPC (#1277) - [ES-1774740] Fix Thrift polling infinite loop on invalid operation handle (#1273) - Add /sync-jdk8-branch slash command + update the jdk8 action workflow (#1274) </details> NO_CHANGELOG=true This pull request and its description were written by Isaac. [PECOBLR-3778]: https://databricks.atlassian.net/browse/PECOBLR-3778?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ --------- Signed-off-by: Vikrant Puppala <[email protected]> Signed-off-by: dependabot[bot] <[email protected]> Signed-off-by: samikshya-chand_data <[email protected]> Signed-off-by: Sreekanth Vadigi <[email protected]> Signed-off-by: Nikhil Suri <[email protected]> Signed-off-by: Gopal Lal <[email protected]> Signed-off-by: rileythomp <[email protected]> Signed-off-by: Samikshya Chand <[email protected]> Signed-off-by: Madhavendra Rathore <[email protected]> Signed-off-by: Oleksandr Shevchenko <[email protected]> Signed-off-by: Shivam Raj <[email protected]> Signed-off-by: Madhavendra Rathore Signed-off-by: Dan Homola <[email protected]> Signed-off-by: Matthieu Sprunck <[email protected]> Signed-off-by: Matthieu Sprunck <[email protected]> Signed-off-by: Eric Wang <[email protected]> Signed-off-by: eric-wang-1990 <[email protected]> Signed-off-by: Prathamesh Baviskar <[email protected]> Signed-off-by: Cathleen Yan <[email protected]> Signed-off-by: Vu Anh Phung <[email protected]> Signed-off-by: Michael Simons <[email protected]> Signed-off-by: Cathleen Yan <[email protected]> Signed-off-by: Rahul Singhal <[email protected]> Signed-off-by: Aakash Saravanan <[email protected]> Signed-off-by: peco-engineer-bot[bot] <287056288+peco-engineer-bot[bot]@users.noreply.github.com> Co-authored-by: Gopal Lal <[email protected]> Co-authored-by: Samikshya Chand <[email protected]> Co-authored-by: Madhavendra Rathore <[email protected]> Co-authored-by: Vikrant Puppala <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: tejassp-db <[email protected]> Co-authored-by: jayant <[email protected]> Co-authored-by: Sreekanth <[email protected]> Co-authored-by: Claude Sonnet 4.5 <[email protected]> Co-authored-by: Jothi Prakash <[email protected]> Co-authored-by: Shivam Raj <[email protected]> Co-authored-by: nikhilsuri-db <[email protected]> Co-authored-by: Riley Thompson <[email protected]> Co-authored-by: Oleksandr Shevchenko <[email protected]> Co-authored-by: Oleksandr Shevchenko <[email protected]> Co-authored-by: Madhav Sainanee <[email protected]> Co-authored-by: Dan Homola <[email protected]> Co-authored-by: Thomas Powell <[email protected]> Co-authored-by: Matthieu Sprunck <[email protected]> Co-authored-by: eric-wang-1990 <[email protected]> Co-authored-by: Prathamesh Baviskar <[email protected]> Co-authored-by: vuanhphung <[email protected]> Co-authored-by: Michael Simons <[email protected]> Co-authored-by: vuanhphung <[email protected]> Co-authored-by: Rahul Singhal <[email protected]> Co-authored-by: Isaac <[email protected]> Co-authored-by: aakash-saravanan-db <[email protected]> Co-authored-by: peco-engineer-bot[bot] <287056288+peco-engineer-bot[bot]@users.noreply.github.com>
Summary
UseBoundedSeaApiconnection property (default0) to gate bounded SEA API complianceStreamingChunkProvider(usesnext_chunk_indexchaining instead of deprecatedtotal_chunk_count), sendrow_offseton GetResultData, add batched link refresh reconciliationStreamingChunkDownloadTaskto parity withChunkDownloadTask(outercatch(Throwable), thread context propagation, exception chaining)Key design decisions
UseBoundedSeaApiis off by default — no behavioral change without opt-inStreamingChunkProvideris already bounded-SEA-compliant (usesnext_chunk_index), only needed to addrow_offsetand force its selectionTest plan
UseBoundedSeaApi=0(default) — no behavioral change, existing CloudFetch and inline paths unchangedUseBoundedSeaApi=1with CloudFetch enabled — usesStreamingChunkProviderwithrow_offsetNO_CHANGELOG=true
This pull request was AI-assisted by Isaac.