jbonofre commented on code in PR #4091:
URL: https://github.com/apache/polaris/pull/4091#discussion_r3032502123
##########
runtime/service/src/main/java/org/apache/polaris/service/catalog/iceberg/IcebergCatalogHandler.java:
##########
@@ -381,15 +387,15 @@ public ListTablesResponse listTables(Namespace namespace,
String pageToken, Inte
PolarisAuthorizableOperation op = PolarisAuthorizableOperation.LIST_TABLES;
authorizeBasicNamespaceOperationOrThrow(op, namespace);
- if (baseCatalog instanceof IcebergCatalog polarisCatalog) {
+ if (isFederated) {
Review Comment:
If I may, it seems that `isFererated` flag duplicates information already
derivable from `baseCatalog`'s type.
##########
runtime/service/src/main/java/org/apache/polaris/service/catalog/iceberg/IcebergCatalogHandler.java:
##########
@@ -849,14 +855,14 @@ private LoadTableResponse.Builder
buildLoadTableResponseWithDelegationCredential
return responseBuilder;
}
- if (baseCatalog instanceof IcebergCatalog
+ if (!isFederated
Review Comment:
Is it not a regression on type safety ?
If `catalogFactory().createCallContextCatalog()` returns something over than
`IcebergCatalog`, the "previous" code would gracefully fall through to the else
branch, while the new code throws a `ClassCastException` at runtime.
The `isFederated` flag and `baseCatalog`'s concrete type are set
independently - there's no compile-time guarantee they stay in sync.
--
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]