diff --git a/python/pyspark/sql.py b/python/pyspark/sql.py index 27753d5ba55e8374dbe258ae2179d35f466c1e71..114fa138d0de21b5314fdff159680230c77d846b 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