Repository: spark
Updated Branches:
  refs/heads/branch-1.4 d1cae3206 -> ad112c94d


[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/ad112c94
Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/ad112c94
Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/ad112c94

Branch: refs/heads/branch-1.4
Commit: ad112c94d7ebc21f99db0949af4d6b9c3871368e
Parents: d1cae32
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:49 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/ad112c94/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 0b76138..f9281d2 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
@@ -1491,7 +1491,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