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

yiguolei pushed a commit to branch dev-1.1.1
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/dev-1.1.1 by this push:
     new 031f848e9c [cherry-pick][fix](planner)unnecessary cast will be added 
on children in InPredicate (#11033) (#11036)
031f848e9c is described below

commit 031f848e9c7d15e74d3bfff1aa7be4ffac9e9985
Author: yiguolei <[email protected]>
AuthorDate: Wed Jul 20 16:23:33 2022 +0800

    [cherry-pick][fix](planner)unnecessary cast will be added on children in 
InPredicate (#11033) (#11036)
    
    Co-authored-by: morrySnow <[email protected]>
---
 fe/fe-core/src/main/java/org/apache/doris/analysis/Analyzer.java      | 2 +-
 .../src/main/java/org/apache/doris/analysis/FunctionCallExpr.java     | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/fe/fe-core/src/main/java/org/apache/doris/analysis/Analyzer.java 
b/fe/fe-core/src/main/java/org/apache/doris/analysis/Analyzer.java
index 74b8b674e1..ce9cfea77a 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/analysis/Analyzer.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/analysis/Analyzer.java
@@ -1763,7 +1763,7 @@ public class Analyzer {
         }
         // Add implicit casts if necessary.
         for (int i = 0; i < exprs.size(); ++i) {
-            if (exprs.get(i).getType() != compatibleType) {
+            if (!exprs.get(i).getType().equals(compatibleType)) {
                 Expr castExpr = exprs.get(i).castTo(compatibleType);
                 exprs.set(i, castExpr);
             }
diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/analysis/FunctionCallExpr.java 
b/fe/fe-core/src/main/java/org/apache/doris/analysis/FunctionCallExpr.java
index 4c0a85a6fe..455e08ec03 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/analysis/FunctionCallExpr.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/analysis/FunctionCallExpr.java
@@ -590,7 +590,7 @@ public class FunctionCallExpr extends Expr {
                 throw new AnalysisException("topn requires second parameter 
must be a constant Integer Type: "
                         + this.toSql());
             }
-            if (getChild(1).getType() != ScalarType.INT) {
+            if (!getChild(1).getType().equals(ScalarType.INT)) {
                 Expr e = getChild(1).castTo(ScalarType.INT);
                 setChild(1, e);
             }
@@ -599,7 +599,7 @@ public class FunctionCallExpr extends Expr {
                     throw new AnalysisException("topn requires the third 
parameter must be a constant Integer Type: "
                             + this.toSql());
                 }
-                if (getChild(2).getType() != ScalarType.INT) {
+                if (!getChild(2).getType().equals(ScalarType.INT)) {
                     Expr e = getChild(2).castTo(ScalarType.INT);
                     setChild(2, e);
                 }


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to