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
Anonymous
1 year agoNot applicable
Hi AnnOminous ,
I wanted to check if you had the opportunity to review the information provided. Please feel free to contact us if you have any further questions.
Thank you.
AnnOminous
1 year agoMicrosoft Employee
No. I just finished setting it up using DFG2, but I'm still getting the same error message.