You can try with this, it will work
val finaldf = merchantdf.write.
format("org.apache.spark.sql.cassandra")
.mode(SaveMode.Overwrite)
.option("confirm.truncate", true)
.options(Map("table" -> "tablename", "keyspace" -> "keyspace"))
.save()
On Wed 27 Jun, 2018,
Hello Team,
I’m creating a dataframe out of cassandra table using datastax spark connector.
After making some modification into the dataframe, I’m trying to put that
dataframe back to the Cassandra table by overwriting the old content. For that
the piece of code is:
modifiedList.write.format("