morrySnow commented on code in PR #51086: URL: https://github.com/apache/doris/pull/51086#discussion_r2097586719
########## fe/fe-core/src/main/java/org/apache/doris/nereids/rules/analysis/SubqueryToApply.java: ########## @@ -434,8 +434,14 @@ private Pair<LogicalPlan, Optional<Expression>> addApply(SubqueryExpr subquery, Preconditions.checkState(logicalProject.getOutputs().size() == 1, "Scalar subuqery's should only output 1 column"); Slot aggSlot = agg.toSlot(); - replaceMap.put(aggSlot, new Alias(new Nvl(aggSlot, - notNullableAggFunc.resultForEmptyInput()))); + // we should keep the exprId, so that the parent plan can bind this slot + replaceMap.put(aggSlot, + new Alias( + aggSlot.getExprId(), Review Comment: maybe we need give the agg function a new exprid and replace it in the subquery, to avoid generate same exprid for two different slot in one plan. -- 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