This is an automated email from the ASF dual-hosted git repository.

morrysnow pushed a commit to branch 2.1_39474
in repository https://gitbox.apache.org/repos/asf/doris.git

commit 17b3e151cee461356ca8ef3cfa3cd2fa7cc902ad
Author: morrySnow <101034200+morrys...@users.noreply.github.com>
AuthorDate: Wed Aug 21 16:46:25 2024 +0800

    [fix](planner) binary predicate result should compare with 0 (#39474)
    
    pick from master #39474
---
 .../main/java/org/apache/doris/analysis/BinaryPredicate.java   | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/analysis/BinaryPredicate.java 
b/fe/fe-core/src/main/java/org/apache/doris/analysis/BinaryPredicate.java
index 8a0228a5f75..6935578ad30 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/analysis/BinaryPredicate.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/analysis/BinaryPredicate.java
@@ -816,7 +816,7 @@ public class BinaryPredicate extends Predicate implements 
Writable {
         return compareLiteral((LiteralExpr) leftChildValue, (LiteralExpr) 
rightChildValue);
     }
 
-    private Expr compareLiteral(LiteralExpr first, LiteralExpr second) throws 
AnalysisException {
+    private Expr compareLiteral(LiteralExpr first, LiteralExpr second) {
         final boolean isFirstNull = (first instanceof NullLiteral);
         final boolean isSecondNull = (second instanceof NullLiteral);
         if (op == Operator.EQ_FOR_NULL) {
@@ -837,13 +837,13 @@ public class BinaryPredicate extends Predicate implements 
Writable {
             case EQ_FOR_NULL:
                 return new BoolLiteral(compareResult == 0);
             case GE:
-                return new BoolLiteral(compareResult == 1 || compareResult == 
0);
+                return new BoolLiteral(compareResult >= 0);
             case GT:
-                return new BoolLiteral(compareResult == 1);
+                return new BoolLiteral(compareResult > 0);
             case LE:
-                return new BoolLiteral(compareResult == -1 || compareResult == 
0);
+                return new BoolLiteral(compareResult <= 0);
             case LT:
-                return new BoolLiteral(compareResult == -1);
+                return new BoolLiteral(compareResult < 0);
             case NE:
                 return new BoolLiteral(compareResult != 0);
             default:


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to