aboutsummaryrefslogtreecommitdiff
path: root/python/pyspark/sql/dataframe.py
diff options
context:
space:
mode:
authorYin Huai <yhuai@databricks.com>2015-03-18 09:41:06 +0800
committerCheng Lian <lian@databricks.com>2015-03-18 09:41:06 +0800
commitdc9c9196d63aa465e86ac52f0e86e10c12472100 (patch)
treec6e87f2bb75f939511b442ea6366bea87d88b3ec /python/pyspark/sql/dataframe.py
parent4633a87b86a6ef01fa724d31763dcb97cb5bc746 (diff)
downloadspark-dc9c9196d63aa465e86ac52f0e86e10c12472100.tar.gz
spark-dc9c9196d63aa465e86ac52f0e86e10c12472100.tar.bz2
spark-dc9c9196d63aa465e86ac52f0e86e10c12472100.zip
[SPARK-6366][SQL] In Python API, the default save mode for save and saveAsTable should be "error" instead of "append".
https://issues.apache.org/jira/browse/SPARK-6366 Author: Yin Huai <yhuai@databricks.com> Closes #5053 from yhuai/SPARK-6366 and squashes the following commits: fc81897 [Yin Huai] Use error as the default save mode for save/saveAsTable.
Diffstat (limited to 'python/pyspark/sql/dataframe.py')
-rw-r--r--python/pyspark/sql/dataframe.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/python/pyspark/sql/dataframe.py b/python/pyspark/sql/dataframe.py
index 94001aec37..5cb89da7a8 100644
--- a/python/pyspark/sql/dataframe.py
+++ b/python/pyspark/sql/dataframe.py
@@ -162,7 +162,7 @@ class DataFrame(object):
"Only 'append', 'overwrite', 'ignore', and 'error' are acceptable save mode.")
return jmode
- def saveAsTable(self, tableName, source=None, mode="append", **options):
+ def saveAsTable(self, tableName, source=None, mode="error", **options):
"""Saves the contents of the :class:`DataFrame` to a data source as a table.
The data source is specified by the `source` and a set of `options`.
@@ -188,7 +188,7 @@ class DataFrame(object):
self.sql_ctx._sc._gateway._gateway_client)
self._jdf.saveAsTable(tableName, source, jmode, joptions)
- def save(self, path=None, source=None, mode="append", **options):
+ def save(self, path=None, source=None, mode="error", **options):
"""Saves the contents of the :class:`DataFrame` to a data source.
The data source is specified by the `source` and a set of `options`.