-
Notifications
You must be signed in to change notification settings - Fork 1.9k
feat(databricks-jdbc-driver): Switch to the latest OSS Databricks JDBC driver #9376
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
fa08b2e
add noExtract flag to downloadAndExtractFile()
KSDaemon 7545e49
code polishment
KSDaemon 31c339a
switch to oss driver version
KSDaemon 77f910e
add dstFileName option to downloadAndExtractFile()
KSDaemon 426a7e1
extract driver version to constant
KSDaemon f49ebcd
remove databrickAcceptPolicy() flow as new OSS driver is Apache 2.0 Lic
KSDaemon 295dd7a
fix postinstall
KSDaemon File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,38 +1,32 @@ | ||
| import path from 'path'; | ||
| import { downloadAndExtractFile, getEnv } from '@cubejs-backend/shared'; | ||
|
|
||
| function acceptedByEnv() { | ||
| const acceptStatus = getEnv('databrickAcceptPolicy'); | ||
| if (acceptStatus) { | ||
| console.log('You accepted Terms & Conditions for JDBC driver from DataBricks by CUBEJS_DB_DATABRICKS_ACCEPT_POLICY'); | ||
| } | ||
|
|
||
| if (acceptStatus === false) { | ||
| console.log('You declined Terms & Conditions for JDBC driver from DataBricks by CUBEJS_DB_DATABRICKS_ACCEPT_POLICY'); | ||
| console.log('Installation will be skipped'); | ||
| } | ||
|
|
||
| return acceptStatus; | ||
| } | ||
|
|
||
| export const OSS_DRIVER_VERSION = '1.0.2'; | ||
|
|
||
| /** | ||
| * In the beginning of 2025 Databricks released their open-source version of JDBC driver and encourage | ||
| * all users to migrate to it as company plans to focus on improving and evolving it over legacy simba driver. | ||
| * More info about OSS Driver could be found at https://docs.databricks.com/aws/en/integrations/jdbc/oss | ||
| * As of March 2025 To use the Databricks JDBC Driver (OSS), the following requirements must be met: | ||
| * Java Runtime Environment (JRE) 11.0 or above. CI testing is supported on JRE 11, 17, and 21. | ||
| */ | ||
| export async function downloadJDBCDriver(): Promise<string | null> { | ||
| const driverAccepted = acceptedByEnv(); | ||
|
|
||
| if (driverAccepted) { | ||
| console.log('Downloading DatabricksJDBC42-2.6.29.1051'); | ||
| // TODO: Just to throw a console warning that this ENV is obsolete and could be safely removed | ||
| getEnv('databrickAcceptPolicy'); | ||
|
|
||
| await downloadAndExtractFile( | ||
| 'https://databricks-bi-artifacts.s3.us-east-2.amazonaws.com/simbaspark-drivers/jdbc/2.6.29/DatabricksJDBC42-2.6.29.1051.zip', | ||
| { | ||
| showProgress: true, | ||
| cwd: path.resolve(path.join(__dirname, '..', 'download')), | ||
| } | ||
| ); | ||
| console.log(`Downloading databricks-jdbc-${OSS_DRIVER_VERSION}-oss.jar`); | ||
|
|
||
| console.log('Release notes: https://databricks-bi-artifacts.s3.us-east-2.amazonaws.com/simbaspark-drivers/jdbc/2.6.29/docs/release-notes.txt'); | ||
| await downloadAndExtractFile( | ||
| `https://repo1.maven.org/maven2/com/databricks/databricks-jdbc/${OSS_DRIVER_VERSION}-oss/databricks-jdbc-${OSS_DRIVER_VERSION}-oss.jar`, | ||
| { | ||
| showProgress: true, | ||
| cwd: path.resolve(path.join(__dirname, '..', 'download')), | ||
| noExtract: true, | ||
| dstFileName: `databricks-jdbc-${OSS_DRIVER_VERSION}-oss.jar`, | ||
| } | ||
| ); | ||
|
|
||
| return path.resolve(path.join(__dirname, '..', 'download', 'DatabricksJDBC42.jar')); | ||
| } | ||
| console.log(`Release notes: https://mvnrepository.com/artifact/com.databricks/databricks-jdbc/${OSS_DRIVER_VERSION}-oss`); | ||
|
|
||
| return null; | ||
| return path.resolve(path.join(__dirname, '..', 'download', `databricks-jdbc-${OSS_DRIVER_VERSION}-oss.jar`)); | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.