Forum Discussion
AnnOminous
1 year agoMicrosoft Employee
Can't write data to Fabric DB - MashupException.Error
I'm trying to write data from a Dataflow (not Gen2) to a SQL DB in Fabric. The query is set to refresh incrementally, but when I try to publish/refresh the query, I get the following error message: ...
- 1 year ago
Hi AnnOminous
You need to use Notebooks only ( Advanced User ). Also You need to understand Data Lake and Delta Lake with Apache Spark. To answer the question,This is writing data back to Fabric SQL ( INSERT ). This is a script.
# Create DataFrame to insert into the Azure/Fabric SQL table ( Writing Data to Azure SQL / Fabric SQL Table )df1 = spark.createDataFrame([('WL2456', 'Luke1293', 'Skywalker','Null','Null',-3,'Unknown','Unknown','Null')], ['DeviceID', 'DeviceName', 'DeviceDesc','OperatorName','OperatorDesc','FacilityID','FacilityName','FacilityDesc','DeviceSerialNo'])# Insert the rows into the Azure SQL / Fabric SQL tabledf1.write \.option('user', user) \.option('password', pswd) \.jdbc('jdbc:sqlserver://' + sqlserver + ':' + port + ';database=' + database, 'dbo.Devices', mode = 'append' )df1.show()
Cheers
Bhavesh Patel
BhaveshPatel
1 year agoSuper User
This resources are useful for understanding Data Lake and Data Lakehouse: Open source material & based on linux operating system
Overview - Spark 4.0.0 Documentation
Welcome to the Delta Lake documentation — Delta Lake Documentation
AnnOminous
1 year agoMicrosoft Employee
BhaveshPatel, thank you very much, appreciate all your assistance.