roryqi commented on code in PR #13291:
URL: https://github.com/apache/gravitino/pull/13291#discussion_r4046792282


##########
iceberg/iceberg-rest-server/src/main/java/org/apache/gravitino/iceberg/service/rest/IcebergTableOperations.java:
##########
@@ -571,7 +571,10 @@ static LoadTableResponse 
filterSnapshotsByRefs(LoadTableResponse loadTableRespon
       return loadTableResponse;
     }
     TableMetadata filteredMetadata =
-        
TableMetadata.buildFrom(metadata).suppressHistoricalSnapshots().build();

Review Comment:
   There may be other lazy fields. It seems better to use
   ```
         Set<Long> referencedSnapshotIds =
             metadata.refs().values().stream()
                 .map(SnapshotRef::snapshotId)
                 .collect(Collectors.toSet());
   
         TableMetadata filteredMetadata =
             metadata.removeSnapshotsIf(s -> 
!referencedSnapshotIds.contains(s.snapshotId()));
   ```



-- 
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]

Reply via email to