You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spark.apache.org by rx...@apache.org on 2015/10/14 21:31:35 UTC

spark git commit: [SPARK-8386] [SQL] add write.mode for insertIntoJDBC when the parm overwrite is false

Repository: spark
Updated Branches:
  refs/heads/master 31f315981 -> 7e1308d37


[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 <hu...@us.ibm.com>

Closes #9042 from huaxingao/spark8386.


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

Branch: refs/heads/master
Commit: 7e1308d37f6ca35f063e67e4b87a77e932ad89a5
Parents: 31f3159
Author: Huaxin Gao <hu...@us.ibm.com>
Authored: Wed Oct 14 12:31:29 2015 -0700
Committer: Reynold Xin <rx...@databricks.com>
Committed: Wed Oct 14 12:31:29 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/7e1308d3/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 bfe8d3c..174bc6f 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
@@ -1674,7 +1674,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: commits-unsubscribe@spark.apache.org
For additional commands, e-mail: commits-help@spark.apache.org