DataGrip integration with Databricks
Note
This article covers DataGrip, which is neither provided nor supported by Databricks. To contact the provider, see DataGrip Support.
DataGrip is an integrated development environment (IDE) for database developers that provides a query console, schema navigation, explain plans, smart code completion, real-time analysis and quick fixes, refactorings, version control integration, and other features.
This article describes how to use your local development machine to install, configure, and use DataGrip to work with databases in Databricks.
Note
This article was tested with macOS, Databricks JDBC Driver version 2.6.36, and DataGrip version 2023.3.1.
Requirements
Before you install DataGrip, your local development machine must meet the following requirements:
A Linux, macOS, or Windows operating system.
Download the Databricks JDBC Driver onto your local development machine, extracting the
DatabricksJDBC42.jar
file from the downloadedDatabricksJDBC42-<version>.zip
file.A Databricks cluster or SQL warehouse to connect with DataGrip.
Step 1: Install DataGrip
Download and install DataGrip.
Linux: Download the
.zip
file, extract its contents, and then follow the instructions in theInstall-Linux-tar.txt
file.macOS: Download and run the
.dmg
file.Windows: Download and run the
.exe
file.
For more information, see Install DataGrip on the DataGrip website.
Step 2: Configure the Databricks JDBC Driver for DataGrip
Set up DataGrip with information about the Databricks JDBC Driver that you downloaded earlier.
Start DataGrip.
Click File > Data Sources.
In the Data Sources and Drivers dialog box, click the Drivers tab.
Click the + (Driver) button to add a driver.
For Name, enter
Databricks
.On the General tab, in the Driver Files list, click the + (Add) button.
Click Custom JARs.
Browse to and select the
DatabricksJDBC42.jar
file that you extracted earlier, and then click Open.For Class, select
com.databricks.client.jdbc.Driver
.Click OK.
Step 3: Connect DataGrip to your Databricks databases
In DataGrip, click File > Data Sources.
On the Data Sources tab, click the + (Add) button.
Select the Databricks driver that you added in the preceding step.
On the General tab, for URL, enter the value of the JDBC URL field for your Databricks resource. For the JDBC URL field syntax, see Authentication settings for the Databricks JDBC Driver.
Note
The
ConnCatalog
driver capability setting must be specified on the JDBC URL, otherwise schemas cannot be identified.Click Test Connection.
Tip
You should start your resource before testing your connection. Otherwise the test might take several minutes to complete while the resource starts.
If the connection succeeds, on the Schemas tab, check the boxes for the schemas that you want to be able to access, for example All schemas.
Click OK.
Repeat the instructions in this step for each resource that you want DataGrip to access.
Step 4: Use DataGrip to browse tables
Use DataGrip to access tables in your Databricks workspace.
In DataGrip, in the Database window, expand your resource node, expand the schema you want to browse, and then expand tables.
Double-click a table. The first set of rows from the table are displayed.
Repeat the instructions in this step to access additional tables.
To access tables in other schemas, in the Database window’s toolbar, click the Data Source Properties icon. In the Data Sources and Drivers dialog box, on the Schemas tab, check the box for each additional schema you want to access, and then click OK.
Step 5: Use DataGrip to run SQL statements
Use DataGrip to load the sample trips
table from the samples
catalog’s nyctaxi
schema.
In DataGrip, click File > New > SQL File.
Enter a name for the file, for example
select_trips
.In the
select_trips.sql
file tab, enter the following SQL statement:SELECT * FROM samples.nyctaxi.trips;
Select the
SELECT
statement.On the file tab’s toolbar, click the Execute icon.
Next steps
Learn more about the Query console in DataGrip.
Learn about the Data editor in DataGrip.
Learn more about the various tool windows in DataGrip.
Learn how to search in DataGrip.
Learn how to export data in DataGrip.
Learn how to find and replace text using regular expressions in DataGrip.