Business intelligence with Databricks SQL
In SAP Databricks, users can use the SQL editor to connect to serverless SQL warehouses set up by administrators to efficiently run SQL queries.
The SAP Databricks UI includes a SQL editor that you can use to author queries, browse available data, and create visualizations. You can also share your saved queries with other team members in the workspace.
This page details specific guidance for using the SQL editor in SAP Databricks.
Features
The following features related to Databricks SQL are included in SAP Databricks:
- SQL editor
- Serverless SQL warehouses
- Visualizations in Databricks SQL
- Scheduled queries
- Databricks Assistant
Use the SQL editor
The SAP Databricks UI includes a SQL editor that you can use to author queries, browse available data, and create visualizations. You can also share your saved queries with other team members in the workspace.
Open the SQL editor
To open the SQL editor in the SAP Databricks UI, click SQL Editor in the sidebar.
The SQL editor opens to your last open query. If no query exists, or all of your queries have been explicitly closed, a new query opens. It is automatically named New Query and the creation timestamp is appended in the title.
After opening the editor, you can author a SQL query or browse the available data. The text editor supports autocomplete, autoformatting, and various other keyboard shortcuts.
You can open multiple queries using the query tabs at the top of the text editor. Each query tab has controls for running the query, marking the query as a favorite, and connecting to a SQL warehouse. You can also Save, Schedule, or Share queries.
Connect to a serverless SQL warehouse
A SQL warehouse is a compute resource that lets you query and explore data on Databricks. To learn more about serverless compute, see Serverless compute.
To connect to a compute resource, use the compute drop-down menu near the top of the editor. This dropdown shows the SQL warehouses you have access to. Select one to connect to it.
You must have at least CAN USE permissions on a running SQL warehouse to run queries.
If there are no SQL warehouses in the list, contact your workspace administrator.
Query SAP data
An active SAP data product can be queried by SAP Databricks users once it is mounted to a catalog in Unity Catalog. To query this data, you need:
- Access to the SQL warehouse that houses the data
- READ access to the catalog and schema that contain the target dataset
Below is an example query:
select * from sap_data.cashflow.cashflowforecast
Add visualizations
Databricks has built-in support for charts and visualizations in both Databricks SQL and in notebooks.
The SQL editor includes a built-in visualization editor to help you visualize your query results. To use the visualization editor to add a visualization, follow these steps:
- After running a query, in the Results panel, click + and then select Visualization.
- Enter a visualization name as the new title in the visualization editor.
- In the Visualization Type drop-down, select your chart type.
- Customize and review the visualization properties. Select the columns you'd like to plot and how to group the data. Customize its appearance as desired. The fields available depend on the selected type.
- Click Save.
Access and manage queries
Use the SAP Databricks UI to access and manage your queries. See View and manage queries.
Schedule a query
You can schedule your queries to run on a cadence so that your query results are refreshed with the most current data. See Schedule a query.
Use the Databricks Assistant
Databricks Assistant is a context-aware AI assistant that can assist you with data and code. You can access the assistant in the SQL editor and in notebooks.
The SQL editor supports autocomplete. As you type, autocomplete suggests completions. For example, if a valid completion at the cursor location is a column, autocomplete suggests a column name. If you type select * from table_name as t where t.
, autocomplete recognizes that t
is an alias for table_name
and suggests the columns inside table_name
.