I am trying to delete the record from teradata and then write into the table for avoiding duplicates So i have tried in many ways which is not working
- I have tried deleting while reading the data which is giving syntax error like '(' expected between table and delete spark.read.format('jdbc').options('driver','com.TeradataDriver').options('user','user').options('pwd','pwd').options('dbtable','delete from table').load()
Also tried like below, which is also giving syntax error like something expected between '('and delete options('dbtable','(delete from table) as td')
2)I have tried deleting while writing the data which is not working
df.write.format('jdbc').options('driver','com.TeradataDriver').options('user','user').options('pwd','pwd').options('dbtable','table').('preactions','delete from table').save()
Possible solution is to call procedure which delete data.