danhuawang commented on issue #11296:
URL: https://github.com/apache/gravitino/issues/11296#issuecomment-4572529330
Another test case also failed, I think it's the same issue.
```
@Test
@DisplayName("Dropping parent schema when child is empty may succeed on
Iceberg")
public void testDropParentSchemaWithEmptyChildMaySucceed() {
String parent = testRunPrefix + "_dpe";
String child = parent + ":emptychild";
icebergCatalog.asSchemas().createSchema(parent, "parent",
Collections.emptyMap());
icebergCatalog.asSchemas().createSchema(child, "empty child",
Collections.emptyMap());
// Dropping parent when child schema is empty — Iceberg may allow this
// (it drops empty child namespaces). We verify the behavior is
consistent:
// either it succeeds and both are gone, or it throws and both remain.
try {
boolean dropped = icebergCatalog.asSchemas().dropSchema(parent, false);
if (dropped) {
LOG.info("Iceberg allowed dropping parent with empty child — both
should be gone");
Assertions.assertThrows(
NoSuchSchemaException.class, () ->
icebergCatalog.asSchemas().loadSchema(parent));
Assertions.assertThrows(
NoSuchSchemaException.class, () ->
icebergCatalog.asSchemas().loadSchema(child));
}
} catch (Exception e) {
LOG.info(
"Iceberg rejected dropping parent with empty child: {} — both
should remain",
e.getMessage());
Assertions.assertNotNull(icebergCatalog.asSchemas().loadSchema(parent));
Assertions.assertNotNull(icebergCatalog.asSchemas().loadSchema(child));
// Clean up — dropping parent directly removes empty children
icebergCatalog.asSchemas().dropSchema(parent, false);
}
}
```
--
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]