Forum Discussion
create view via spark sql
- 1 year ago
Hi tareksalha ,
Thanks for reaching out to the Microsoft fabric community forum.
As you are using Lakehouse with schema enabled which is still in preview phase some of the features are not supported yet and one them is creation of views.
That is the reason for the error you are observing.
Reference for the above point: Lakehouse schemas (Preview) - Microsoft Fabric | Microsoft Learn
If you find this post helpful, please mark it as an "Accept as Solution" and consider giving a KUDOS. Feel free to reach out if you need further assistance.
Thanks and Regards
Hi tareksalha,
Thanks for reaching out to the Microsoft fabric community forum.
It appears you're encountering a 403 Forbidden error when attempting to create a view in your Fabric notebook. This error is commonly linked to authentication or permission issues.
First, ensure that the Lakehouse is set as the default for your notebook. This is important because some operations depend on having the correct context set, and not specifying the default Lakehouse can lead to namespace-related errors when executing SQL or Spark commands.
Next, verify that your user account has the appropriate permissions to interact with the Lakehouse. While being a workspace admin typically provides elevated access, certain actions like modifying metadata or creating views may require specific rights at the Lakehouse level. Double-check both workspace and Lakehouse permissions to ensure you have full access to perform these operations.
Finally, Modify the code in this format and check if this is working
%%sql
CREATE VIEW table2_current
AS
SELECT *
FROM data_lake.data_vault.table1
If you find this post helpful, please mark it as an "Accept as Solution" and consider giving a KUDOS. Feel free to reach out if you need further assistance.
Thanks and Regards