-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-29279][SQL] Merge SHOW NAMESPACES and SHOW DATABASES code path #26006
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
db8968a
67114a7
fece0a0
51966bc
4a3d6a4
94411cb
d8b5362
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 |
|---|---|---|
|
|
@@ -256,15 +256,6 @@ class ResolveSessionCatalog( | |
| case DropViewStatement(SessionCatalog(catalog, viewName), ifExists) => | ||
| DropTableCommand(viewName.asTableIdentifier, ifExists, isView = true, purge = false) | ||
|
|
||
| case ShowNamespacesStatement(Some(SessionCatalog(catalog, nameParts)), pattern) => | ||
| throw new AnalysisException( | ||
| "SHOW NAMESPACES is not supported with the session catalog.") | ||
|
|
||
| // TODO (SPARK-29014): we should check if the current catalog is session catalog here. | ||
|
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 can also handle the ShowTables case below as a separate PR (I have tests written up) if you want.
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. @imback82 can you send a PR to fix SPARK-29014? It should be easy now.
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. Yes, I will work on this. Thanks! |
||
| case ShowNamespacesStatement(None, pattern) if defaultCatalog.isEmpty => | ||
| throw new AnalysisException( | ||
| "SHOW NAMESPACES is not supported with the session catalog.") | ||
|
|
||
| case ShowTablesStatement(Some(SessionCatalog(catalog, nameParts)), pattern) => | ||
| if (nameParts.length != 1) { | ||
| throw new AnalysisException( | ||
|
|
||
This file was deleted.
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.
This will always set the catalog, even if it is already the current? Why not use a rule that doesn't fill in the catalog and returns None instead?
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 check is done here:
spark/sql/catalyst/src/main/scala/org/apache/spark/sql/connector/catalog/CatalogManager.scala
Lines 128 to 137 in 8556710