findinpath commented on code in PR #18338:
URL: https://github.com/apache/iceberg/pull/18338#discussion_r4541333747


##########
api/src/main/java/org/apache/iceberg/expressions/InclusiveMetricsEvaluator.java:
##########
@@ -75,6 +84,25 @@ private class MetricsEvalVisitor extends 
InclusiveEvalVisitor {
     private Map<Integer, ByteBuffer> lowerBounds = null;
     private Map<Integer, ByteBuffer> upperBounds = null;
 
+    private static <V> Map<Integer, V> forPruning(
+        ContentFile<?> file, Function<ContentFile<?>, Map<Integer, V>> stats) {
+      Map<Integer, V> columnStats = stats.apply(file);
+      if (columnStats == null || file.content() != 
FileContent.EQUALITY_DELETES) {
+        return columnStats;
+      }
+
+      List<Integer> equalityFieldIds = file.equalityFieldIds();
+      if (equalityFieldIds == null || equalityFieldIds.isEmpty()) {
+        LOG.warn(
+            "Ignoring stats of equality delete file without equality field 
IDs: {}",
+            file.location());

Review Comment:
   @huaxingao thank you for the suggestion. Adjusted the code to perform the 
eval only once.



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