Write data back to Databricks using the Databricks Excel Add-in
This feature is in Public Preview.
The Databricks Excel Add-in lets you write data from Microsoft Excel back to a Unity Catalog table. You can create a new table or overwrite an existing table in Databricks without leaving Excel.
This page describes how to write data back to Databricks using the Databricks Excel Add-in.
Prerequisites
Before you write data back to Databricks from Excel:
-
The Databricks Excel Add-in is installed and configured.
-
You have access to a running SQL warehouse.
-
You have the necessary privileges on the target catalog and schema in Unity Catalog. There is no separate setting in the Excel Add-in to enable or disable write-back.
- To create a new table, you must have the following privileges:
USE CATALOGon the catalogUSE SCHEMAon the schemaCREATE TABLEon the schema
- To overwrite an existing table, you must have the following privileges:
USE CATALOGon the catalogUSE SCHEMAon the schemaSELECTon the tableMODIFYon the table
For more information, see Unity Catalog privileges reference.
- To create a new table, you must have the following privileges:
Select a SQL warehouse
Select which SQL warehouse to use:
- In the upper-right of the Databricks Add-in pane in Excel, click the drop-down menu.
- Select which SQL warehouse you want to use.
Write data back to Databricks
You can write an Excel range back to Databricks in one of two ways:
- Create a new table: Create a new Unity Catalog table from the selected Excel range.
- Overwrite an existing table: Replace the contents of an existing Unity Catalog table with the selected Excel range.
To create a new Unity Catalog table or overwrite an existing Unity Catalog table from Excel:
- In the Databricks Excel Add-in pane, click the Write back tab.
- Select Create table or Overwrite table.
- Search for and select the destination Catalog and Schema.
- Specify the target table:
- To create a new table, enter a name.
- To overwrite an existing table, select the table you want to overwrite.
- By default, the first row of the selected range is used as the column headers. You can change this under Advanced options.
- Enter the Excel cell range that contains the data you want to write, then click Use selection.
- (Optional) Edit column names. To directly edit a column name, click the column name field in the table preview.
- (Optional) Edit column types. In the table preview, click
letter icon and select the data type you want.
- Click Write to table.
To stop a write-back that is in progress, click Cancel in the Excel Add-in pane.
Limitations
- Write-back supports table-level writes only. Row-level updates, appends, and merges are not supported.
- Write-back does not support creating views or materialized views.
- The Excel Add-in only supports SQL warehouses. All-purpose compute is not supported.