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 2aeeb24c44e94d..148d1e543a4b59 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 Type castAllToCompatibleType(List exprs) throws AnalysisException { } // 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 83258db7b44600..2721ca258dd77a 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 @@ private void analyzeBuiltinAggFunction(Analyzer analyzer) throws AnalysisExcepti 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 @@ private void analyzeBuiltinAggFunction(Analyzer analyzer) throws AnalysisExcepti 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); }