-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-29609][SQL] DataSourceV2: Support DROP NAMESPACE #26262
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
|
cc: @cloud-fan @rdblue |
| cascade: Boolean) | ||
| extends V2CommandExec { | ||
| override protected def run(): Seq[InternalRow] = { | ||
| // TODO: How to handle when cascade is true? |
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.
@rdblue / @cloud-fan did we discuss how we want to drop namespaces if cascade is set for v2 catalogs?
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.
In the v2 API, namespaces that are not empty can be rejected by throwing IllegalStateException. I'd say catch that if cascade is set and throw an error that cascade isn't supported.
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 this is a good workaround now. I'm wondering if we should support cascade before 3.0, as this may break DS v2 APIs, e.g. we may need to add a cascade parameter to the dropNamespace API. DROP TABLE has the same problem.
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.
Thanks for the suggestion. I updated with a workaround solution. And +1 for adding cascade option to dropNamespace API. I initially tried to implement cascading option with existing APIs, but it was a bit cumbersome.
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/statements.scala
Outdated
Show resolved
Hide resolved
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/v2/DropNamespaceExec.scala
Outdated
Show resolved
Hide resolved
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/v2/DropNamespaceExec.scala
Outdated
Show resolved
Hide resolved
|
Test build #112691 has finished for PR 26262 at commit
|
|
Could you resolve the conflicts, @imback82 ? |
|
Test build #112788 has finished for PR 26262 at commit
|
dongjoon-hyun
left a comment
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.
+1, LGTM. Thank you, @imback82 , @cloud-fan , @rdblue .
Merged to master.
|
Thanks everyone for help! |
What changes were proposed in this pull request?
This PR adds
DROP NAMESPACEsupport for V2 catalogs.Why are the changes needed?
Currently, you cannot drop namespaces for v2 catalogs.
Does this PR introduce any user-facing change?
The user can now perform the following:
to drop a namespace
nsinsidemycatalogV2 catalog.How was this patch tested?
Added unit tests.