Forum Discussion
Replace Direct query table connection to a Direct query, QUERY connection - Databricks
- 1 year ago
Hi Anonymous ,
Please refer below complete sample M code. You can change the below code based on your code.
let
Source = Databricks.Multicloud.Catalogs("workspace_url", [Catalog=null, EnableAutomaticProxyDiscovery=null]),
Connection = Source{[Name="catalog_name"]}[Data],
Database = Connection{[Name="database_name",Kind="Database"]}[Data],
NativeQueryResult = Value.NativeQuery(Database, "
SELECT col1, col2
FROM table
WHERE col1 = 'value'
", null, [EnableFolding=true])in
NativeQueryResultNote: Change the "workspace_url" with your actual workspace url, "catalog_name" and "database_name" with your catalog_name and database_name, "null" parameter can hold query parameters.
I hope this information helps. Please do let us know if you have any further queries.
Regards,
Dinesh
- Anonymous1 year ago
Slight adjustment but this was my final connection string
Hi Anonymous ,
Please refer below complete sample M code. You can change the below code based on your code.
let
Source = Databricks.Multicloud.Catalogs("workspace_url", [Catalog=null, EnableAutomaticProxyDiscovery=null]),
Connection = Source{[Name="catalog_name"]}[Data],
Database = Connection{[Name="database_name",Kind="Database"]}[Data],
NativeQueryResult = Value.NativeQuery(Database, "
SELECT col1, col2
FROM table
WHERE col1 = 'value'
", null, [EnableFolding=true])
in
NativeQueryResult
Note: Change the "workspace_url" with your actual workspace url, "catalog_name" and "database_name" with your catalog_name and database_name, "null" parameter can hold query parameters.
I hope this information helps. Please do let us know if you have any further queries.
Regards,
Dinesh
Slight adjustment but this was my final connection string