-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-30420][SQL] V2 commands resolves namespaces with new resolution framework #27095
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
Conversation
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/Analyzer.scala
Show resolved
Hide resolved
|
Test build #116109 has finished for PR 27095 at commit
|
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/ResolveCatalogs.scala
Show resolved
Hide resolved
| case s @ ShowTablesStatement(UnresolvedNamespace(Seq()), _) => | ||
| s.copy(namespace = | ||
| ResolvedNamespace(currentCatalog.asNamespaceCatalog, catalogManager.currentNamespace)) | ||
| case UnresolvedNamespace(Seq()) => |
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 can move this logic to CatalogAndNamespace, but I'm fine with what it is now.
| */ | ||
| case class CreateNamespaceStatement( | ||
| namespace: Seq[String], | ||
| namespace: LogicalPlan, |
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.
I'm not very sure about this. For CREATE commands, they only need to know the catalog, but no need to lookup table or namespace. I think we can keep using Seq[String], still handle the commands in ResolveCatalogs/ResolveSessionCatalogs and resolve the Seq[String] directly.
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.
yea you are right, and in this case, it will be consistent for tables as well.
|
LGTM except one comment |
|
Test build #116206 has finished for PR 27095 at commit
|
|
Test build #116218 has finished for PR 27095 at commit
|
|
Retest this please |
|
Test build #116233 has finished for PR 27095 at commit
|
|
thanks, merging to master! |
…pace commands ### What changes were proposed in this pull request? This is a follow-up to address the following comment: #27095 (comment) Currently, a SQL command string is parsed to a "statement" logical plan, converted to a logical plan with catalog/namespace, then finally converted to a physical plan. With the new resolution framework, there is no need to create a "statement" logical plan; a logical plan can contain `UnresolvedNamespace` which will be resolved to a `ResolvedNamespace`. This should simply the code base and make it a bit easier to add a new command. ### Why are the changes needed? Clean up codebase. ### Does this PR introduce any user-facing change? No ### How was this patch tested? Existing tests should cover the changes. Closes #27125 from imback82/SPARK-30214-followup. Authored-by: Terry Kim <yuminkim@gmail.com> Signed-off-by: Wenchen Fan <wenchen@databricks.com>
…pace commands This is a follow-up to address the following comment: apache/spark#27095 (comment) Currently, a SQL command string is parsed to a "statement" logical plan, converted to a logical plan with catalog/namespace, then finally converted to a physical plan. With the new resolution framework, there is no need to create a "statement" logical plan; a logical plan can contain `UnresolvedNamespace` which will be resolved to a `ResolvedNamespace`. This should simply the code base and make it a bit easier to add a new command. Clean up codebase. No Existing tests should cover the changes. Closes #27125 from imback82/SPARK-30214-followup. Authored-by: Terry Kim <yuminkim@gmail.com> Signed-off-by: Wenchen Fan <wenchen@databricks.com>
What changes were proposed in this pull request?
#26847 introduced new framework for resolving catalog/namespaces. This PR proposes to integrate commands that need to resolve namespaces into the new framework.
Why are the changes needed?
This is one of the work items for moving into the new resolution framework. Resolving v1/v2 tables with the new framework will be followed up in different PRs.
Does this PR introduce any user-facing change?
No
How was this patch tested?
Existing tests should cover the changes.