morrySnow commented on code in PR #10659: URL: https://github.com/apache/doris/pull/10659#discussion_r916496635
########## fe/fe-core/src/main/java/org/apache/doris/analysis/FunctionCallExpr.java: ########## @@ -1257,6 +1257,16 @@ public String forJSON(String str) { @Override public void finalizeImplForNereids() throws AnalysisException { - super.finalizeImplForNereids(); + if (fnName.getFunction().equalsIgnoreCase("sum")) { + // Prevent the cast type in vector exec engine + Type childType = getChild(0).type.getMaxResolutionType(); + fn = getBuiltinFunction(fnName.getFunction(), new Type[]{childType}, + Function.CompareMode.IS_NONSTRICT_SUPERTYPE_OF); + type = fn.getReturnType(); + } + } + + public void setMergeAggFn(boolean mergeAggFn) { Review Comment: not exactly, expression translator should not know about aggregate phase info ########## fe/fe-core/src/main/java/org/apache/doris/nereids/analyzer/UnboundFunction.java: ########## @@ -52,6 +54,14 @@ public List<Expression> getArguments() { return children(); } + @Override + public String sql() throws UnboundException { Review Comment: sql is better i think -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org