Forum Discussion
How to run custom SQL queries in Azure Databricks without using ODBC in Power BI?
- 1 year ago
Hi everyone, thank you all for your contributions!
I wanted to share that I was able to solve the issue on my own. I had already read the documentation several times (including the official blog post), but I couldn’t get it to work in my specific context — especially through a script-based setup in Power Query.
In the end, I found a solution that worked by applying a native SQL query using this structure:
Fonte = Value.NativeQuery(
Databricks.Catalogs(
"adb-xxxx.azuredatabricks.net",
"/sql/1.0/warehouses/xxxx",
[Catalog = "dtXXXX", Database = null, EnableAutomaticProxyDiscovery = "enabled"]
){[Name="dtXXXX", Kind="Database"]}[Data],
"
SELECT * FROM your_table
WHERE my_column IS NOT NULL
"
)
This allowed me to run the SQL script directly without needing to rely on ODBC or predefined views.I’ll go ahead and mark the thread as resolved — though I won’t select any specific reply, since I was looking specifically for a script-based solution that I ended up crafting myself.
Thanks again to everyone who contributed!
Since you mentioned that you have read the documentation, could you please check if this helps?
It seems that the anonymous user changed Databricks.Catalog to Databricks.Query to make it work, although the error is not the same as in the original post.