dimas-b commented on code in PR #4724:
URL: https://github.com/apache/polaris/pull/4724#discussion_r3417983732
##########
runtime/service/src/main/java/org/apache/polaris/service/catalog/iceberg/IcebergCatalogHandler.java:
##########
@@ -1415,8 +1416,14 @@ public void renameView(RenameTableRequest request) {
TableMetadata filteredMetadata =
metadata.removeSnapshotsIf(s ->
!referencedSnapshotIds.contains(s.snapshotId()));
+ TableMetadata filteredMetadataWithLocation =
+ TableMetadata.buildFrom(filteredMetadata)
Review Comment:
`removeSnapshotsIf()` uses a `Builder`... so why rebuild twice? Why not
inline the code from `metadata.removeSnapshotsIf()` and reuse the same builder
both for filtering and resetting metadata location?
I guess it's also going to be more efficient by _not_ constructing two
useless lists: `List<Snapshot>` and `Set<Long>` 🤔
--
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]