Skip to content

Commit c27e190

Browse files
huaxingaorxin
authored andcommitted
[SPARK-8386] [SQL] add write.mode for insertIntoJDBC when the parm overwrite is false
the fix is for jira https://issues.apache.org/jira/browse/SPARK-8386 Author: Huaxin Gao <[email protected]> Closes #9042 from huaxingao/spark8386. (cherry picked from commit 7e1308d) Signed-off-by: Reynold Xin <[email protected]>
1 parent 30eea40 commit c27e190

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

sql/core/src/main/scala/org/apache/spark/sql/DataFrame.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1625,7 +1625,7 @@ class DataFrame private[sql](
16251625
*/
16261626
@deprecated("Use write.jdbc()", "1.4.0")
16271627
def insertIntoJDBC(url: String, table: String, overwrite: Boolean): Unit = {
1628-
val w = if (overwrite) write.mode(SaveMode.Overwrite) else write
1628+
val w = if (overwrite) write.mode(SaveMode.Overwrite) else write.mode(SaveMode.Append)
16291629
w.jdbc(url, table, new Properties)
16301630
}
16311631

0 commit comments

Comments
 (0)