You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by yi...@apache.org on 2022/07/20 08:00:32 UTC

[doris] branch master updated: [fix](planner)unnecessary cast will be added on children in InPredicate (#11033)

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

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


The following commit(s) were added to refs/heads/master by this push:
     new 658a9f7531 [fix](planner)unnecessary cast will be added on children in InPredicate (#11033)
658a9f7531 is described below

commit 658a9f7531ea7ba801d813827d32f1090b8c5346
Author: morrySnow <10...@users.noreply.github.com>
AuthorDate: Wed Jul 20 16:00:26 2022 +0800

    [fix](planner)unnecessary cast will be added on children in InPredicate (#11033)
---
 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 2aeeb24c44..148d1e543a 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
@@ -1897,7 +1897,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 83258db7b4..2721ca258d 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
@@ -695,7 +695,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);
             }
@@ -704,7 +704,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: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org