EmmyMiao87 commented on a change in pull request #6380: URL: https://github.com/apache/incubator-doris/pull/6380#discussion_r683222613
########## File path: fe/fe-core/src/main/java/org/apache/doris/planner/SingleNodePlanner.java ########## @@ -1838,6 +1837,11 @@ public PlanNode createJoinNode(Analyzer analyzer, PlanNode outer, PlanNode inner */ private PlanNode createJoinNode(Analyzer analyzer, PlanNode outer, TableRef innerRef, SelectStmt selectStmt) throws UserException { + // Before creating a build node, ensure that all required slots are materialized, + // even if slots that are not needed by Statement outside. + // Otherwise, when select stmt and on-clause does not contain the Slot of the Union Node on the right side of Join, + // it will cause an error, see Doris-6380. + materializeTableResultForCrossJoinOrCountStar(innerRef, analyzer); Review comment: Changing the order is not a good way -- 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