Forum Discussion

Nicolas_DHONT's avatar
Nicolas_DHONT
Regular Visitor
1 year ago
Solved

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 ...
  • yvaubourg's avatar
    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