diff options
author | Sean Zhong <seanzhong@databricks.com> | 2016-05-12 15:51:53 +0800 |
---|---|---|
committer | Cheng Lian <lian@databricks.com> | 2016-05-12 15:51:53 +0800 |
commit | 33c6eb5218ce3c31cc9f632a67fd2c7057569683 (patch) | |
tree | b8c84c24107bf1ece596450ef3a3eec26df1f21d /examples/src/main/python | |
parent | 5207a005cc86618907b8f467abc03eacef485ecd (diff) | |
download | spark-33c6eb5218ce3c31cc9f632a67fd2c7057569683.tar.gz spark-33c6eb5218ce3c31cc9f632a67fd2c7057569683.tar.bz2 spark-33c6eb5218ce3c31cc9f632a67fd2c7057569683.zip |
[SPARK-15171][SQL] Deprecate registerTempTable and add dataset.createTempView
## What changes were proposed in this pull request?
Deprecates registerTempTable and add dataset.createTempView, dataset.createOrReplaceTempView.
## How was this patch tested?
Unit tests.
Author: Sean Zhong <seanzhong@databricks.com>
Closes #12945 from clockfly/spark-15171.
Diffstat (limited to 'examples/src/main/python')
-rw-r--r-- | examples/src/main/python/sql.py | 2 | ||||
-rw-r--r-- | examples/src/main/python/streaming/sql_network_wordcount.py | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/examples/src/main/python/sql.py b/examples/src/main/python/sql.py index d2e895d931..234024063f 100644 --- a/examples/src/main/python/sql.py +++ b/examples/src/main/python/sql.py @@ -67,7 +67,7 @@ if __name__ == "__main__": # |-- name: string (nullable = true) # Register this DataFrame as a temporary table. - people.registerTempTable("people") + people.createOrReplaceTempView("people") # SQL statements can be run by using the sql methods provided by `spark` teenagers = spark.sql("SELECT name FROM people WHERE age >= 13 AND age <= 19") diff --git a/examples/src/main/python/streaming/sql_network_wordcount.py b/examples/src/main/python/streaming/sql_network_wordcount.py index f8801d4ea6..25e821534e 100644 --- a/examples/src/main/python/streaming/sql_network_wordcount.py +++ b/examples/src/main/python/streaming/sql_network_wordcount.py @@ -71,7 +71,7 @@ if __name__ == "__main__": wordsDataFrame = spark.createDataFrame(rowRdd) # Register as table - wordsDataFrame.registerTempTable("words") + wordsDataFrame.createOrReplaceTempView("words") # Do word count on table using SQL and print it wordCountsDataFrame = \ |