I am trying to write spark sql table to Sql data warehouse. I am able to create a table from scratch but if I try to append the data to existing DW table, it fails.
Here is code:
df.createOrReplaceTempView("vw_SampleTable")
val dfProject = spark.sql("SELECT FROM vw_SampleTable")
dfProject.write.mode("append").
option(Constants.SERVER, "xyz-datawarehouse01.sql.azuresynapse.net").
synapsesql("Company_Pool1.dbo.TableReal", Constants.INTERNAL)*
The error it gives:
Operation on target ABC Imports from Blob failed: Error: java.sql.SQLException: com.microsoft.sqlserver.jdbc.SQLServerException: There is already an object named 'TableReal' in the database.
at com.microsoft.spark.sqlanalytics.utils.SQLAnalyticsJDBCWrapper.executeUpdateStatement(SQLAnalyticsJDBCWrapper.scala:92)