title: Spark SQL and MySQL- SaveMode.Overwrite not inserting modified data
body: <p>I have a <code>test</code> table in MySQL with id and name like below:</p>
  
  <pre><code>+----+-------+
  | id | name  |
  +----+-------+
  | 1  | Name1 |
  +----+-------+
  | 2  | Name2 |
  +----+-------+
  | 3  | Name3 |
  +----+-------+
  </code></pre>
  
  <p>I am using Spark <code>DataFrame</code> to read this data (using JDBC) and modifying the data like this </p>
  
  <pre class="lang-java prettyprint-override"><code>Dataset&lt;Row&gt; modified = sparkSession.sql("select id, concat(name,' - new') as name from test");
  modified.write().mode("overwrite").jdbc(AppProperties.MYSQL_CONNECTION_URL,
                  "test", connectionProperties);
  </code></pre>
  
  <p>But my problem is, if I give overwrite mode, it drops the previous table and creates a new table but not inserting any data. </p>
  
  <p>I tried the same program by reading from a csv file (same data as test table) and overwriting. That worked for me. </p>
  
  <p>Am I missing something here ? </p>
  
  <p>Thank You!</p>