spark-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gurwls...@apache.org
Subject spark git commit: [SPARK-22437][PYSPARK] default mode for jdbc is wrongly set to None
Date Sat, 04 Nov 2017 08:02:40 GMT
Repository: spark
Updated Branches:
  refs/heads/master bc1e10103 -> e7adb7d7a


[SPARK-22437][PYSPARK] default mode for jdbc is wrongly set to None

## What changes were proposed in this pull request?

When writing using jdbc with python currently we are wrongly assigning by default None as
writing mode. This is due to wrongly calling mode on the `_jwrite` object instead of `self`
and it causes an exception.

## How was this patch tested?

manual tests

Author: Marco Gaido <mgaido@hortonworks.com>

Closes #19654 from mgaido91/SPARK-22437.


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

Branch: refs/heads/master
Commit: e7adb7d7a6d017bb95da566e76b39d9d96ab42c1
Parents: bc1e101
Author: Marco Gaido <mgaido@hortonworks.com>
Authored: Sat Nov 4 16:59:58 2017 +0900
Committer: hyukjinkwon <gurwls223@gmail.com>
Committed: Sat Nov 4 16:59:58 2017 +0900

----------------------------------------------------------------------
 python/pyspark/sql/readwriter.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/spark/blob/e7adb7d7/python/pyspark/sql/readwriter.py
----------------------------------------------------------------------
diff --git a/python/pyspark/sql/readwriter.py b/python/pyspark/sql/readwriter.py
index f309291..3d87567 100644
--- a/python/pyspark/sql/readwriter.py
+++ b/python/pyspark/sql/readwriter.py
@@ -915,7 +915,7 @@ class DataFrameWriter(OptionUtils):
         jprop = JavaClass("java.util.Properties", self._spark._sc._gateway._gateway_client)()
         for k in properties:
             jprop.setProperty(k, properties[k])
-        self._jwrite.mode(mode).jdbc(url, table, jprop)
+        self.mode(mode)._jwrite.jdbc(url, table, jprop)
 
 
 def _test():


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@spark.apache.org
For additional commands, e-mail: commits-help@spark.apache.org


Mime
View raw message