flyrain commented on code in PR #3693:
URL: https://github.com/apache/polaris/pull/3693#discussion_r2778208157
##########
runtime/service/src/main/java/org/apache/polaris/service/catalog/iceberg/IcebergCatalog.java:
##########
@@ -648,12 +663,23 @@ public boolean dropNamespace(Namespace namespace) throws
NamespaceNotEmptyExcept
Map.of(),
realmConfig.getConfig(FeatureConfiguration.CLEANUP_ON_NAMESPACE_DROP));
- if (!dropEntityResult.isSuccess() &&
dropEntityResult.failedBecauseNotEmpty()) {
- throw new NamespaceNotEmptyException("Namespace %s is not empty",
namespace);
+ if (!dropEntityResult.isSuccess()) {
+ switch (dropEntityResult.getReturnStatus()) {
+ case BaseResult.ReturnStatus.NAMESPACE_NOT_EMPTY:
+ case BaseResult.ReturnStatus.CATALOG_NOT_EMPTY:
+ throw new NamespaceNotEmptyException("Namespace %s is not empty",
namespace);
+
+ case BaseResult.ReturnStatus.ENTITY_NOT_FOUND:
+ return false;
+
+ default:
+ throw new ServiceFailureException(
+ "Unexpected error dropping namespace %s: %s. ExtraInfo: %s",
Review Comment:
Minor: "Failed to drop namespace %s, status=%s, extraInfo=%s"?
--
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]