From b0864ecb51a28452f6e33f4bdcd30795c7c2ec99 Mon Sep 17 00:00:00 2001 From: mvervuurt Date: Fri, 12 Aug 2016 20:42:40 +0200 Subject: [PATCH 1/2] Fix docstring of method jdbc of PySpark DataFrameWriter because a dictionary of JDBC connection arguments is used instead of a list. --- python/pyspark/sql/readwriter.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/python/pyspark/sql/readwriter.py b/python/pyspark/sql/readwriter.py index 4020bb3fa45b0..a74e59049a9e6 100644 --- a/python/pyspark/sql/readwriter.py +++ b/python/pyspark/sql/readwriter.py @@ -716,9 +716,9 @@ def jdbc(self, url, table, mode=None, properties=None): * ``overwrite``: Overwrite existing data. * ``ignore``: Silently ignore this operation if data already exists. * ``error`` (default case): Throw an exception if data already exists. - :param properties: JDBC database connection arguments, a list of - arbitrary string tag/value. Normally at least a - "user" and "password" property should be included. + :param properties: a dictionary of JDBC database connection arguments. Normally at

 + least properties "user" and "password" with their corresponding values.

 + For example { 'user' : 'SYSTEM', 'password' : 'mypassword' } """ if properties is None: properties = dict() From f5018616eee50544c22432c2256c75325b537e82 Mon Sep 17 00:00:00 2001 From: hyukjinkwon Date: Wed, 17 Aug 2016 11:17:48 +0900 Subject: [PATCH 2/2] Fix the descriptions for `properties` argument in the documenation for jdbc APIs --- python/pyspark/sql/readwriter.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/python/pyspark/sql/readwriter.py b/python/pyspark/sql/readwriter.py index a74e59049a9e6..64de33e8ec0a8 100644 --- a/python/pyspark/sql/readwriter.py +++ b/python/pyspark/sql/readwriter.py @@ -401,8 +401,9 @@ def jdbc(self, url, table, column=None, lowerBound=None, upperBound=None, numPar :param numPartitions: the number of partitions :param predicates: a list of expressions suitable for inclusion in WHERE clauses; each one defines one partition of the :class:`DataFrame` - :param properties: a dictionary of JDBC database connection arguments; normally, - at least a "user" and "password" property should be included + :param properties: a dictionary of JDBC database connection arguments. Normally at + least properties "user" and "password" with their corresponding values. + For example { 'user' : 'SYSTEM', 'password' : 'mypassword' } :return: a DataFrame """ if properties is None: @@ -716,8 +717,8 @@ def jdbc(self, url, table, mode=None, properties=None): * ``overwrite``: Overwrite existing data. * ``ignore``: Silently ignore this operation if data already exists. * ``error`` (default case): Throw an exception if data already exists. - :param properties: a dictionary of JDBC database connection arguments. Normally at

 - least properties "user" and "password" with their corresponding values.

 + :param properties: a dictionary of JDBC database connection arguments. Normally at + least properties "user" and "password" with their corresponding values. For example { 'user' : 'SYSTEM', 'password' : 'mypassword' } """ if properties is None: