dimas-b commented on code in PR #1528: URL: https://github.com/apache/polaris/pull/1528#discussion_r2079930782
########## extension/persistence/eclipselink/src/main/java/org/apache/polaris/extension/persistence/impl/eclipselink/PolarisEclipseLinkMetaStoreSessionImpl.java: ########## @@ -450,27 +455,33 @@ public List<EntityNameLookupRecord> lookupEntityActiveBatchInCurrentTxn( entity.getParentId(), entity.getName(), entity.getTypeCode(), - entity.getSubTypeCode())); + entity.getSubTypeCode()), + pageToken); } @Override - public @Nonnull <T> List<T> listEntitiesInCurrentTxn( + public @Nonnull <T> Page<T> listEntitiesInCurrentTxn( @Nonnull PolarisCallContext callCtx, long catalogId, long parentId, @Nonnull PolarisEntityType entityType, - int limit, @Nonnull Predicate<PolarisBaseEntity> entityFilter, - @Nonnull Function<PolarisBaseEntity, T> transformer) { + @Nonnull Function<PolarisBaseEntity, T> transformer, + @Nonnull PageToken pageToken) { // full range scan under the parent for that type - return this.store - .lookupFullEntitiesActive(localSession.get(), catalogId, parentId, entityType) - .stream() - .map(ModelEntity::toEntity) - .filter(entityFilter) - .limit(limit) - .map(transformer) - .collect(Collectors.toList()); + Stream<PolarisBaseEntity> data = + this.store + .lookupFullEntitiesActive( + localSession.get(), catalogId, parentId, entityType, pageToken) + .stream() + .map(ModelEntity::toEntity) + .filter(entityFilter); + + if (pageToken instanceof HasPageSize hasPageSize) { Review Comment: I'm not sure this is functionally correct. If the token is a sub-class of `HasPageSize` but has other information that the client provided, but EclipseLink does not recognise, I do not think it would be correct to just use the page size from the token. I believe we should check for a specific type here and fail on all types, whose details cannot be fully processed. -- 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