danny0405 commented on code in PR #19637:
URL: https://github.com/apache/hudi/pull/19637#discussion_r3888209280


##########
hudi-common/src/main/java/org/apache/hudi/common/util/OrderingValues.java:
##########
@@ -114,7 +114,26 @@ public static List<Comparable> getValues(ArrayComparable 
orderingValue) {
     return orderingValue.getValues();
   }
 
-  public static boolean isCommitTimeOrderingValue(Comparable orderingValue) {
+  public static boolean isNullOrDefault(Comparable orderingValue) {
     return orderingValue == null || OrderingValues.isDefault(orderingValue);
   }
+
+  /**
+   * Returns whether {@code baseOrderingValue} strictly outranks {@code 
incomingOrderingValue} under
+   * event-time ordering. A null or default (commit-time) base ordering value 
ranks lowest, so this
+   * returns {@code false} and the incoming record wins by natural order. The 
incoming ordering value
+   * is expected to be a real value; callers that may pass a null or default 
incoming value (for
+   * example delete records) must guard for it before calling. Two non-null 
values of different
+   * classes are not comparable and throw {@link IllegalArgumentException}.
+   */
+  public static boolean isBaseOrderingHigher(Comparable baseOrderingValue, 
Comparable incomingOrderingValue) {
+    if (isNullOrDefault(baseOrderingValue)) {

Review Comment:
   +1, there is no need to change the non-deletes merging path.



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