flyrain commented on code in PR #3693:
URL: https://github.com/apache/polaris/pull/3693#discussion_r2778208409
##########
runtime/service/src/main/java/org/apache/polaris/service/catalog/iceberg/IcebergCatalog.java:
##########
@@ -835,8 +861,26 @@ public boolean dropView(TableIdentifier identifier) {
boolean purge =
realmConfig.getConfig(FeatureConfiguration.PURGE_VIEW_METADATA_ON_DROP,
catalogEntity);
- return dropTableLike(PolarisEntitySubType.ICEBERG_VIEW, identifier,
Map.of(), purge)
- .isSuccess();
+ DropEntityResult dropEntityResult =
+ dropTableLike(PolarisEntitySubType.ICEBERG_VIEW, identifier, Map.of(),
purge);
+ if (!dropEntityResult.isSuccess()) {
+ switch (dropEntityResult.getReturnStatus()) {
+ case BaseResult.ReturnStatus.ENTITY_NOT_FOUND:
+ return false;
+
+ case BaseResult.ReturnStatus.ENTITY_UNDROPPABLE:
+ throw new ForbiddenException(
+ "View %s cannot be dropped: %s", identifier,
dropEntityResult.getExtraInformation());
+
+ default:
+ throw new ServiceFailureException(
+ "Unexpected error dropping view %s: %s. ExtraInfo: %s",
Review Comment:
Minor: Failed to drop view %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]