Forum Discussion
Not able to SELECT from a view in Fabric Notebooks with spark.sql()
- 1 year ago
Hi Nicolas_DHONT,
You cannot request directly your Analytics Endpoint and as the views are only at this level you cannot use the normal notebooks connector.
I make a quick workaround to get your data based in this example write in Spark Scala. It connect directly to your SQL Analytics Endpoint and you can get the Data in the view.
Hope this help.
Regards,
Yohann
Hi Nicolas_DHONT ,
You're right
T-SQL notebooks in Microsoft Fabric don't support exporting to CSV or interacting with external storage like PySpark notebooks do. You'll get (Error : "Table or view not found") because that view doesn’t exist from the Lakehouse's perspective.
As a workaround, you can read view via JDBC then
df.write.mode("overwrite").csv("/lakehouse/default/Files/output.csv", header=True)
If the response has addressed your query, please accept it as a solution and give a 'Kudos' so other members can easily find it.
Thank You