diff --git a/python/pyspark/sql.py b/python/pyspark/sql.py index 27753d5ba55e8..292ca5df8aed2 100644 --- a/python/pyspark/sql.py +++ b/python/pyspark/sql.py @@ -305,6 +305,19 @@ def registerAsTable(self, name): """ 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