Azure / azure-cosmosdb-spark

Apache Spark Connector for Azure Cosmos DB
MIT License
202 stars 121 forks source link

DirectQuery mode errors from Power BI #399

Open digitalnelson opened 4 years ago

digitalnelson commented 4 years ago

I keep getting "This step results in a query that is not supported in DirectQuery mode." from Power BI using the spark connector to our Databricks cluster.

Accessing a small container in cosmosdb that has been pulled into databricks via a create table call: spark.sql("create table appointments using com.microsoft.azure.cosmosdb.spark options (endpoint 'https://*******.documents.azure.com:443/', database '*******', collection '******', masterkey '{0}')".format(cosmosKey)))

Spark sql shows it maps just fine using show tables and regular SELECT * calls via spark.sql work just fine.

The error is generated when I edit the data transformations in Power BI. I am able to see the table just fine and it works fine in import mode. Import mode defeats the purpose of using databricks in our use case.

The guides in the azure docs say DirectQuery is supported so I'm not sure why I'm getting this error. Is this a known issue or am I missing something? Thanks!

tknandu commented 4 years ago

Hi Nelson, could you please share a screenshot of where you observe the message 'This step results in a query that is not supported in DirectQuery mode'? Is this in the Power Query Editor tab?

digitalnelson commented 4 years ago

Sure. Yes, it's in the query editor tab. Even if I get rid of the Navigation step and leave only the Source step, it still shows the error.

image

tknandu commented 4 years ago

The PBI <> Spark connector leverages ODBC driver under the hood - could you please turn on Diagnostics to collect ODBC warnings in the traces that can help validate if an issue exists