jerqi commented on code in PR #6978:
URL: https://github.com/apache/gravitino/pull/6978#discussion_r2055316579
##########
core/src/main/java/org/apache/gravitino/catalog/SchemaOperationDispatcher.java:
##########
@@ -336,6 +337,15 @@ public boolean dropSchema(NameIdentifier ident, boolean
cascade) throws NonEmpty
store.delete(ident, SCHEMA, cascade);
} catch (NoSuchEntityException e) {
LOG.warn("The schema to be dropped does not exist in the store:
{}", ident, e);
+ } catch (NonEmptyEntityException e) {
+ LOG.warn("The schema to be dropped does not empty in the store:
{}", ident, e);
+ // then cascade delete the schema, otherwise, the schema will
never be deleted.
+ try {
+ store.delete(ident, SCHEMA, true);
Review Comment:
But if so maybe we can use directly and add some comments.
```
try {
store.delete(ident, SCHEMA, true);
} catch (Exception e) {
// ...
}
```
instead of
```
try {
store.delete(ident, SCHEMA, false);
} catch (Exception e) {
store.delete(ident,SCHEMA, true);
}
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]