-
Notifications
You must be signed in to change notification settings - Fork 305
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
[hotfix] Fix drop database not working in terminal #3363
Conversation
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.
Should we add a test to guard against future regression?
Added test, PTAL |
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 PR!
throw new NoSuchNamespaceException(namespace); | ||
} | ||
List<TableIDWithFormat> tables = unifiedCatalog.listTables(database); | ||
if (!tables.isEmpty() && !cascade) { |
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.
Why not drop all tables first and then drop the database?
I think should this logic be implemented directly by the parent (spark-common).
We already have concrete logic in SparkUnifiedCatalogBase.dropNamespace
.
so,remove Override is enough.
WDYT?
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 agreed that we may reuse some implementation in the parent class. However I think it is dangerous to delete all tables by default in Spark 3.2 implementation. So we may:
- Add a method in the base class to support dropping namespace cascade or not.
- Drop namespace by default with false for Spark 3.2
Thanks for your review @zhoujinsong @huyuanfeng2018 |
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.
just a nit comment
...ark/v3.3/amoro-mixed-spark-3.3/src/main/java/org/apache/amoro/spark/SparkUnifiedCatalog.java
Outdated
Show resolved
Hide resolved
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.
LGTM.
Thanks for the contribution! @MarigWeizhi |
Why are the changes needed?
Close #xxx.
Brief change log
dropNamespace
to support cascade or non-cascade inSparkUnifiedCatalogBase
for spark 3.3How was this patch tested?
Add some test cases that check the changes thoroughly including negative and positive cases if possible
Add screenshots for manual tests if appropriate
Run test locally before making a pull request
Documentation