raunaqmorarka commented on code in PR #18359:
URL: https://github.com/apache/iceberg/pull/18359#discussion_r4208868042


##########
core/src/main/java/org/apache/iceberg/DeleteFileIndex.java:
##########
@@ -493,6 +495,8 @@ private Collection<DeleteFile> loadDeleteFiles() {
       // read all of the matching delete manifests in parallel and accumulate 
the matching files in
       // a queue
       Queue<DeleteFile> files = new ConcurrentLinkedQueue<>();
+      // share one location instance across deletes that reference the same 
data file
+      Map<String, String> referencedDataFiles = Maps.newConcurrentMap();

Review Comment:
   Split into two commits: the no-stats copy first, the location sharing on top.
   



##########
core/src/main/java/org/apache/iceberg/DeleteFileIndex.java:
##########
@@ -519,6 +516,26 @@ private Collection<DeleteFile> loadDeleteFiles() {
       return files;
     }
 
+    /** Copies a delete file with the minimum stats needed for indexing to 
limit memory use. */
+    private static DeleteFile copyWithMinStats(
+        DeleteFile file, Map<String, String> referencedDataFiles) {
+      if (file.content() == FileContent.EQUALITY_DELETES) {
+        // copy with stats for better filtering against data file stats
+        return file.copyWithStats(Set.copyOf(file.equalityFieldIds()));
+      }
+
+      String referencedDataFile = 
ContentFileUtil.referencedDataFileLocation(file);

Review Comment:
   The cast is needed either way. It reaches the package-private 
`copyWithoutStats(String)` on `GenericDeleteFile` that records the referenced 
data file, which the public `DeleteFile` API cannot set. The second commit only 
adds the map lookup around that call.
   



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