Connect Your Spreadsheet to Databricks

Row Zero makes it easy to connect Databricks to a powerful spreadsheet designed for big data. Seamlessly import big datasets and leverage spreadsheet features to analyze Databricks data. Schedule auto-refresh and everything automatically updates, including pivot tables, charts, formulas, etc. You can also write-back to Databricks.

Connect to Databricks

Table of Contents

Connect Row Zero to Databricks

Row Zero supports all cloud platforms (AWS, Azure, and GCP). The following instructions cover connecting Row Zero to a Databricks Lakehouse through two different methods of authentication:

  • Personal Access Token
  • Databricks OAuth
  • Personal Access Token

    In a Row Zero workbook, click on the 'Data' icon in the upper right-hand corner and then click the button to '+ Add connection.'add Databricks connection to spreadsheet

    The Databricks connector requires a few pieces of information defined below.

    Databricks connector in spreadsheet
    1. Connection name - This field can be anything that helps identify the data source being connected. (e.g. "Production Data" or "Product Metrics")
    2. Server hostname - This is the Databricks warehouse name, which can be found in your Databricks portal under the SQL Warehouses menu. In SQL Warehouses, click on the warehouse you wish to connect to. Your server hostname is listed under 'Connection details' and is the long string of letters and numbers under "server hostname" at the top of the screen (e.g. cbd-9hfliu9u-83jd.cloud.databricks.com).Databricks server hostname
    3. Access Token - Your access token can be generated by going to your account icon in the upper right-hand corner of the Databricks portal, selecting 'Settings' and then 'Developer.' Click the blue button to generate your access token. If you do not see a blue button, contact your Databricks account admin as they will need to update your Databricks personal access token permissionsDatabricks access token screenDatabricks generate access token

    Once all the information is entered, hit 'Test connection' to ensure the information is correct. If the test returns red, check your connection details and try again. Once the connection turns green, you can select which of your Databricks SQL Warehouses you want to use for Row Zero queries and click '+ Add source'.

    Databricks access token screen

    Databricks OAuth

    To connect to Databricks using OAuth, a Databricks Admin at your company will need to pre-configure the connection. Instructions for OAuth setup at your company can be found in our Databricks OAuth page. After your Databricks and Row Zero accounts have been configured to use Databricks OAuth, you can use the following instructions to login.

    Click the 'Data' icon in the top right corner of your workbook, click 'Add connection', and select 'Databricks OAuth' for connection type.

    connect spreadsheet to databricks using databricks oauth

    Click 'Connect to Databricks' and you will be directed to Databricks to log in.

    Databricks oauth sign-in

    Click 'Sign-in' and you will see a page saying 'Succeeded. You can close this window.' Your Databricks OAuth sign-in is complete, and you can now return to your original tab or window to finish setup.

    Databricks oauth success

    Select which of your Databricks SQL Warehouses you want to use for Row Zero queries and click '+ Add source'. Now you can import data from Databricks into a spreadsheet in Row Zero.

    Databricks oauth choose warehouse

    Write a query to import Databricks data

    Now that Databricks is connected to your spreadsheet, click the "+" sign next to your Databricks connection to insert a connected table.add databricks connected table to spreadsheetThis adds a data table to your spreadsheet that is connected to Databricks and opens a query editor. Select the 'Catalog' and 'Schema' from the two drop downs and then write a SQL query. The easiest query to write is a 'select *' statement, which pulls in the entire table. For example:

    select * from table_name

    Click 'Run' to execute the query and import the queried Databricks data into your spreadsheet.

    databricks connected spreadsheet

    The data imports directly into a connected table in the spreadsheet, which provides a dynamic, condensed view of the data and makes it easy to filter, sort, format, pivot, chart, etc. You can also add calculated columns and reference the data in formula functions throughout your workbook. Double-click on the connected table to re-run your query for the latest data or schedule auto-refresh and everything built on connected data automatically updates and stays in sync. Here is more info on how to build connected spreadsheets.

    Save Your Spreadsheet to Databricks

    With a connected Databricks account, you can export data sets from Row Zero to your cloud data warehouse. Once you've defined the data you would like to save as a table in Databricks, right click on the data table or selected range and navigate to 'Export to > Databricks' in the context menu.

    Export to Databricks

    The export to Databricks modal will pop and ask you to select the database, schema, and specify a table name. New table names are forced to start with 'rz_' to avoid overwriting any tables already in the Databricks cloud data warehouse. Hit export and Row Zero will create a new table in Databricks and import all the data from your selected spreadsheet range or table. When the export is complete, you will see a notification in the upper right-hand corner.

    Export to Databricks modal

    Databricks export complete

    To verify your table is in Databricks, use either of the commands below or simply write a query against it.

    show tables
    select * from rz_table_name

    Ready to get started?

    Connect to Databricks and build Databricks connected spreadsheets that auto-update as source data changes.

    Connect to Databricks