-
Notifications
You must be signed in to change notification settings - Fork 28.9k
[SPARK-17338][SQL] add global temp view #14897
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
Changes from all commits
919e41a
67e459a
2aba058
2732531
754d75b
6183400
a683fba
0a70679
88e684e
9ab7228
952f13c
39f5995
9f196e5
cbbe122
96833d5
fb96f1c
29e292a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -167,7 +167,7 @@ def createExternalTable(self, tableName, path=None, source=None, schema=None, ** | |
|
|
||
| @since(2.0) | ||
| def dropTempView(self, viewName): | ||
| """Drops the temporary view with the given view name in the catalog. | ||
| """Drops the local temporary view with the given view name in the catalog. | ||
| If the view has been cached before, then it will also be uncached. | ||
|
|
||
| >>> spark.createDataFrame([(1, 1)]).createTempView("my_table") | ||
|
|
@@ -181,6 +181,22 @@ def dropTempView(self, viewName): | |
| """ | ||
| self._jcatalog.dropTempView(viewName) | ||
|
|
||
| @since(2.1) | ||
| def dropGlobalTempView(self, viewName): | ||
| """Drops the global temporary view with the given view name in the catalog. | ||
| If the view has been cached before, then it will also be uncached. | ||
|
|
||
| >>> spark.createDataFrame([(1, 1)]).createGlobalTempView("my_table") | ||
| >>> spark.table("global_temp.my_table").collect() | ||
| [Row(_1=1, _2=1)] | ||
| >>> spark.catalog.dropGlobalTempView("my_table") | ||
| >>> spark.table("global_temp.my_table") # doctest: +IGNORE_EXCEPTION_DETAIL | ||
| Traceback (most recent call last): | ||
| ... | ||
| AnalysisException: ... | ||
| """ | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this bad case will end up in the python doc. Can we move this test to the
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I followed the method doc in
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It will be pretty confusing because this test case will appear in the python doc (and users will see an example that throws exceptions). |
||
| self._jcatalog.dropGlobalTempView(viewName) | ||
|
|
||
| @ignore_unicode_prefix | ||
| @since(2.0) | ||
| def registerFunction(self, name, f, returnType=StringType()): | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.
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 need one more
</div>