Skip to content

[PECOBLR-2409] Add CallableStatement support with IN parameters - #1371

Merged
gopalldb merged 38 commits into
databricks:mainfrom
gopalldb:feature/callable-statement-in-params
Apr 10, 2026
Merged

gopalldb merged 38 commits into
databricks:mainfrom
gopalldb:feature/callable-statement-in-params

Conversation

@gopalldb

@gopalldb gopalldb commented Apr 7, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • Implement DatabricksCallableStatement extending DatabricksPreparedStatement to support stored procedure invocation via Connection.prepareCall()
  • IN parameters work via inherited setXXX(int, value) methods
  • {call proc(?)} JDBC escape syntax is converted to CALL proc(?) at construction time, independent of the escapeProcessing flag
  • OUT/INOUT parameters, named parameters, and {? = call ...} return-value syntax throw SQLFeatureNotSupportedException with clear messages
  • Wire up all 3 prepareCall() overloads in DatabricksConnection with proper resultSetType/holdability validation
  • shouldReturnResultSet is always true -- use execute() or executeQuery() to invoke procedures
  • Java 8+ SQLType-based overrides explicitly implemented for consistent error messages

Known limitations

  • Nested JDBC escape sequences inside {call ...} arguments are not supported -- consistent with StringUtil.convertJdbcEscapeSequences. Use native SQL syntax instead.
  • {? = call ...} return-value syntax is rejected at construction time
  • executeUpdate() always throws for callable statements since shouldReturnResultSet=true. Use execute() for DML procedures.

Test plan

  • DatabricksCallableStatementTest -- 30 tests
  • DatabricksConnectionTest -- 42 tests pass
  • DatabricksPreparedStatementTest -- 48 tests, 0 regressions
  • Full core test suite -- 3208 tests, 0 failures

This pull request was AI-assisted by Isaac.

gopalldb added 2 commits April 7, 2026 10:56
Implement DatabricksCallableStatement extending DatabricksPreparedStatement
to support stored procedure invocation via Connection.prepareCall().

- IN parameters work via inherited setXXX(int, value) methods
- {call proc(?)} JDBC escape syntax converted to CALL proc(?)
- OUT/INOUT params throw SQLFeatureNotSupportedException
- Named parameters throw SQLFeatureNotSupportedException
- {? = call ...} return-value syntax rejected at construction time
- Wire up all 3 prepareCall() overloads in DatabricksConnection

Signed-off-by: Gopal Lal <[email protected]>
Co-authored-by: Isaac
Signed-off-by: Gopal Lal <[email protected]>
- Add explicit Java 8+ SQLType overrides for registerOutParameter (6)
  and setObject(String, Object, SQLType) (2) to ensure consistent
  Databricks-specific error messages
- Split throw helpers into void/generic variants to avoid autoboxing
  fragility
- Add exhaustive test coverage: all getXXX(int), getXXX(String),
  setXXX(String) methods, SQLType overloads, Calendar variants,
  deprecated getBigDecimal(int,int), null SQL, closed connection,
  executeQuery behavior, batch operations, getParameterMetaData
- Test count: 18 → 26

Signed-off-by: Gopal Lal <[email protected]>
Co-authored-by: Isaac
Signed-off-by: Gopal Lal <[email protected]>
@gopalldb
gopalldb force-pushed the feature/callable-statement-in-params branch from edfd0f5 to 8a783bc Compare April 7, 2026 06:14
gopalldb added 3 commits April 7, 2026 11:46
CallableStatement constructor now calls setEscapeProcessing(true) so
that {call proc(?)} JDBC escape syntax is automatically converted to
CALL proc(?). This only affects callable statement instances — the
global DEFAULT_ESCAPE_PROCESSING (false) remains unchanged for
Statement and PreparedStatement.

Signed-off-by: Gopal Lal <[email protected]>
Co-authored-by: Isaac
Signed-off-by: Gopal Lal <[email protected]>
- Override shouldReturnResultSet=true in CallableStatement constructor
  so executeQuery() works and execute() returns true (procedures can
  return result sets)
- Override setEscapeProcessing(false) to be rejected — escape processing
  is required for {call ...} → CALL ... conversion
- Add tests: executeQuery works, execute returns true, executeUpdate
  throws, setEscapeProcessing(false) rejected, parameter counting in
  {call} syntax, no-arg procedure parameter count

Signed-off-by: Gopal Lal <[email protected]>
Co-authored-by: Isaac
Signed-off-by: Gopal Lal <[email protected]>
Convert {call proc(?)} to CALL proc(?) at construction time via
convertCallEscapeSyntax(), independent of the escapeProcessing flag.
setEscapeProcessing controls only standard JDBC escapes ({d}, {t},
{ts}, {fn}, {oj}) while {call} conversion always happens for
callable statements.

Signed-off-by: Gopal Lal <[email protected]>
Co-authored-by: Isaac
Signed-off-by: Gopal Lal <[email protected]>
@gopalldb
gopalldb force-pushed the feature/callable-statement-in-params branch from 0691183 to e639e0f Compare April 7, 2026 07:56
- Document nested braces limitation in CALL_ESCAPE_SYNTAX Javadoc
  (consistent with StringUtil's existing limitation)
- Document executeUpdate() behavior in class Javadoc: use execute()
  for DML procedures, check getUpdateCount() afterward
- Add test for native CALL syntax (no JDBC escape braces) confirming
  execute() returns true and shouldReturnResultSet works via CALL_PATTERN

Signed-off-by: Gopal Lal <[email protected]>
Co-authored-by: Isaac
Signed-off-by: Gopal Lal <[email protected]>
@gopalldb gopalldb changed the title Add CallableStatement support with IN parameters [PECOBLR-2409] Add CallableStatement support with IN parameters Apr 7, 2026
gopalldb and others added 7 commits April 7, 2026 16:33
Add LOGGER.debug() calls to every method implementation following the
same pattern used in DatabricksStatement and DatabricksPreparedStatement
(logging the public method signature at entry).

Signed-off-by: Gopal Lal <[email protected]>
Co-authored-by: Isaac
Signed-off-by: Gopal Lal <[email protected]>
- Drop Windows from cache warmer matrix — Windows runners in
  databricks-protected-runner-group lack bash (command not found)
- Remove runner.os from cache key — Maven JARs/POMs are platform-
  independent, so one cache entry serves both Linux and Windows
- Cache key is now: maven-deps-{hash(pom.xml)}

Signed-off-by: Gopal Lal <[email protected]>
Co-authored-by: Isaac
Signed-off-by: Gopal Lal <[email protected]>
The cache was missing maven-toolchains-plugin (and potentially other
plugins like spotless, jacoco) because mvn install only resolves
plugins needed for the install lifecycle. Plugins activated by specific
goals or profiles (used in PR unit-test and formatting workflows) were
not cached, causing 401 errors for forked PRs.

Fix: after install, also run dependency:resolve-plugins and trigger
spotless/jacoco plugin downloads to ensure all PR workflow dependencies
are cached.

Signed-off-by: Gopal Lal <[email protected]>
Co-authored-by: Isaac
Signed-off-by: Gopal Lal <[email protected]>
@gopalldb
gopalldb requested a review from a team as a code owner April 8, 2026 07:12
@gopalldb
gopalldb requested a review from deeksha-db April 8, 2026 07:12
gopalldb added a commit that referenced this pull request Apr 8, 2026
## Summary
The cache warmer was not caching `surefire-junit-platform:3.1.2` because
surefire resolves its provider JAR lazily at test execution time, not at
plugin initialization. The previous approach (`-Dtest=NoSuchTest`)
failed before surefire downloaded the provider.

Fix: run a real lightweight test
(`DatabricksParameterMetaDataTest#testInitialization`) to force full
surefire provider resolution.

### Verified locally
All 4 previously missing artifacts are now in the local cache after
running the test:
- `surefire-junit-platform:3.1.2` (blocked unit-tests + integration
tests)
- `maven-toolchains-plugin:3.2.0` (blocked unit-tests)
- `maven-clean-plugin:3.2.0` (blocked coverage)
- `exec-maven-plugin:1.2.1` (blocked coverage)

The 5 maven-metadata.xml warnings are non-blocking (Maven falls back to
cached plugin JARs).

## Test plan
- [x] Verified locally: `mvn -pl jdbc-core test
-Dtest="DatabricksParameterMetaDataTest#testInitialization"` passes and
resolves all missing plugins
- [ ] After merge: re-trigger cache warmer on main, then re-run PR #1371
CI

NO_CHANGELOG=true

This pull request was AI-assisted by Isaac.

---------

Signed-off-by: Gopal Lal <[email protected]>
Co-authored-by: Claude Opus 4.6 <[email protected]>
gopalldb added a commit that referenced this pull request Apr 8, 2026
…d artifacts (#1389)

## Summary
Even with artifacts in the local cache (~350MB restored successfully),
Maven checks the remote repository for POM metadata updates. For forked
PRs the JFrog mirror has no credentials, so these update checks get 401
errors — causing `maven-toolchains-plugin:3.2.0` resolution to fail even
though the JAR is cached.

Fix: for forked PRs only, configure repository and pluginRepository with
`updatePolicy=never` in an active profile. This tells Maven to use
cached artifacts without contacting the remote for updates. The non-fork
path (JFrog OIDC with full credentials) is unchanged.

## Test plan
- [ ] Re-run PR #1371 CI after merge — toolchains plugin should resolve
from cache without 401

NO_CHANGELOG=true

This pull request was AI-assisted by Isaac.

---------

Signed-off-by: Gopal Lal <[email protected]>
Co-authored-by: Claude Opus 4.6 <[email protected]>
gopalldb and others added 4 commits April 8, 2026 16:14
Signed-off-by: Gopal Lal <[email protected]>
Co-authored-by: Isaac
Signed-off-by: Gopal Lal <[email protected]>
The updatePolicy=never approach didn't work because Maven plugin
resolution goes through the mirror directly, ignoring repository
update policies.

Fix: for forked PRs, point the mirror to file://{local-repo}. This
forces Maven to resolve everything from ~/.m2/repository (the restored
cache) without any network requests. Same-repo PRs continue using
JFrog OIDC unchanged.

Signed-off-by: Gopal Lal <[email protected]>
Co-authored-by: Isaac
Signed-off-by: Gopal Lal <[email protected]>
Maven tracks which repository ID an artifact was downloaded from. The
cache warmer uses mirror ID 'jfrog-central', so cached artifacts have
_remote.repositories entries pointing to jfrog-central. Using a
different mirror ID (local-cache) causes Maven to re-verify artifacts,
which fails for some plugins (maven-clean-plugin).

Fix: use the same ID 'jfrog-central' for the file:// mirror so Maven
recognizes cached artifacts without re-verification.

Signed-off-by: Gopal Lal <[email protected]>
Co-authored-by: Isaac
Signed-off-by: Gopal Lal <[email protected]>
gopalldb added a commit that referenced this pull request Apr 8, 2026
…PRs (#1391)

## Summary
Two fixes for forked PR dependency resolution:

1. **Warmer**: Remove `_remote.repositories` marker files before saving
the cache. These files track which repo ID (`jfrog-central`) each
artifact was downloaded from. When forked PRs restore the cache in
offline mode, Maven refuses artifacts because they were "not downloaded
from central".

2. **Fork composite action**: Use Maven offline mode (`-o` via
`.mvn/maven.config`) + empty `settings.xml`. With clean cache (no repo
ID markers), offline mode resolves everything from `~/.m2/repository`
with zero network requests.

Also deleted the existing stale cache entry to force a fresh save.

## Test plan
- [x] Verified locally: `mvn -o` with removed `_remote.repositories` →
BUILD SUCCESS, zero network requests
- [ ] After merge: re-trigger cache warmer, then re-run PR #1371 CI

NO_CHANGELOG=true

This pull request was AI-assisted by Isaac.

---------

Signed-off-by: Gopal Lal <[email protected]>
Co-authored-by: Claude Opus 4.6 <[email protected]>
The non-fork path in the composite action was using actions/cache
(save+restore) which saved dirty cache entries WITH _remote.repositories
files. These overwrote the clean cache saved by the warmer, breaking
offline mode for forked PRs.

Fix: change non-fork path to actions/cache/restore (restore-only).
Only the warmMavenCache workflow saves the cache (with _remote.repositories
stripped).

Signed-off-by: Gopal Lal <[email protected]>
Co-authored-by: Isaac
Signed-off-by: Gopal Lal <[email protected]>
gopalldb added a commit that referenced this pull request Apr 8, 2026
## Summary
The non-fork path in the composite action used `actions/cache`
(save+restore), which saved dirty cache entries WITH
`_remote.repositories` files. These overwrote the clean cache saved by
the warmer, breaking offline mode for forked PRs.

Fix: change to `actions/cache/restore` (restore-only). Only the
`warmMavenCache` workflow saves the cache (with `_remote.repositories`
stripped).

Also deleted all existing stale cache entries.

## Test plan
- [ ] After merge: trigger cache warmer, then re-run PR #1371 CI

NO_CHANGELOG=true

This pull request was AI-assisted by Isaac.

---------

Signed-off-by: Gopal Lal <[email protected]>
Co-authored-by: Claude Opus 4.6 <[email protected]>
Deleting _remote.repositories was not enough — Maven 3.9+ still
refused cached artifacts in offline mode. The root cause: Maven
checks that the artifact was "downloaded from central" but the
_remote.repositories files referenced "jfrog-central" (the warmer's
mirror ID).

Fix: in the warmer, sed-replace 'jfrog-central' with 'central' in
all _remote.repositories files before saving the cache. This makes
Maven's offline mode accept cached artifacts as coming from 'central'
(the default Maven Central repo ID).

Verified locally: all 5 CI commands pass with replaced repo IDs +
offline mode (spotless, unit tests, jacoco, packaging, test-compile).

Signed-off-by: Gopal Lal <[email protected]>
Co-authored-by: Isaac
Signed-off-by: Gopal Lal <[email protected]>
gopalldb added a commit that referenced this pull request Apr 8, 2026
## Summary
Deleting _remote.repositories was not enough — Maven 3.9+ still refused
cached artifacts in offline mode with "has not been downloaded from it
before". The root cause: Maven checks that the artifact was downloaded
from "central" but the _remote.repositories files referenced
"jfrog-central" (the warmer mirror ID).

Fix: in the warmer, sed-replace "jfrog-central" with "central" in all
_remote.repositories files before saving the cache. This makes Maven
offline mode accept cached artifacts as coming from "central" (the
default repo ID).

Verified locally: ALL 5 CI commands pass with replaced repo IDs +
offline mode:
- spotless:check → BUILD SUCCESS
- unit tests → BUILD SUCCESS
- jacoco:report → BUILD SUCCESS
- packaging install → BUILD SUCCESS
- test-compile → BUILD SUCCESS

## After merge
1. Delete stale cache entries
2. Trigger cache warmer
3. Re-run PR #1371 CI

NO_CHANGELOG=true

This pull request was AI-assisted by Isaac.

---------

Signed-off-by: Gopal Lal <[email protected]>
Co-authored-by: Claude Opus 4.6 <[email protected]>
gopalldb added a commit that referenced this pull request Apr 8, 2026
…ven-plugin (#1394)

## Summary
maven-clean-plugin:3.2.0 and exec-maven-plugin:1.2.1 were missing from
the dependency cache because the warmer ran `mvn install` and `mvn test`
without the `clean` lifecycle phase. The CI workflows use `mvn clean
test`, which requires these plugins.

Fix: add `clean` to every warmer step to match CI commands exactly.

## Test plan
- [ ] Trigger cache warmer from this PR branch (workflow_dispatch)
- [ ] Verify maven-clean-plugin and exec-maven-plugin appear in warmer
logs
- [ ] Re-run PR #1371 CI after merge

NO_CHANGELOG=true

This pull request was AI-assisted by Isaac.

Signed-off-by: Gopal Lal <[email protected]>
gopalldb added a commit that referenced this pull request Apr 9, 2026
## Summary
Two fixes for the forked PR dependency cache:

1. **Add Windows runner to warmer matrix.** GitHub Actions cache is
OS-scoped — a cache saved on Linux cannot be restored on Windows. The
warmer must run on both OS.

2. **Timestamp-based cache keys.** GitHub caches are immutable (can't
overwrite). Previously required manual deletion before re-running
warmer. Now uses key format `maven-deps-{timestamp}-{hash}`, so each run
creates a new entry. The restore step uses prefix `maven-deps-` to match
the latest. Old entries auto-expire after 7 days.

Also runs exact same Maven commands as PR CI workflows (8 steps) to
ensure all plugins are cached.

## Test plan
- [ ] Trigger warmer from this branch — verify both Linux and Windows
jobs pass
- [ ] After merge: trigger warmer on main, re-run PR #1371 CI

NO_CHANGELOG=true

This pull request was AI-assisted by Isaac.

Signed-off-by: Gopal Lal <[email protected]>
gopalldb and others added 4 commits April 9, 2026 09:54
Coverage was 84.91% due to DatabricksCallableStatement's throw-only
methods having unreachable bytecode that JaCoCo counts as missed.
Added targeted tests to close the gap:

- CallableStatementTest: cover 6 remaining typed setXXX(String, Blob/
  Clob/NClob/SQLXML/RowId/URL) overloads
- ConnectionTest: cover getMetaData, beginRequest, endRequest, and
  prepareCall with valid holdability
- ParameterMetaDataTest: cover isNullable, isSigned, getPrecision,
  getScale
- WildcardUtilTest: cover isNullOrWildcard, jdbcPatternToHive(null)

Coverage: 84.91% -> 85.05% (+32 instruction buffer)

Signed-off-by: Gopal Lal <[email protected]>
Co-authored-by: Isaac
Signed-off-by: Gopal Lal <[email protected]>
Keep main's 8-step approach that mirrors exact CI commands.

Signed-off-by: Gopal Lal <[email protected]>
Co-authored-by: Isaac
Signed-off-by: Gopal Lal <[email protected]>
@vikrantpuppala

Copy link
Copy Markdown
Collaborator

Code Review: DatabricksCallableStatement — CallableStatement with IN Parameters

Overall this is a solid implementation. The design choice to extend DatabricksPreparedStatement is the right call — it follows the JDBC hierarchy and gets all setXXX(int, value) / execution / batch functionality for free. The test coverage is thorough (30 tests covering construction, execution, OUT param rejection, named param rejection, and error messages). The {call ...} escape conversion at construction time is a clever solution to ensure shouldReturnResultSet works correctly regardless of escapeProcessing.

A few issues to address before merge:


Critical: Constructor validates return-value syntax AFTER calling super()

DatabricksCallableStatement.java:70-71

super(connection, convertCallEscapeSyntax(sql));   // line 70
validateNoReturnValueSyntax(sql);                   // line 71

If a user passes {? = call my_func()}, the CALL_ESCAPE_SYNTAX pattern (\{\s*call\s+...) does not match {? = call ...} (because ?\s*=\s* precedes call), so convertCallEscapeSyntax returns the original string unchanged. The parent constructor then receives {? = call my_func()} as-is, which:

  1. Won't match CALL_PATTERN (^CALL\b) in shouldReturnResultSetWithConfig, so shouldReturnResultSet is set to false (wrong for a callable statement)
  2. Partially initializes the parent object before the validation on line 71 throws

The statement gets added to statementSet in DatabricksConnection.prepareCall() only after the constructor returns, so there's no leak — but the ordering is still incorrect.

Fix: Move validation before the super() call using a static factory method:

public DatabricksCallableStatement(DatabricksConnection connection, String sql)
    throws SQLException {
  super(connection, validateAndConvert(sql));
  LOGGER.debug("Created DatabricksCallableStatement for SQL: {}", sql);
}

private static String validateAndConvert(String sql) throws SQLException {
  if (sql != null && RETURN_VALUE_SYNTAX.matcher(sql).find()) {
    throw new DatabricksSQLFeatureNotSupportedException(
        "Return value syntax {? = call ...} is not supported. "
            + "Use {call proc(...)} and retrieve results via the ResultSet.");
  }
  return convertCallEscapeSyntax(sql);
}

Major: Missing closed-connection check in prepareCall(String) and prepareCall(String, int, int)

DatabricksConnection.java

The 3-arg prepareCall(sql, type, concurrency, holdability) correctly checks isClosed(), but the 1-arg and 2-arg overloads do not. I note that prepareStatement(String) also lacks this check (pre-existing), so this is consistent with the existing pattern — but since you're adding the check in the 3-arg overload, it would be good to be consistent across all three prepareCall overloads.

The 2-arg overload delegates to the 1-arg, so adding the check to prepareCall(String) covers both:

@Override
public CallableStatement prepareCall(String sql) throws SQLException {
  throwExceptionIfConnectionIsClosed();
  LOGGER.debug(...);
  DatabricksCallableStatement statement = new DatabricksCallableStatement(this, sql);
  statementSet.add(statement);
  return statement;
}

Severity note: This is a pre-existing inconsistency (prepareStatement has the same gap), so I wouldn't block the PR on it. But since you're already touching these methods, it's a good opportunity to fix.


Major: executeUpdate() always throws for callable statements

Since CALL_PATTERN matches, shouldReturnResultSet is true, and DatabricksPreparedStatement.executeUpdate() throws when shouldReturnResultSet is true. This means executeUpdate() always fails for callable statements, even for DML procedures.

The Javadoc correctly documents the workaround ("use execute() and check getUpdateCount()"), but per JDBC spec Section 13.2, executeUpdate() should be usable for stored procedures that don't return result sets.

This is acceptable as a known limitation for v1, but consider:

  1. Overriding executeUpdate() in DatabricksCallableStatement with a clearer error message specific to callable statements (rather than the generic prepared statement error)
  2. Adding this to the "Known limitations" section of the PR description ✅ (already done)

Minor: RETURN_VALUE_SYNTAX pattern doesn't account for string literals

DatabricksCallableStatement.java:43

The pattern \{\s*\?\s*=\s*call\b performs a naive search of the full SQL string. A (contrived) SQL like:

CALL proc('{? = call foo}')

would be incorrectly rejected because the pattern appears inside a string literal argument. This is an unlikely edge case for callable statements, but worth a Javadoc note.


Minor: CALL_ESCAPE_SYNTAX uses [^}]* which doesn't handle nested braces

DatabricksCallableStatement.java:52

Already documented in the Javadoc as a known limitation consistent with StringUtil.convertJdbcEscapeSequences. No action needed — just confirming the documentation is accurate. 👍


Nit: Test testPrepareCallOnClosedConnectionThrows only tests the 3-arg overload

DatabricksCallableStatementTest.java:148-156

The closed-connection test only verifies the 3-arg prepareCall(sql, type, concurrency, holdability). If the closed-connection check is added to the 1-arg overload (per the suggestion above), add a test for that path too.


Nit: Debug log messages are method signatures

Throughout DatabricksCallableStatement, debug log messages are method signatures like "public void registerOutParameter(int parameterIndex, int sqlType)". This is consistent with the parent class's logging style, so not specific to this PR, but including actual parameter values would be more useful for debugging.


Summary

Severity # Key Items
Critical 1 Constructor validation ordering — validate before super()
Major 2 Missing closed-connection check on 1-arg/2-arg prepareCall; executeUpdate() always throws
Minor 2 Regex false positive on string literals; nested brace limitation (documented)
Nit 2 Closed-connection test coverage; debug log content

The critical item (constructor ordering) should be fixed before merge. The rest are improvements that could go in a follow-up.

Test coverage is strong — construction, execution, escape processing independence, batch operations, parameter metadata, exhaustive OUT/named parameter rejection, and error message validation are all well covered. Nice work. 👏


This comment was generated with GitHub MCP.

gopalldb and others added 2 commits April 9, 2026 15:18
Critical:
- Move validation before super() using static validateAndConvert()
  to avoid partial parent initialization on invalid SQL

Major:
- Add throwExceptionIfConnectionIsClosed() to prepareCall(String)
- Override executeUpdate() with clear error message explaining
  callable statements should use execute() + getUpdateCount()

Tests:
- Add closed-connection test for 1-arg prepareCall
- Fix executeUpdate test to expect SQLFeatureNotSupportedException
- Fix createConnection() to return an open connection (mock session)

Signed-off-by: Gopal Lal <[email protected]>
Co-authored-by: Isaac
Signed-off-by: Gopal Lal <[email protected]>
@gopalldb

Copy link
Copy Markdown
Collaborator Author

Addressed feedbacks

Exercise 10 uncovered default-value getters in DatabricksConnectionContext
to build a comfortable coverage buffer (85.04% -> 85.12%, +85 instructions).

Signed-off-by: Gopal Lal <[email protected]>
Co-authored-by: Isaac
Signed-off-by: Gopal Lal <[email protected]>
@gopalldb
gopalldb merged commit aefb589 into databricks:main Apr 10, 2026
14 of 15 checks passed
@cathleeny cathleeny mentioned this pull request Oct 6, 2026
1 of 3 tasks
cathleeny added a commit that referenced this pull request Oct 7, 2026
## 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants