xxubai commented on code in PR #4163:
URL: https://github.com/apache/amoro/pull/4163#discussion_r3043062894


##########
amoro-format-mixed/amoro-mixed-hive/src/main/java/org/apache/iceberg/parquet/AdaptHiveParquetUtil.java:
##########
@@ -122,14 +122,29 @@ public static Metrics footerMetrics(
             Types.NestedField field = fileSchema.findField(fieldId);
             if (field != null && stats.hasNonNullValue() && 
shouldStoreBounds(column, fileSchema)) {
               // Change for mixed-hive table ⬇
-              // Add metrics for int96 type
-              Literal<?> min =
+              // Add metrics for int96 type.
+              // For INT96 timestamps, Parquet's byte-wise min/max comparison 
does not
+              // match chronological ordering due to little-endian storage of
+              // nanoseconds-of-day. Convert both values first, then determine 
the
+              // actual min and max from the converted (microsecond) 
representations.
+              Literal<?> val1 =
                   AdaptHiveParquetConversions.fromParquetPrimitive(
                       field.type(), column.getPrimitiveType(), 
stats.genericGetMin());
-              updateMin(lowerBounds, fieldId, field.type(), min, metricsMode);
-              Literal<?> max =
+              Literal<?> val2 =
                   AdaptHiveParquetConversions.fromParquetPrimitive(
                       field.type(), column.getPrimitiveType(), 
stats.genericGetMax());
+              Literal<?> min;
+              Literal<?> max;
+              @SuppressWarnings("unchecked")
+              java.util.Comparator<Object> cmp = 
(java.util.Comparator<Object>) val1.comparator();

Review Comment:
   nit 
   ```suggestion
                 Comparator<Object> cmp = (Comparator<Object>) 
val1.comparator();
   ```



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

Reply via email to