diff options
author | Jeff Zhang <zjffdu@apache.org> | 2015-11-26 19:15:22 -0800 |
---|---|---|
committer | Reynold Xin <rxin@databricks.com> | 2015-11-26 19:15:22 -0800 |
commit | d8220885c492141dfc61e8ffb92934f2339fe8d3 (patch) | |
tree | 6005cab0aff07749ce5d8ac85915047bc7e62fee | |
parent | b63938a8b04a30feb6b2255c4d4e530a74855afc (diff) | |
download | spark-d8220885c492141dfc61e8ffb92934f2339fe8d3.tar.gz spark-d8220885c492141dfc61e8ffb92934f2339fe8d3.tar.bz2 spark-d8220885c492141dfc61e8ffb92934f2339fe8d3.zip |
[SPARK-11917][PYSPARK] Add SQLContext#dropTempTable to PySpark
Author: Jeff Zhang <zjffdu@apache.org>
Closes #9903 from zjffdu/SPARK-11917.
-rw-r--r-- | python/pyspark/sql/context.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/python/pyspark/sql/context.py b/python/pyspark/sql/context.py index a49c1b58d0..b05aa2f5c4 100644 --- a/python/pyspark/sql/context.py +++ b/python/pyspark/sql/context.py @@ -445,6 +445,15 @@ class SQLContext(object): else: raise ValueError("Can only register DataFrame as table") + @since(1.6) + def dropTempTable(self, tableName): + """ Remove the temp table from catalog. + + >>> sqlContext.registerDataFrameAsTable(df, "table1") + >>> sqlContext.dropTempTable("table1") + """ + self._ssql_ctx.dropTempTable(tableName) + def parquetFile(self, *paths): """Loads a Parquet file, returning the result as a :class:`DataFrame`. |