Forum Discussion
Anonymous
1 year agoNot applicable
Error : Notebook writing table into a Warehouse
Hello, I try to write a spark dataframe into a Warehouse from a notebook with this tutorial : Spark connector for Microsoft Fabric Data Warehouse - Microsoft Fabric | Microsoft Learn I can re...
- Anonymous1 year ago
Hello CMJJ
Thanks for also testing the case.
I found a solution even if it is not the best because I really think the "writing" function of msspark doesn't work.
So I used this :warehouse_url = "my_url" jdbc_url = f"jdbc:sqlserver://{warehouse_url}:1433;database={database_name}" final_table = f"[schema].[table]" token = mssparkutils.credentials.getToken("pbi") df_joined.write \ .format("jdbc") \ .option("url", jdbc_url) \ .option("dbtable", final_table) \ .option("accessToken", token) \ .option("driver", "com.microsoft.sqlserver.jdbc.SQLServerDriver") \ .mode("overwrite") \ .save()
Akash_Varuna
1 year agoSuper User
Hi Anonymous You have the proper permissions right ?
Anonymous
1 year agoNot applicable
Hello Akash_Varuna,
The notebook is in the same workspace that the warehouse and I'm an admin of the workspace.
And if I try a TSQL query in a TSQL notebook, I can create a table.
So yes, the permissions are right