title: SPARK SQL - update MySql table using DataFrames and JDBC
body: <p>I'm trying to insert and update some data on MySql using Spark SQL DataFrames and JDBC connection.</p>
  
  <p>I've succeeded to insert new data using the SaveMode.Append. Is there a way to update the data already existing in MySql Table from Spark SQL?</p>
  
  <p>My code to insert is: </p>
  
  <p><code>myDataFrame.write.mode(SaveMode.Append).jdbc(JDBCurl,mySqlTable,connectionProperties)</code></p>
  
  <p>If I change to SaveMode.Overwrite it deletes the full table and creates a new one, I'm looking for something like the "ON DUPLICATE KEY UPDATE" available in MySql</p>