XN137 commented on code in PR #2317:
URL: https://github.com/apache/polaris/pull/2317#discussion_r2267317586


##########
polaris-core/src/main/java/org/apache/polaris/core/persistence/transactional/TransactionalMetaStoreManagerImpl.java:
##########
@@ -710,20 +709,14 @@ private void bootstrapPolarisService(
       return new 
ListEntitiesResult(BaseResult.ReturnStatus.CATALOG_PATH_CANNOT_BE_RESOLVED, 
null);
     }
 
-    Predicate<PolarisBaseEntity> filter = entity -> true;
-    // prune the returned list with only entities matching the entity subtype
-    if (entitySubType != PolarisEntitySubType.ANY_SUBTYPE) {
-      filter = e -> e.getSubTypeCode() == entitySubType.getCode();
-    }
-
     // return list of active entities
     Page<EntityNameLookupRecord> resultPage =
         ms.listEntitiesInCurrentTxn(
             callCtx,
             resolver.getCatalogIdOrNull(),
             resolver.getParentId(),
             entityType,
-            filter,
+            entitySubType,

Review Comment:
   note that due to this change calls to `PolarisMetaStoreManager.listEntities` 
like here:
   
https://github.com/apache/polaris/blob/2f985ab93ccd65b0c98fdd8902e217792c622a68/runtime/service/src/main/java/org/apache/polaris/service/catalog/iceberg/IcebergCatalog.java#L2574-L2591
   no longer have to load the full `PolarisBaseEntity` to apply the 
`Predicate<PolarisBaseEntity>` and thus they can actually take advantage of 
optimized implementations of `Page<EntityNameLookupRecord> listEntities` in 
`BasePersistence` that load only the required properties.



-- 
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: issues-unsubscr...@polaris.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to