mikedias commented on code in PR #7333:
URL: https://github.com/apache/paimon/pull/7333#discussion_r2923434503


##########
paimon-core/src/main/java/org/apache/paimon/table/source/snapshot/SnapshotReaderImpl.java:
##########
@@ -526,8 +526,19 @@ private Plan toIncrementalPlan(
                     totalBuckets = beforeEntries.get(0).totalBuckets();
                 }
 
-                // deduplicate
-                beforeEntries.removeIf(dataEntries::remove);
+                // deduplicate: remove entries common to both lists
+                // Use HashSet for O(n+m) instead of O(n*m) with List.remove()
+                Set<ManifestEntry> afterSet = new HashSet<>(dataEntries);

Review Comment:
   nit: consider moving this logic into a function, say `deduplicate`, to keep 
the main function cleaner



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