Skip to content

Commit

Permalink
davies's comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
yhuai committed Feb 10, 2015
1 parent 225ff71 commit f3a96f7
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions python/pyspark/sql/dataframe.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,14 +149,15 @@ def insertInto(self, tableName, overwrite=False):
def _java_save_mode(self, mode):
"""Returns the Java save mode based on the Python save mode represented by a string.
"""
jmode = self._sc._jvm.org.apache.spark.sql.sources.SaveMode.ErrorIfExists
jSaveMode = self._sc._jvm.org.apache.spark.sql.sources.SaveMode
jmode = jSaveMode.ErrorIfExists
mode = mode.lower()
if mode == "append":
jmode = self._sc._jvm.org.apache.spark.sql.sources.SaveMode.Append
jmode = jSaveMode.Append
elif mode == "overwrite":
jmode = self._sc._jvm.org.apache.spark.sql.sources.SaveMode.Overwrite
jmode = jSaveMode.Overwrite
elif mode == "ignore":
jmode = self._sc._jvm.org.apache.spark.sql.sources.SaveMode.Ignore
jmode = jSaveMode.Ignore
elif mode == "error":
pass
else:
Expand All @@ -165,7 +166,7 @@ def _java_save_mode(self, mode):
return jmode

def saveAsTable(self, tableName, source=None, mode="append", **options):
"""Saves the contents of the DataFrame to a data source in a table.
"""Saves the contents of the DataFrame to a data source as a table.
The data source is specified by the `source` and a set of `options`.
If `source` is not specified, the default data source configured by
Expand Down

0 comments on commit f3a96f7

Please sign in to comment.