Coefficient's Databricks integration enables you to effortlessly connect your Databricks database server and import data into Google Sheets or Excel. You can import data by choosing specific tables and columns or crafting custom queries.
Schedule your Import, Snapshots, and Add Automations
FAQs for Databricks Integration
Connecting to Databricks
When you begin a Databricks import for the first time, you will need to go through a few steps to connect Databricks as a data source for Coefficient.
ℹ️ NOTE: Coefficient will need the following information: JDBC URL/Personal Access Token (PAT) and Catalog Name.
1. Open the Coefficient Sidebar and click Menu. |
2. Select “Connected Sources”. |
3. Select “Add Connection” at the bottom and then “Connect” to Databricks. |
4. Enter the "JDBC URL" and "Catalog name" for your Databricks server. Click on "Connect" when done. |
ℹ️ VIDEO: For help obtaining your JDBC URL and Personal Access Token, click here.
ℹ️ NOTE: If you need help finding your "JDBC URL," click here.
ℹ️ NOTE: If you need help generating your Personal Access Token, click here. |
5. If your database is behind a firewall, you will need to whitelist (ALL 3) Coefficient's server IP addresses. (34.217.184.131, 44.234.233.60, 52.32.132.51). Click "Connect" when done. |
6. You will then be presented with the option to share this connection with other members of your team who also use Coefficient. Your credentials will NOT be shared with your team. 🎉 |
Import from Databricks
There are a few ways to import data using Coefficient from Databricks: Importing from Tables & Columns, Importing from a Custom SQL Query, and Importing from GPT SQL Builder.
Importing from Tables and columns allows you to create imports without having to write SQL. Using a Custom SQL Query gives you additional flexibility in the data that you are importing into Coefficient. And lastly, you can now prompt the Coefficient's AI to automatically build the SQL query for you. 🤯
Import from Tables & Columns
1. From the Sidebar select “Import from…”. |
2. Select “Databricks” from the list. |
3. Select "From Tables & Columns". |
4. The Import Preview window opens showing all the table schemas from your Databricks database. Select the table for your import. (e.g.”default.customer_202406181234”)
5. Once the table is selected, the fields within that table will appear in a list on the left side of the Import Preview window. Select the fields you want to include in your import by checking/unchecking the corresponding boxes.
ℹ️ NOTE: The Import Preview shows only a sample of your data (50 rows). This sample data will be updated if there are any changes to the import's criteria.
6. Customize your import by adding filters, sorts, limits, or even grouping the data into a cloud pivot table. Then "Import" when done.
7. Congratulations on your first Databricks import using Tables & Columns! 🎉
Import from Custom SQL Query
1. From the Sidebar select “Import from…”. |
2. Select “Databricks” from the list. |
3. Select "Custom SQL Query".
|
4. The Import Preview window opens, allowing you to enter your custom SQL query in the blue text box shown below. For further flexibility, you can use Coefficient’s SQL Parameters feature to point a value to a specific cell/range of cells for your query.
ℹ️ NOTE: Whenever you make changes to your query, you need to click "Refresh Preview" to update the sample data shown in the preview window.
5. When you click “Import”, you will be prompted to give your import a name. The name MUST be UNIQUE, as it will also be the name of the tab in your Google Sheets/Excel when imported. (You can always change the name later if needed).
6. Congratulations on your successful Databricks Custom SQL import with Coefficient! 🎉
Import from GPT SQL Builder
1. From the Sidebar select “Import from…”. |
2. Select “Databricks” from the list. |
3. Select "GPT SQL Builder". |
4. Select your database schema (eg. order_v_3) and enter your prompt/query in the "Describe what you want to query" box. (Example: "Give me all the orders created from the year 2021") When done, click "Generate SQL".
ℹ️ PRO TIP: Be specific when entering your prompts so the AI can easily understand your requirements and provide more accurate results.
5. The GPT SQL Builder will automatically generate and write the SQL query for you in the blue text box. The sample data of your query's result are shown at the bottom (the first 50 rows are displayed). Click "Import" when done.
6. You will be prompted to give your import a name. Remember it MUST be UNIQUE as it will also be the name of the tab in your Google Sheets/Excel when imported. (You can always change the name later if needed).
7. Congratulations on your Databricks import using Coefficient's GPT SQL Builder! 🎉
Schedule your Import, Snapshots, and Add Automations
Once you have pulled your data into your spreadsheet using Coefficient, you can set up the following:
|
FAQs for Databricks Integration
How can I generate my Personal Access Token (PAT) in Databricks:
- Login to your Databricks account.
-
In Databricks, click on your user icon in the top right corner and choose "Settings."
- Navigate to the "Developer" tab. Under "Access tokens," click "Manage," then select "Generate new token."
- Give the token a name. If you want the token to never expire, leave the Lifetime field blank. Click "Generate" and copy the token. Use this token to replace <personal-access-token> in the JDBC URL.
I'm stuck on "Connecting" while trying to link Coefficient with my Databricks server. How can I fix this?
Here are a few things you can try:
- Ensure you entered the correct JDBC URL and Catalog Name for your Databricks instance.
- Ensure that the cluster you are trying to connect with is properly running.
- If your database is behind a firewall, you must whitelist all (3) of Coefficient's IP Addresses from your database server. Check this article for more information.
- 34.217.184.131
- 44.234.233.60
- 52.32.132.51
- If you see a specific connection error (e.g., Invalid PAT, Host, or Catalog Name), please contact support (support@coefficient.io)for further assistance.
Can I create multiple Catalog connections with Coefficient?
Yes, Coefficient supports multiple connections with our Databricks integration. To create an additional connection, launch the sidebar, click on "Import from," then select "Add Connection," and choose "Databricks SQL." Enter the JDBC URL and Catalog you want to connect to. We highly recommend naming each connection to distinguish between them easily.