pvary commented on code in PR #15795:
URL: https://github.com/apache/iceberg/pull/15795#discussion_r3266444538


##########
data/src/test/java/org/apache/iceberg/data/BaseFormatModelTests.java:
##########
@@ -1856,18 +1919,46 @@ private static Object[] computeMinMax(
         continue;
       }
 
-      if (min == null || cmp.compare(value, min) < 0) {
-        min = value;
+      // Convert to internal Iceberg type for comparison
+      Object internalValue = toInternal(field.type(), value);
+
+      if (min == null || cmp.compare(internalValue, min) < 0) {
+        min = internalValue;
       }
 
-      if (max == null || cmp.compare(value, max) > 0) {
-        max = value;
+      if (max == null || cmp.compare(internalValue, max) > 0) {
+        max = internalValue;
       }
     }
 
     return new Object[] {min, max};
   }
 
+  private static Object toInternal(Type type, Object value) {

Review Comment:
   This seems very similar what we do with the `InternalRecordWrapper`. Could 
we reuse that?



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