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


##########
data/src/test/java/org/apache/iceberg/data/BaseFormatModelTests.java:
##########
@@ -1518,18 +1571,44 @@ 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) {
+    if (value == null) {
+      return null;
+    }
+
+    switch (type.typeId()) {
+      case DATE:
+        return DateTimeUtil.daysFromDate((LocalDate) value);
+      case TIME:
+        return DateTimeUtil.microsFromTime((LocalTime) value);

Review Comment:
   Yeah, good 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