Skip to content

Commit 885046b

Browse files
authored
Merge branch 'main' into geospatial-datatype
2 parents 7783ae9 + 4c418e4 commit 885046b

1,773 files changed

Lines changed: 30012 additions & 23500 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ If available, share redacted client side logs
2626
- OS: [e.g. Windows]
2727
- Java version [e.g. Java 21]
2828
- Java vendor [e.g. OpenJDK]
29-
- Driver Version [e.g. 1.0.9-oss]
29+
- Driver Version [e.g. 1.0.10-oss]
3030
- BI Tool (if used) [e.g. DBeaver]
3131
- BI Tool version (if applicable) [e.g. 24.3.5]
3232

.github/workflows/release-thin.yml

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
name: Release Thin JAR
2+
on:
3+
push:
4+
tags:
5+
- 'v*'
6+
workflow_dispatch:
7+
8+
jobs:
9+
publish-thin:
10+
runs-on:
11+
group: databricks-protected-runner-group
12+
labels: linux-ubuntu-latest
13+
steps:
14+
- name: Checkout
15+
uses: actions/checkout@v4
16+
17+
- name: Set up Java for publishing to Maven Central Repository
18+
uses: actions/setup-java@v4
19+
with:
20+
java-version: 11
21+
distribution: "adopt"
22+
server-id: central
23+
server-username: MAVEN_CENTRAL_USERNAME
24+
server-password: MAVEN_CENTRAL_PASSWORD
25+
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
26+
gpg-passphrase: GPG_PASSPHRASE
27+
28+
- name: Configure GPG
29+
run: |
30+
echo "allow-loopback-pinentry" >> ~/.gnupg/gpg-agent.conf
31+
echo "pinentry-mode loopback" >> ~/.gnupg/gpg.conf
32+
gpg-connect-agent reloadagent /bye
33+
34+
- name: Build thin JAR
35+
run: |
36+
mvn -B -DskipTests package
37+
38+
- name: Verify thin jar exists
39+
run: |
40+
VERSION=$(grep -m1 '<version>' pom.xml | sed 's/.*<version>\(.*\)<\/version>.*/\1/')
41+
test -f "target/databricks-jdbc-${VERSION}-oss-thin.jar"
42+
43+
- name: Publish Thin JAR as Separate Artifact to Maven Central
44+
run: |
45+
VERSION=$(grep -m1 '<version>' pom.xml | sed 's/.*<version>\(.*\)<\/version>.*/\1/')
46+
mvn -Prelease gpg:sign-and-deploy-file \
47+
-Dfile="target/databricks-jdbc-${VERSION}-oss-thin.jar" \
48+
-DrepositoryId=central \
49+
-Durl=https://oss.sonatype.org/service/local/staging/deploy/maven2/ \
50+
-DgroupId=com.databricks \
51+
-DartifactId=databricks-jdbc-thin \
52+
-Dversion="${VERSION}" \
53+
-Dpackaging=jar \
54+
-DgeneratePom=true \
55+
-Dgpg.passphrase="${GPG_PASSPHRASE}"
56+
env:
57+
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
58+
MAVEN_CENTRAL_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }}
59+
MAVEN_CENTRAL_PASSWORD: ${{ secrets.MAVEN_CENTRAL_PASSWORD }}
60+
61+
- name: Upload Thin JAR to GitHub Release
62+
uses: softprops/action-gh-release@v1
63+
with:
64+
files: |
65+
target/*-oss-thin.jar
66+

.github/workflows/release.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,9 @@ jobs:
3232
gpg-connect-agent reloadagent /bye
3333
3434
- name: Publish to the Maven Central Repository
35-
run: mvn -Prelease --batch-mode deploy -Dnvd.api.key=${{ secrets.NVD_API_KEY }}
35+
run: |
36+
# Deploy main artifacts (uber JAR, sources, javadoc)
37+
mvn -Prelease --batch-mode deploy -Dnvd.api.key=${{ secrets.NVD_API_KEY }}
3638
env:
3739
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
3840
MAVEN_CENTRAL_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }}
@@ -41,4 +43,8 @@ jobs:
4143
- name: Create GitHub release
4244
uses: softprops/action-gh-release@v1
4345
with:
44-
files: target/*.jar
46+
files: |
47+
target/databricks-jdbc-*-oss.jar
48+
target/databricks-jdbc-*-sources.jar
49+
target/databricks-jdbc-*-javadoc.jar
50+
fail_on_unmatched_files: false

.github/workflows/releaseFreeze.yml

Lines changed: 31 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@ on:
66

77
jobs:
88
freeze-check:
9-
runs-on: ubuntu-latest
9+
runs-on:
10+
group: databricks-protected-runner-group
11+
labels: linux-ubuntu-latest
1012

1113
steps:
1214
- name: Check out repository
@@ -15,14 +17,37 @@ jobs:
1517
- name: Set up jq
1618
run: sudo apt-get update && sudo apt-get install -y jq
1719

20+
- name: Fetch PR message
21+
id: pr-message
22+
env:
23+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
24+
run: |
25+
# Use the GitHub API to fetch the PR message
26+
pr_message=$(gh pr view ${{ github.event.pull_request.number }} --json body -q '.body')
27+
28+
# Sanitize the PR message to avoid code injection, keeping the equal sign
29+
sanitized_pr_message=$(echo "$pr_message" | sed 's/[^a-zA-Z0-9._/-=]/_/g')
30+
31+
# Store the sanitized PR message
32+
echo "$sanitized_pr_message" > pr_message.txt
33+
echo "$sanitized_pr_message"
34+
1835
- name: Enforce branch freeze logic
1936
shell: bash
2037
env:
2138
# GITHUB_HEAD_REF: Source branch name for PRs
2239
PR_BRANCH: ${{ github.head_ref }}
2340
run: |
24-
CONFIG_FILE="development/.release-config.json"
41+
CONFIG_FILE="development/.release-freeze.json"
42+
43+
# 1. Check for explicit override flag in PR message
44+
pr_message=$(cat pr_message.txt)
45+
if echo "$pr_message" | grep -q "OVERRIDE_FREEZE=true"; then
46+
echo "✅ OVERRIDE_FREEZE=true found in PR message. Freeze override permitted."
47+
exit 0
48+
fi
2549
50+
# 2. Proceed with freeze checks
2651
if [[ ! -f "$CONFIG_FILE" ]]; then
2752
echo "✅ No release config file - passing check."
2853
exit 0
@@ -35,26 +60,7 @@ jobs:
3560
exit 0
3661
fi
3762
38-
ALLOW_LIST=( $(jq -r '.allow_list[]' "$CONFIG_FILE") )
39-
40-
BRANCH="$PR_BRANCH"
41-
ALLOWED=0
42-
43-
# Check for exact branch name in allow_list
44-
for ENTRY in $(jq -r '.allow_list[]' "$CONFIG_FILE"); do
45-
if [[ "$BRANCH" == "$ENTRY" ]]; then
46-
ALLOWED=1
47-
break
48-
fi
49-
done
50-
51-
if [[ "$ALLOWED" == "1" ]]; then
52-
echo "✅ Branch '$BRANCH' is in allow_list. Passing check."
53-
exit 0
54-
else
55-
echo "❌ Release freeze is ACTIVE!"
56-
REASON=$(jq -r '.reason' "$CONFIG_FILE")
57-
echo "Reason: $REASON"
58-
echo "Branch '$BRANCH' is NOT permitted to merge under current freeze rules."
59-
exit 1
60-
fi
63+
# 3. Freeze is ON and no override flag. Block PR.
64+
echo "Release freeze is ACTIVE! Branch '${PR_BRANCH}' is NOT permitted to merge."
65+
echo "To override, add OVERRIDE_FREEZE=true to your PR description."
66+
exit 1

CHANGELOG.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,31 @@
11
# Version Changelog
22

3+
## [v1.0.10-oss] - 2025-09-18
4+
### Added
5+
- **Query Tags support**: Added ability to attach key-value tags to SQL queries for analytical purposes that would appear in `system.query.history` table. Example: `jdbc:databricks://host;QUERY_TAGS=team:marketing,dashboard:abc123`. (This feature is in [private preview](https://docs.databricks.com/aws/en/release-notes/release-types#:~:text=Private%20Preview-,Invite%20only,-No))
6+
- **SQL Scripting support**: Added support for [SQL Scripting](https://docs.databricks.com/aws/en/sql/language-manual/sql-ref-scripting)
7+
- Added a client property `enableVolumeOperations` to enable GET/PUT/REMOVE volume operations on a stream. For backward compatibility, allowedVolumeIngestionPaths can also be used for REMOVE operation.
8+
- Support for fetching schemas across all catalogs (when catalog is specified as null or a wildcard) in `DatabaseMetaData#getSchemas` API in SQL Execution mode.
9+
- **Configurable SQL validation in isValid()**: Added `EnableSQLValidationForIsValid` connection property to control whether `isValid()` method executes an actual SQL query for server-side validation. Default value is 0.
10+
- Implement multi-row INSERT batching optimization for prepared statements to improve performance when executing large batches of INSERT operations.
11+
- Implement lazy/incremental fetching for columnar results when using Databricks JDBC in Thrift mode without Arrow support. The change modifies the behavior from buffering entire result sets in memory to maintaining only a limited number of rows at a time, reducing peak heap memory usage and preventing OutOfMemory errors.
12+
- Added new artifact `databricks-jdbc-thin` for thin jar with runtime dependency metadata.
13+
- Introduce a memory-efficient columnar data access mechanism for JDBC result processing.
14+
- Added support for using a custom Discovery URL in U2M flows on AWS and GCP.
15+
16+
### Updated
17+
- Databricks SDK dependency upgraded to latest version 0.64.0
18+
19+
### Fixed
20+
- Integrated Azure U2M flow into driver for improved stability.
21+
- Fixed `ResultSet.getString` for Boolean columns in Metadata result set.
22+
- Fixed volume operations not completing unless the ResultSet is fully iterated.
23+
- Fixed `connection.getMetadata().getColumns()` to return the correct SQL data type code for complex type columns.
24+
- Fixed a bug in the JDBC driver's metadata parsing for nested decimal fields within struct types.
25+
- Fixed case sensitive table search in `connection.getMetadata().getTables()`
26+
- Fixed `connection.getMetadata().getColumns()` to return the correct scale.
27+
---
28+
329
## [v1.0.9-oss] - 2025-08-19
430
### Added
531
- Added support for providing custom HTTP options: `HttpMaxConnectionsPerRoute` and `HttpConnectionRequestTimeout`.

NEXT_CHANGELOG.md

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,16 @@
33
## [Unreleased]
44

55
### Added
6-
7-
- **Query Tags support**: Added ability to attach key-value tags to SQL queries for analytical purposes that would appear in `system.query.history` table. Example: `jdbc:databricks://host;QUERY_TAGS=team:marketing,dashboard:abc123`.
8-
- **SQL Scripting support**: Added support for [SQL Scripting](https://docs.databricks.com/aws/en/sql/language-manual/sql-ref-scripting)
9-
- Added a client property `enableVolumeOperations` to enable GET/PUT/REMOVE volume operations on a stream. For backward compatibility, allowedVolumeIngestionPaths can also be used for REMOVE operation.
10-
- Support for fetching schemas across all catalogs (when catalog is specified as null or a wildcard) in `DatabaseMetaData#getSchemas` API in SQL Execution mode.
11-
- **Configurable SQL validation in isValid()**: Added `EnableSQLValidationForIsValid` connection property to control whether `isValid()` method executes an actual SQL query for server-side validation. Default value is 0.
12-
- Implement multi-row INSERT batching optimization for prepared statements to improve performance when executing large batches of INSERT operations.
13-
- Implement lazy/incremental fetching for columnar results when using Databricks JDBC in Thrift mode without Arrow support. The change modifies the behavior from buffering entire result sets in memory to maintaining only a limited number of rows at a time, reducing peak heap memory usage and preventing OutOfMemory errors.
14-
6+
- Enabled direct results by default in SEA mode to improve latency for short and small queries.
157
### Updated
16-
- Databricks SDK dependency upgraded to latest version 0.60.0
8+
- Telemetry data is now captured more efficiently and consistently due to enhancements in the log and connection close flush logic.
9+
- Updated Databricks SDK version to v0.65.0 (This is to fix OAuthClient to properly encode complex query parameters.)
10+
- Added IgnoreTransactions connection parameter to silently ignore transaction method calls.
1711

1812
### Fixed
19-
- Integrated Azure U2M flow into driver for improved stability.
20-
- Fixed `ResultSet.getString` for Boolean columns in Metadata result set.
21-
- Fixed volume operations not completing unless the ResultSet is fully iterated.
22-
- Fixed `connection.getMetadata().getColumns()` to return the correct SQL data type code for complex type columns.
23-
- Fixed a bug in the JDBC driver's metadata parsing for nested decimal fields within struct types.
13+
- Fixed state leaking issue in thrift client.
14+
- Fixed timestamp values returning only milliseconds instead of the full nanosecond precision.
15+
- Fixed Statement.getUpdateCount() for DML queries.
16+
- Fixed Maven Central publishing to use minimal POM for both main and thin JARs, restoring behavior from v1.0.7 and earlier
2417
---
2518
*Note: When making changes, please add your change under the appropriate section with a brief description.*

README.md

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,20 +20,43 @@ Add the following dependency to your `pom.xml`:
2020
<dependency>
2121
<groupId>com.databricks</groupId>
2222
<artifactId>databricks-jdbc</artifactId>
23-
<version>1.0.9-oss</version>
23+
<version>1.0.10-oss</version>
2424
</dependency>
2525
```
2626

27+
#### Thin JAR
28+
29+
For applications requiring explicit dependency management, use the thin JAR variant:
30+
31+
```xml
32+
<!-- Note: Available from version 1.0.10-oss onwards -->
33+
<dependency>
34+
<groupId>com.databricks</groupId>
35+
<artifactId>databricks-jdbc-thin</artifactId>
36+
<version>1.0.10-oss</version>
37+
</dependency>
38+
```
39+
40+
The thin JAR contains only the driver code and declares all dependencies in its POM, enabling dependency introspection and version management.
41+
2742
### Build from Source
2843

2944
1. Clone the repository
3045
2. Run the following command:
3146
```bash
3247
mvn clean package
3348
```
34-
3. The jar file is generated as `target/databricks-jdbc-<version>.jar`
49+
3. The following JAR files are generated:
50+
- `target/databricks-jdbc-<version>.jar` (standard JAR with bundled dependencies)
51+
- `target/databricks-jdbc-<version>-thin.jar` (thin JAR without dependencies)
3552
4. The test coverage report is generated in `target/site/jacoco/index.html`
3653

54+
To install the thin JAR locally with dependency metadata:
55+
```bash
56+
VERSION=$(grep -m1 '<version>' pom.xml | sed 's/.*<version>\(.*\)<\/version>.*/\1/')
57+
mvn install:install-file -Dfile="target/databricks-jdbc-${VERSION}-thin.jar" -DpomFile=thin_public_pom.xml
58+
```
59+
3760
## Usage
3861

3962
### Connection String

development/.release-freeze.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
{
22
"freeze": false,
3-
"reason": "Release description",
4-
"allow_list": []
5-
}
3+
"reason": ""
4+
}

pom.xml

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<groupId>com.databricks</groupId>
66
<artifactId>databricks-jdbc</artifactId>
77
<!-- This value may be modified by a release script to reflect the current version of the driver. -->
8-
<version>1.0.9-oss</version>
8+
<version>1.0.10-oss</version>
99
<packaging>jar</packaging>
1010
<name>Databricks JDBC Driver</name>
1111
<description>Databricks JDBC Driver.</description>
@@ -51,11 +51,12 @@
5151
<google.guava.version>33.0.0-jre</google.guava.version>
5252
<junit.jupiter.version>5.9.2</junit.jupiter.version>
5353
<google.findbugs.annotations.version>3.0.1</google.findbugs.annotations.version>
54+
<gson.version>2.13.2</gson.version>
5455
<immutables.value.version>2.9.2</immutables.value.version>
5556
<httpclient.version>4.5.14</httpclient.version>
5657
<commons-configuration.version>2.10.1</commons-configuration.version>
5758
<commons-io.version>2.14.0</commons-io.version>
58-
<databricks-sdk.version>0.60.0</databricks-sdk.version>
59+
<databricks-sdk.version>0.65.0</databricks-sdk.version>
5960
<maven-surefire-plugin.version>3.1.2</maven-surefire-plugin.version>
6061
<sql-logic-test.version>0.3</sql-logic-test.version>
6162
<lz4-compression.version>1.8.0</lz4-compression.version>
@@ -65,9 +66,9 @@
6566
<slt.token>dummy-token</slt.token>
6667
<wiremock.version>3.5.4</wiremock.version>
6768
<nimbusjose.version>10.0.2</nimbusjose.version>
68-
<bouncycastle.version>1.78.1</bouncycastle.version>
69+
<bouncycastle.version>1.79</bouncycastle.version>
6970
<async-httpclient.version>5.3.1</async-httpclient.version>
70-
<netty.version>4.2.0.Final</netty.version>
71+
<netty.version>4.2.6.Final</netty.version>
7172
<grpc.version>1.71.0</grpc.version>
7273
<resilience4j.version>1.7.0</resilience4j.version>
7374
</properties>
@@ -79,6 +80,12 @@
7980
<artifactId>commons-lang3</artifactId>
8081
<version>${commons-lang3.version}</version>
8182
</dependency>
83+
<!-- Force safe version of Gson to fix CVE-2025-53864 -->
84+
<dependency>
85+
<groupId>com.google.code.gson</groupId>
86+
<artifactId>gson</artifactId>
87+
<version>${gson.version}</version>
88+
</dependency>
8289
</dependencies>
8390
</dependencyManagement>
8491
<dependencies>
@@ -676,9 +683,6 @@
676683
<pomFile>${project.basedir}/uber-minimal-pom.xml</pomFile>
677684
<sources>${project.build.directory}/${project.build.finalName}-sources.jar</sources>
678685
<javadoc>${project.build.directory}/${project.build.finalName}-javadoc.jar</javadoc>
679-
<files>${project.build.directory}/${project.build.finalName}-thin.jar</files>
680-
<types>jar</types>
681-
<classifiers>thin</classifiers>
682686
</configuration>
683687
<executions>
684688
<execution>
@@ -699,10 +703,14 @@
699703
<publishingServerId>central</publishingServerId>
700704
<autoPublish>true</autoPublish>
701705
<waitUntil>published</waitUntil>
706+
<!-- Use minimal POM for fat jar publishing -->
707+
<pomFile>${project.basedir}/uber-minimal-pom.xml</pomFile>
702708
</configuration>
703709
</plugin>
704710
</plugins>
705711
</build>
706712
</profile>
713+
707714
</profiles>
715+
708716
</project>

src/main/java/com/databricks/client/jdbc/Driver.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,11 @@
2222
import java.util.List;
2323
import java.util.Properties;
2424
import java.util.TimeZone;
25+
import java.util.concurrent.CompletableFuture;
2526
import java.util.logging.Logger;
2627

2728
/** Databricks JDBC driver. */
28-
public class Driver implements IDatabricksDriver, java.sql.Driver {
29+
public class Driver implements IDatabricksDriver {
2930
private static final JdbcLogger LOGGER = JdbcLoggerFactory.getLogger(Driver.class);
3031
private static final Driver INSTANCE;
3132

@@ -57,8 +58,8 @@ public Connection connect(String url, Properties info) throws DatabricksSQLExcep
5758
IDatabricksConnectionContext connectionContext =
5859
DatabricksConnectionContextFactory.create(url, info);
5960
DriverUtil.setUpLogging(connectionContext);
61+
CompletableFuture.runAsync(() -> LOGGER.info(getDriverSystemConfiguration().toString()));
6062
UserAgentManager.setUserAgent(connectionContext);
61-
LOGGER.info(getDriverSystemConfiguration().toString());
6263
DatabricksConnection connection = new DatabricksConnection(connectionContext);
6364
boolean isConnectionOpen = false;
6465
try {

0 commit comments

Comments
 (0)