aboutsummaryrefslogtreecommitdiff
path: root/python/pyspark/sql.py
diff options
context:
space:
mode:
Diffstat (limited to 'python/pyspark/sql.py')
-rw-r--r--python/pyspark/sql.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/python/pyspark/sql.py b/python/pyspark/sql.py
index 27753d5ba5..114fa138d0 100644
--- a/python/pyspark/sql.py
+++ b/python/pyspark/sql.py
@@ -305,6 +305,19 @@ class SchemaRDD(RDD):
"""
self._jschema_rdd.registerAsTable(name)
+ def insertInto(self, tableName, overwrite = False):
+ """
+ Inserts the contents of this SchemaRDD into the specified table,
+ optionally overwriting any existing data.
+ """
+ self._jschema_rdd.insertInto(tableName, overwrite)
+
+ def saveAsTable(self, tableName):
+ """
+ Creates a new table with the contents of this SchemaRDD.
+ """
+ self._jschema_rdd.saveAsTable(tableName)
+
def _toPython(self):
# We have to import the Row class explicitly, so that the reference Pickler has is
# pyspark.sql.Row instead of __main__.Row