This is an automated email from the ASF dual-hosted git repository.
morrysnow pushed a commit to branch branch-2.1
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/branch-2.1 by this push:
new b878f7f1a68 [fix](planner) binary predicate result should compare with
0 (#39474) (#39717)
b878f7f1a68 is described below
commit b878f7f1a68295571a430054e002b89d567d0202
Author: morrySnow <[email protected]>
AuthorDate: Wed Aug 21 20:47:14 2024 +0800
[fix](planner) binary predicate result should compare with 0 (#39474)
(#39717)
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: [email protected]
For additional commands, e-mail: [email protected]