Fokko commented on code in PR #14027:
URL: https://github.com/apache/iceberg/pull/14027#discussion_r2373556081


##########
data/src/test/java/org/apache/iceberg/data/TestMetricsRowGroupFilter.java:
##########
@@ -151,6 +153,9 @@ public static List<Object> parameters() {
   private static final int INT_MIN_VALUE = 30;
   private static final int INT_MAX_VALUE = 79;
 
+  private static final UUID TARGET_UUID = 
UUID.fromString("00000000-0000-0000-0000-000000000000");
+  private static final UUID OTHER_UUID = 
UUID.fromString("11111111-1111-1111-1111-111111111111");

Review Comment:
   Maybe a bit more descriptive :)
   
   ```suggestion
     private static final UUID UUID_WITH_ZEROS = 
UUID.fromString("00000000-0000-0000-0000-000000000000");
     private static final UUID UUID_WITH_ONES = 
UUID.fromString("11111111-1111-1111-1111-111111111111");
   ```
   
   



##########
parquet/src/main/java/org/apache/iceberg/parquet/ParquetConversions.java:
##########
@@ -83,6 +83,8 @@ static Function<Object, Object> converterFromParquet(
       } else if (icebergType.typeId() == Type.TypeID.DOUBLE
           && parquetType.getPrimitiveTypeName() == 
PrimitiveType.PrimitiveTypeName.FLOAT) {
         return value -> ((Float) fromParquet.apply(value)).doubleValue();
+      } else if (icebergType.typeId() == Type.TypeID.UUID) {
+        return binary -> UUIDUtil.convert(((Binary) binary).toByteBuffer());

Review Comment:
   This seems like an odd place to apply this conversion since the rows above 
are more about schema evolution. However, looking at it a bit closer, I think 
it makes sense. Other logical types, such as `TimestampLiteral` store the 
primitive type internally (`long`), while the `UUIDLiteral` keeps a `UUID` 
rather than `bytes`.
   
   This will just compare the bytes using an unsigned lexicographical binary 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to