Riza Suminto has posted comments on this change. ( 
http://gerrit.cloudera.org:8080/22897 )

Change subject: IMPALA-14071: Refactor 
MathUtil.saturatingMultiplyCardinalities()
......................................................................


Patch Set 8:

(2 comments)

http://gerrit.cloudera.org:8080/#/c/22897/7//COMMIT_MSG
Commit Message:

http://gerrit.cloudera.org:8080/#/c/22897/7//COMMIT_MSG@24
PS7, Line 24:
            : multiplyCardinalities
> Stale comment.
Done


http://gerrit.cloudera.org:8080/#/c/22897/7/fe/src/main/java/org/apache/impala/util/MathUtil.java
File fe/src/main/java/org/apache/impala/util/MathUtil.java:

http://gerrit.cloudera.org:8080/#/c/22897/7/fe/src/main/java/org/apache/impala/util/MathUtil.java@28
PS7, Line 28:
            :   // Multiply two numbers. If the multiply would overflow, return 
either Long.MIN_VALUE
            :   // (if a xor b is negative) or Long.MAX_VALUE otherwise.
            :   public static long saturatingMultiply(long a, long b) {
            :     return LongMath.saturatedMultiply(a, b);
            :   }
            :
            :   // Add two numbers. If the add would overflow, return either 
Long.MAX_VALUE if both are
            :   // positive or Long.MIN_VALUE if both are negative.
            :   public static long saturatingAdd(long a, long b) {
            :     return LongMath.saturatedAdd(a, b);
            :   }
            :
            :   /**
            :    * Computes and returns the sum of two cardinality numbers. If 
an overflow occurs,
            :    * the maximum Long value is returned (Long.MAX_VALUE).
            :    * Both number should be a valid cardinality number (>= -1).
            :    * Return -1 if any argument is -1.
            :    */
            :   p
> Looks like it is safe to change it to simply wrap LongMath.saturatedAdd() a
Done



--
To view, visit http://gerrit.cloudera.org:8080/22897
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I505ab11cfa1024feb4ceac4cffe9c3283be228ce
Gerrit-Change-Number: 22897
Gerrit-PatchSet: 8
Gerrit-Owner: Riza Suminto <[email protected]>
Gerrit-Reviewer: Impala Public Jenkins <[email protected]>
Gerrit-Reviewer: Jason Fehr <[email protected]>
Gerrit-Reviewer: Riza Suminto <[email protected]>
Gerrit-Reviewer: Wenzhe Zhou <[email protected]>
Gerrit-Reviewer: Zoltan Borok-Nagy <[email protected]>
Gerrit-Comment-Date: Wed, 14 May 2025 18:08:03 +0000
Gerrit-HasComments: Yes

Reply via email to