zeroshade commented on code in PR #654:
URL: https://github.com/apache/iceberg-go/pull/654#discussion_r2688215107


##########
table/snapshot_producers.go:
##########
@@ -86,8 +86,14 @@ func (fa *fastAppendFiles) existingManifests() 
([]iceberg.ManifestFile, error) {
                        return nil, err
                }
 
+               // This provides a constant-time (O(1)) search in a loop.
+               previousSnapshotList := make(map[int64]struct{}, 
len(fa.base.txn.meta.snapshotList))
+               for _, sn := range fa.base.txn.meta.snapshotList {
+                       previousSnapshotList[sn.SnapshotID] = struct{}{}
+               }
+
                for _, m := range manifests {
-                       if m.HasAddedFiles() || m.HasExistingFiles() || 
m.SnapshotID() == fa.base.snapshotID {
+                       if _, ok := previousSnapshotList[m.SnapshotID()]; 
m.HasAddedFiles() || m.HasExistingFiles() || ok {

Review Comment:
   nudging you @lamOrigin007, are you still available to work on this?



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to