-
Notifications
You must be signed in to change notification settings - Fork 28.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[SPARK-19236][SQL][FOLLOW-UP] Added createOrReplaceGlobalTempView method #18147
[SPARK-19236][SQL][FOLLOW-UP] Added createOrReplaceGlobalTempView method #18147
Conversation
python/pyspark/sql/dataframe.py
Outdated
>>> df.createOrReplaceGlobalTempView("people") | ||
>>> df2 = df.filter(df.age > 3) | ||
>>> df2.createOrReplaceGlobalTempView("people") | ||
>>> df3 = spark.sql("select * from people") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
df3 = spark.sql("select * from global_temp.people")
?
Test build #77552 has finished for PR 18147 at commit
|
// We can also use Catalog API to drop global temp view | ||
spark.catalog.dropGlobalTempView("src2") | ||
intercept[NoSuchTableException](spark.table(s"$globalTempDB.src2")) | ||
// We can also use Dataset API to replace global temp view |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code added are line 38 and line 73-78
Test build #77563 has finished for PR 18147 at commit
|
@@ -191,6 +191,23 @@ def createGlobalTempView(self, name): | |||
""" | |||
self._jdf.createGlobalTempView(name) | |||
|
|||
@since(2.2) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we didn't merge the original PR to 2.2 right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See the backport PR #18167
LGTM except for @cloud-fan's comment. |
thanks, merging to master! |
…method ### What changes were proposed in this pull request? This PR is to backport two PRs for adding the `createOrReplaceGlobalTempView` method #18147 #16598 --- Added the createOrReplaceGlobalTempView method for dataset API ### How was this patch tested? N/A Author: Xiao Li <gatorsmile@gmail.com> Closes #18167 from gatorsmile/Backport18147.
What changes were proposed in this pull request?
This PR does the following tasks:
How was this patch tested?
Added test cases to both Scala and Python