bodduv commented on code in PR #14500:
URL: https://github.com/apache/iceberg/pull/14500#discussion_r2758449643
##########
api/src/main/java/org/apache/iceberg/expressions/Literals.java:
##########
@@ -608,9 +608,24 @@ public String toString() {
}
}
- static class UUIDLiteral extends ComparableLiteral<UUID> {
+ static class UUIDLiteral extends BaseLiteral<UUID> {
+ private static final Comparator<UUID> RFC_CMP =
+ Comparators.<UUID>nullsFirst().thenComparing(Comparators.uuids());
+ private static final Comparator<UUID> SIGNED_CMP =
+
Comparators.<UUID>nullsFirst().thenComparing(Comparators.signedUUIDs());
+
+ // Flag to indicate which comparator to use (serializable)
+ private final boolean useSignedComparator;
+ // Transient cached comparator (reconstructed on deserialization)
+ private transient volatile Comparator<UUID> cmp;
+
UUIDLiteral(UUID value) {
+ this(value, false);
Review Comment:
While this change is in sync with `Comparators.COMPARATORS`, I can
understand it could be a breaking change if its used downstream.
This PR could be a good place to break away from signed comparator as the
default. The alternative would be to switch the default comparator, but it
breaks consistency with `Comparators.COMPARATORS`. I think supporting legacy
min/max values of previously written data files is probably a more important
change/use-case than this one. I will let other folks chime-in.
--
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]