Skip to content

Commit 7e1308d

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.
1 parent 31f3159 commit 7e1308d

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
@@ -1674,7 +1674,7 @@ class DataFrame private[sql](
16741674
*/
16751675
@deprecated("Use write.jdbc()", "1.4.0")
16761676
def insertIntoJDBC(url: String, table: String, overwrite: Boolean): Unit = {
1677-
val w = if (overwrite) write.mode(SaveMode.Overwrite) else write
1677+
val w = if (overwrite) write.mode(SaveMode.Overwrite) else write.mode(SaveMode.Append)
16781678
w.jdbc(url, table, new Properties)
16791679
}
16801680

0 commit comments

Comments
 (0)