Repository: spark
Updated Branches:
  refs/heads/branch-1.5 30eea40ff -> c27e19042


[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 7e1308d37f6ca35f063e67e4b87a77e932ad89a5)
Signed-off-by: Reynold Xin <[email protected]>


Project: http://git-wip-us.apache.org/repos/asf/spark/repo
Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/c27e1904
Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/c27e1904
Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/c27e1904

Branch: refs/heads/branch-1.5
Commit: c27e19042e66446f3a4fb4673468b2b83633ea89
Parents: 30eea40
Author: Huaxin Gao <[email protected]>
Authored: Wed Oct 14 12:31:29 2015 -0700
Committer: Reynold Xin <[email protected]>
Committed: Wed Oct 14 12:31:39 2015 -0700

----------------------------------------------------------------------
 sql/core/src/main/scala/org/apache/spark/sql/DataFrame.scala | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/spark/blob/c27e1904/sql/core/src/main/scala/org/apache/spark/sql/DataFrame.scala
----------------------------------------------------------------------
diff --git a/sql/core/src/main/scala/org/apache/spark/sql/DataFrame.scala 
b/sql/core/src/main/scala/org/apache/spark/sql/DataFrame.scala
index f024db7..3fce47f 100644
--- a/sql/core/src/main/scala/org/apache/spark/sql/DataFrame.scala
+++ b/sql/core/src/main/scala/org/apache/spark/sql/DataFrame.scala
@@ -1625,7 +1625,7 @@ class DataFrame private[sql](
    */
   @deprecated("Use write.jdbc()", "1.4.0")
   def insertIntoJDBC(url: String, table: String, overwrite: Boolean): Unit = {
-    val w = if (overwrite) write.mode(SaveMode.Overwrite) else write
+    val w = if (overwrite) write.mode(SaveMode.Overwrite) else 
write.mode(SaveMode.Append)
     w.jdbc(url, table, new Properties)
   }
 


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to