Skip to content

Commit d5f344b

Browse files
gopalldbclaude
andauthored
Update release-thin.yml to use new Maven Central Portal (#1091)
## Description Changes: - Replace legacy Sonatype OSS URL with new Maven Central Portal API - Use bundle-based deployment approach (REST API) - Fix thin JAR filename: -oss-thin.jar -> -thin.jar - Use thin_public_pom.xml instead of generatePom=true - Upload bundle to https://central.sonatype.com/api/v1/publisher/upload - Set publishingType=AUTOMATIC for automatic publishing This matches the successful manual deployment that was tested. 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- Provide a brief summary of the changes made and the issue they aim to address.--> ## Testing <!-- Describe how the changes have been tested--> Did a manual deploy for thin jar Have done following testing: 1. Driver Loading - Successfully loaded com.databricks.client.jdbc.Driver 2. DriverManager Registration - Driver properly registered 3. Driver Metadata - Retrieved version 3.0 metadata 4. URL Acceptance - Correctly accepts/rejects JDBC URLs 5. Class Loading - All 7 critical classes loadable: - DatabricksConnection - DatabricksStatement - DatabricksResultSet - DatabricksThriftServiceClient - DatabricksSdkClient - ArrowStreamResult - DatabricksUCVolumeClient 6. Query Execution - Successfully connected and executed SELECT 1 ✅ Files Created - pom.xml - Maven project with thin JAR dependency + all runtime deps - ThinJarVerification.java - Comprehensive verification application - README.md - Complete documentation with setup and usage instructions Key Findings ✅ The thin JAR (2.4MB) contains all required Databricks driver classes ✅ No third-party dependencies bundled (truly "thin") ✅ Proper JDBC driver registration via META-INF/services ✅ Can successfully connect to Databricks and execute queries ✅ Arrow integration works correctly with proper JVM arguments ## Additional Notes to the Reviewer <!-- Share any additional context or insights that may help the reviewer understand the changes better. This could include challenges faced, limitations, or compromises made during the development process. Also, mention any areas of the code that you would like the reviewer to focus on specifically. --> NO_CHANGELOG=true --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent 53989bb commit d5f344b

12 files changed

Lines changed: 165 additions & 54 deletions

File tree

.github/workflows/release-thin.yml

Lines changed: 83 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -31,28 +31,96 @@ jobs:
3131
echo "pinentry-mode loopback" >> ~/.gnupg/gpg.conf
3232
gpg-connect-agent reloadagent /bye
3333
34-
- name: Build thin JAR
34+
- name: Build thin JAR with sources and javadocs
3535
run: |
36-
mvn -B -DskipTests package
36+
# Build main artifacts including sources and javadocs
37+
mvn -B -DskipTests package source:jar javadoc:jar
3738
38-
- name: Verify thin jar exists
39+
- name: Sign all thin JAR artifacts
3940
run: |
4041
VERSION=$(grep -m1 '<version>' pom.xml | sed 's/.*<version>\(.*\)<\/version>.*/\1/')
41-
test -f "target/databricks-jdbc-${VERSION}-oss-thin.jar"
42+
43+
# Sign thin JAR
44+
echo "$GPG_PASSPHRASE" | gpg --batch --yes --passphrase-fd 0 --pinentry-mode loopback \
45+
--armor --detach-sign "target/databricks-jdbc-${VERSION}-thin.jar"
46+
47+
# Sign sources JAR
48+
echo "$GPG_PASSPHRASE" | gpg --batch --yes --passphrase-fd 0 --pinentry-mode loopback \
49+
--armor --detach-sign "target/databricks-jdbc-${VERSION}-sources.jar"
50+
51+
# Sign javadoc JAR
52+
echo "$GPG_PASSPHRASE" | gpg --batch --yes --passphrase-fd 0 --pinentry-mode loopback \
53+
--armor --detach-sign "target/databricks-jdbc-${VERSION}-javadoc.jar"
54+
env:
55+
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
56+
57+
- name: Verify all required artifacts exist
58+
run: |
59+
VERSION=$(grep -m1 '<version>' pom.xml | sed 's/.*<version>\(.*\)<\/version>.*/\1/')
60+
test -f "target/databricks-jdbc-${VERSION}-thin.jar"
61+
test -f "target/databricks-jdbc-${VERSION}-thin.jar.asc"
62+
test -f "target/databricks-jdbc-${VERSION}-sources.jar"
63+
test -f "target/databricks-jdbc-${VERSION}-sources.jar.asc"
64+
test -f "target/databricks-jdbc-${VERSION}-javadoc.jar"
65+
test -f "target/databricks-jdbc-${VERSION}-javadoc.jar.asc"
4266
4367
- name: Publish Thin JAR as Separate Artifact to Maven Central
4468
run: |
4569
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}"
70+
71+
echo "Creating deployment bundle for thin JAR..."
72+
73+
# Create staging directory
74+
mkdir -p target/thin-staging/com/databricks/databricks-jdbc-thin/${VERSION}
75+
76+
# Copy thin JAR and its signature
77+
cp "target/databricks-jdbc-${VERSION}-thin.jar" \
78+
target/thin-staging/com/databricks/databricks-jdbc-thin/${VERSION}/databricks-jdbc-thin-${VERSION}.jar
79+
cp "target/databricks-jdbc-${VERSION}-thin.jar.asc" \
80+
target/thin-staging/com/databricks/databricks-jdbc-thin/${VERSION}/databricks-jdbc-thin-${VERSION}.jar.asc
81+
82+
# Copy sources JAR and its signature
83+
cp "target/databricks-jdbc-${VERSION}-sources.jar" \
84+
target/thin-staging/com/databricks/databricks-jdbc-thin/${VERSION}/databricks-jdbc-thin-${VERSION}-sources.jar
85+
cp "target/databricks-jdbc-${VERSION}-sources.jar.asc" \
86+
target/thin-staging/com/databricks/databricks-jdbc-thin/${VERSION}/databricks-jdbc-thin-${VERSION}-sources.jar.asc
87+
88+
# Copy javadoc JAR and its signature
89+
cp "target/databricks-jdbc-${VERSION}-javadoc.jar" \
90+
target/thin-staging/com/databricks/databricks-jdbc-thin/${VERSION}/databricks-jdbc-thin-${VERSION}-javadoc.jar
91+
cp "target/databricks-jdbc-${VERSION}-javadoc.jar.asc" \
92+
target/thin-staging/com/databricks/databricks-jdbc-thin/${VERSION}/databricks-jdbc-thin-${VERSION}-javadoc.jar.asc
93+
94+
# Copy POM and sign it
95+
cp thin_public_pom.xml target/thin-staging/com/databricks/databricks-jdbc-thin/${VERSION}/databricks-jdbc-thin-${VERSION}.pom
96+
echo "$GPG_PASSPHRASE" | gpg --batch --yes --passphrase-fd 0 --pinentry-mode loopback \
97+
--armor --detach-sign \
98+
target/thin-staging/com/databricks/databricks-jdbc-thin/${VERSION}/databricks-jdbc-thin-${VERSION}.pom
99+
100+
# Generate checksums for all files
101+
cd target/thin-staging/com/databricks/databricks-jdbc-thin/${VERSION}
102+
for file in databricks-jdbc-thin-*; do
103+
md5sum "$file" | awk '{print $1}' > "${file}.md5"
104+
sha1sum "$file" | awk '{print $1}' > "${file}.sha1"
105+
done
106+
cd $GITHUB_WORKSPACE
107+
108+
# Create bundle ZIP
109+
cd target/thin-staging
110+
zip -r ../central-thin-bundle.zip com/
111+
cd $GITHUB_WORKSPACE
112+
113+
echo "Uploading bundle to Maven Central Portal..."
114+
115+
# Upload to new Maven Central Portal
116+
curl -X POST \
117+
-u "$MAVEN_CENTRAL_USERNAME:$MAVEN_CENTRAL_PASSWORD" \
118+
-F "bundle=@target/central-thin-bundle.zip" \
119+
-F "publishingType=AUTOMATIC" \
120+
-w "\nHTTP_STATUS:%{http_code}\n" \
121+
https://central.sonatype.com/api/v1/publisher/upload
122+
123+
echo "Thin JAR published successfully!"
56124
env:
57125
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
58126
MAVEN_CENTRAL_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }}
@@ -62,5 +130,5 @@ jobs:
62130
uses: softprops/action-gh-release@v1
63131
with:
64132
files: |
65-
target/*-oss-thin.jar
133+
target/*-thin.jar
66134

.github/workflows/release.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,17 @@
11
name: Release
22
on:
3-
push:
4-
tags:
5-
- 'v*'
63
workflow_dispatch:
4+
workflow_run:
5+
workflows: ["Release Thin JAR"]
6+
types:
7+
- completed
78

89
jobs:
910
publish:
11+
# Only run if thin JAR workflow succeeded or manual trigger
12+
if: |
13+
github.event_name == 'workflow_dispatch' ||
14+
(github.event_name == 'workflow_run' && github.event.workflow_run.conclusion == 'success')
1015
runs-on:
1116
group: databricks-protected-runner-group
1217
labels: linux-ubuntu-latest

src/main/java/com/databricks/jdbc/api/IDatabricksResultSet.java

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,12 @@ public interface IDatabricksResultSet extends ResultSet {
2323
Struct getStruct(String columnLabel) throws SQLException;
2424

2525
/**
26-
* Retrieves the SQL `Map` from the specified column using its label.
26+
* Retrieves the SQL {@code Map} from the specified column using its label.
2727
*
2828
* @param columnLabel the label for the column specified in the SQL query
29-
* @return a `Map<String, Object>` if the column contains a map; `null` if the value is SQL `NULL`
30-
* @throws SQLException if the column is not of `MAP` type or if any SQL error occurs
29+
* @return a {@code Map<String, Object>} if the column contains a map; {@code null} if the value
30+
* is SQL {@code NULL}
31+
* @throws SQLException if the column is not of {@code MAP} type or if any SQL error occurs
3132
*/
3233
Map<String, Object> getMap(String columnLabel) throws SQLException;
3334

@@ -77,11 +78,12 @@ public interface IDatabricksResultSet extends ResultSet {
7778
boolean hasUpdateCount() throws SQLException;
7879

7980
/**
80-
* Retrieves the SQL `Map` from the specified column index in the result set.
81+
* Retrieves the SQL {@code Map} from the specified column index in the result set.
8182
*
8283
* @param columnIndex the index of the column in the result set (1-based)
83-
* @return a `Map<String, Object>` if the column contains a map; `null` if the value is SQL `NULL`
84-
* @throws SQLException if the column is not of `MAP` type or if any SQL error occurs
84+
* @return a {@code Map<String, Object>} if the column contains a map; {@code null} if the value
85+
* is SQL {@code NULL}
86+
* @throws SQLException if the column is not of {@code MAP} type or if any SQL error occurs
8587
*/
8688
Map<String, Object> getMap(int columnIndex) throws SQLException;
8789

src/main/java/com/databricks/jdbc/api/impl/ColumnarRowView.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99

1010
/**
1111
* Memory-efficient columnar view that provides row-based access without materializing all rows.
12-
* Instead of creating List<List<Object>>, this class provides direct access to columnar data on a
13-
* per-row, per-column basis, significantly reducing memory allocations.
12+
* Instead of creating {@code List<List<Object>>}, this class provides direct access to columnar
13+
* data on a per-row, per-column basis, significantly reducing memory allocations.
1414
*/
1515
public class ColumnarRowView {
1616
private final List<TColumn> columns;

src/main/java/com/databricks/jdbc/api/impl/ComplexDataTypeParser.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ private Timestamp parseTimestamp(String text) {
236236
*
237237
* @param jsonString The JSON string representation of the complex type
238238
* @param complexType The type of complex data (MAP, ARRAY, STRUCT)
239-
* @param typeMetadata The metadata for the type (e.g., "MAP<INT,INT>")
239+
* @param typeMetadata The metadata for the type (e.g., {@code MAP<INT,INT>})
240240
* @return A consistently formatted string representation
241241
*/
242242
public String formatComplexTypeString(
@@ -260,7 +260,7 @@ public String formatComplexTypeString(
260260
* Formats a map JSON string into the standard {key:value} format.
261261
*
262262
* @param jsonString The JSON string representation of the map
263-
* @param mapMetadata The metadata for the map type (e.g., "MAP<INT,INT>")
263+
* @param mapMetadata The metadata for the map type (e.g., {@code MAP<INT,INT>})
264264
* @return A map string in the format {key:value,key:value}
265265
*/
266266
public String formatMapString(String jsonString, String mapMetadata) {

src/main/java/com/databricks/jdbc/api/impl/DatabricksConnection.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,14 +132,14 @@ public String nativeSQL(String sql) throws SQLException {
132132
* <li>After each COMMIT or ROLLBACK statement
133133
* </ul>
134134
*
135-
* <h3>Thread Safety</h3>
135+
* <p><b>Thread Safety</b>
136136
*
137137
* <p><b>This method is not thread-safe.</b> The {@code Connection} object should not be shared
138138
* across multiple threads. Concurrent access may lead to undefined behavior and server-side
139139
* transaction aborts due to sequence ID mismatches. Each thread should obtain its own {@code
140140
* Connection} from a connection pool.
141141
*
142-
* <h3>Example Usage</h3>
142+
* <p><b>Example Usage</b>
143143
*
144144
* <pre>{@code
145145
* // Disable auto-commit to start a transaction

src/main/java/com/databricks/jdbc/api/impl/DatabricksResultSet.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1265,11 +1265,12 @@ public Struct getStruct(int columnIndex) throws SQLException {
12651265
}
12661266

12671267
/**
1268-
* Retrieves the SQL `Map` from the specified column index in the result set.
1268+
* Retrieves the SQL {@code Map} from the specified column index in the result set.
12691269
*
12701270
* @param columnIndex the index of the column in the result set (1-based)
1271-
* @return a `Map<String, Object>` if the column contains a map; `null` if the value is SQL `NULL`
1272-
* @throws SQLException if the column is not of `MAP` type or if any SQL error occurs
1271+
* @return a {@code Map<String, Object>} if the column contains a map; {@code null} if the value
1272+
* is SQL {@code NULL}
1273+
* @throws SQLException if the column is not of {@code MAP} type or if any SQL error occurs
12731274
*/
12741275
@Override
12751276
public Map getMap(int columnIndex) throws SQLException {

src/main/java/com/databricks/jdbc/api/impl/arrow/ChunkLinkDownloadService.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@
2626
*
2727
* <p>This service maintains a CompletableFuture for each chunk's external link.
2828
*
29-
* <h3>Key Features:</h3>
29+
* <p><b>Key Features:</b>
3030
*
31-
* <h4>1. Download Pipeline:</h4>
31+
* <p><b>1. Download Pipeline:</b>
3232
*
3333
* <ul>
3434
* <li>Automatically initiates a download chain when using SQL Execution API
@@ -37,7 +37,7 @@
3737
* <li>Completes the corresponding futures as soon as links are received
3838
* </ul>
3939
*
40-
* <h4>2. Link Expiration Handling:</h4>
40+
* <p><b>2. Link Expiration Handling:</b>
4141
*
4242
* <ul>
4343
* <li>Monitors link expiration when chunks request their download links
@@ -48,7 +48,7 @@
4848
* </ul>
4949
* </ul>
5050
*
51-
* <h4>3. Correctness Guarantee:</h4>
51+
* <p><b>3. Correctness Guarantee:</b>
5252
*
5353
* <p>The service maintains correctness through two mechanisms:
5454
*

src/main/java/com/databricks/jdbc/api/impl/volume/DatabricksUCVolumeClient.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -253,8 +253,7 @@ public boolean volumeExists(String catalog, String schema, String volumeName)
253253
* @param prefix the prefix of the filenames to list. This includes the relative path from the
254254
* volume as the root directory
255255
* @param caseSensitive a boolean indicating whether the check should be case-sensitive or not
256-
* @return List<String> a list of strings indicating the filenames that start with the specified
257-
* prefix
256+
* @return a list of strings indicating the filenames that start with the specified prefix
258257
*/
259258
@Override
260259
public List<String> listObjects(

src/main/java/com/databricks/jdbc/api/internal/IDatabricksSession.java

Lines changed: 46 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -43,34 +43,71 @@ public interface IDatabricksSession {
4343
/** Closes the session. */
4444
void close() throws DatabricksSQLException;
4545

46-
/** Returns the client for connecting to Databricks server */
46+
/**
47+
* Returns the client for connecting to Databricks server
48+
*
49+
* @return the Databricks client
50+
*/
4751
IDatabricksClient getDatabricksClient();
4852

49-
/** Returns the metadata client */
53+
/**
54+
* Returns the metadata client
55+
*
56+
* @return the Databricks metadata client
57+
*/
5058
IDatabricksMetadataClient getDatabricksMetadataClient();
5159

52-
/** Returns default catalog associated with the session */
60+
/**
61+
* Returns default catalog associated with the session
62+
*
63+
* @return the default catalog
64+
*/
5365
String getCatalog();
5466

55-
/** Returns the compression algorithm used on results data */
67+
/**
68+
* Returns the compression algorithm used on results data
69+
*
70+
* @return the compression codec
71+
*/
5672
CompressionCodec getCompressionCodec();
5773

58-
/** Returns default schema associated with the session */
74+
/**
75+
* Returns default schema associated with the session
76+
*
77+
* @return the default schema
78+
*/
5979
String getSchema();
6080

61-
/** Sets the default catalog */
81+
/**
82+
* Sets the default catalog
83+
*
84+
* @param catalog the catalog to set
85+
*/
6286
void setCatalog(String catalog);
6387

64-
/** Sets the default schema */
88+
/**
89+
* Sets the default schema
90+
*
91+
* @param schema the schema to set
92+
*/
6593
void setSchema(String schema);
6694

6795
/** Extracts session to a string */
6896
String toString();
6997

70-
/** Returns the session configs */
98+
/**
99+
* Returns the session configs
100+
*
101+
* @return map of session configuration key-value pairs
102+
*/
71103
Map<String, String> getSessionConfigs();
72104

73-
/** Sets the session config */
105+
/**
106+
* Sets the session config
107+
*
108+
* @param name the configuration name
109+
* @param value the configuration value
110+
*/
74111
void setSessionConfig(String name, String value);
75112

76113
/** Returns the client info properties */

0 commit comments

Comments
 (0)