Forum Discussion
Nicolas_DHONT
1 year agoRegular Visitor
Not able to SELECT from a view in Fabric Notebooks with spark.sql()
Hello, I need to retrieve data from a LakeHouse un e Fabric Notebook. I am using following code: df = spark.sql(f"SELECT * FROM {sql_view_name}") This is well working if I put there a table ...
- 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
Srisakthi
Super User
1 year agoHi Nicolas_DHONT ,
Do you want use only Pyspark? If you use T-SQL notebook you can do it, but that is SQL way not pyspark.
Regards,
Srisakthi
Nicolas_DHONT
1 year agoRegular Visitor
Hi Srisakthi,
The goal is to export as CSV content of the view and upload the file in an Azure Storage. I Guess this is not possible in a T-SQL notebook... 🙁
Thanks and best regards,