rdblue commented on code in PR #6431:
URL: https://github.com/apache/iceberg/pull/6431#discussion_r1051678034


##########
parquet/src/main/java/org/apache/iceberg/parquet/ParquetDictionaryRowGroupFilter.java:
##########
@@ -165,20 +165,41 @@ public <T> Boolean isNaN(BoundReference<T> ref) {
       }
 
       Set<T> dictionary = dict(id, comparatorForNaNPredicate(ref));
-      return dictionary.stream().anyMatch(NaNUtil::isNaN) ? ROWS_MIGHT_MATCH : 
ROWS_CANNOT_MATCH;
+      return dictionary.contains(naNValueForType(ref.type()))
+          ? ROWS_MIGHT_MATCH
+          : ROWS_CANNOT_MATCH;
     }
 
     @Override
     public <T> Boolean notNaN(BoundReference<T> ref) {
       int id = ref.fieldId();
 
+      if (mayContainNulls.get(id)) {
+        return ROWS_MIGHT_MATCH;
+      }
+
       Boolean hasNonDictPage = isFallback.get(id);
       if (hasNonDictPage == null || hasNonDictPage) {
         return ROWS_MIGHT_MATCH;
       }
 
       Set<T> dictionary = dict(id, comparatorForNaNPredicate(ref));
-      return dictionary.stream().allMatch(NaNUtil::isNaN) ? ROWS_CANNOT_MATCH 
: ROWS_MIGHT_MATCH;
+
+      if (dictionary.size() > 1 || 
!dictionary.contains(naNValueForType(ref.type()))) {

Review Comment:
   I don't think this is correct. Parquet may have more than one NaN value 
because NaN values exist. I don't think Parquet guarantees that values are 
normalized to a single NaN. I think this should roll back both changes.



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