Support for Native Queries in the Azure Databricks connector
This is a collaborative post from Databricks and Microsoft. We thank Moe Derakhshani (Staff Software Engineer, Databricks), Can Efeoglu (Staff Product Manager, Databricks), and Mahesh Prakriya (Director in Intelligence Platform, Microsoft) for their contributions.
We’re excited to announce the availability of Native Queries in the Azure Databricks Power Query Connector in the latest release of Power BI! Native Query support has been one of the most frequently requested features for the connector since its launch. With this new capability, customers can now access data in Databricks SQL and build data models with increased flexibility & productivity. Customers can specify Native SQL queries as part of setting up their data sources. Any query specified here will be executed natively against Databricks SQL before further steps in Power BI.
Why native SQL?
Flexibility with complex transformations
Native SQL also provides flexibility for users to pick and choose their ideal tool for a given transformation. DAX is expressive and powerful, but for more complex SQL queries or unsupported operations, using Native SQL Query enables a simpler workflow. This also provides a big benefit for cases where custom column definitions cannot be folded/pushed down – just build them in the Native SQL.
Take better advantage of Databricks SQL compute scale
With Native SQL Support, customers can now perform larger operations and compute intensive preparation queries against a Databricks SQL Warehouse directly as part of setting up a data source. Especially for more complex transformations this could save a considerable amount of time. Also, analysts can self-service without having to create Views or other constructs within Databricks for simpler workflows.
Simpler migrations from other Power Query sources
For customers who already use Custom/Native SQL with other data sources in Power BI, migrating to Databricks SQL used to be cumbersome. The solution until now was to map this to Views in Databricks or attempt to do the logic in DAX. Now this is as simple as specifying the relevant Native SQL query on Databricks Power BI connector.
How to get started?
You need the following to get started
- Power BI December 2022 Release (v2.112.603.0 or later)
- A Databricks account (sign up here if you do not already have an account)
Open Power BI Desktop and follow the instructions:
- Find “Azure Databricks” or “Databricks” datasource from Power BI “Get Data” menu.
- Fill in Server and Catalog details in the connection dialog.
- Enter the Native SQL Query you’d like to submit. In this case:
SELECT * FROM tpch.region r where r.r_regionkey = 0
Note that to use the Native Query feature, the catalog field is required and must be provided, and the native query has to be written to be relative to the provided catalog.
- Once you authenticate, you are ready to query! Both Direct Query or Import modes are supported.
- (Optional) Open the Query using Power BI Advanced Query Editor, so you can see the native query and if you like you can modify the query from here and save it.
The Power Query team is interested in your feedback! Feel free to leave a comment below with your thoughts.