This is an automated email from the ASF dual-hosted git repository. yiguolei pushed a commit to branch dev-1.1.2 in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/dev-1.1.2 by this push: new 501eeac997 [fix](union)the result exprs of union node should substitute by child node's smap (#12051) 501eeac997 is described below commit 501eeac99703ddb6eb9340ab6defadb32daae5d8 Author: starocean999 <40539150+starocean...@users.noreply.github.com> AuthorDate: Wed Aug 24 21:37:54 2022 +0800 [fix](union)the result exprs of union node should substitute by child node's smap (#12051) --- .../main/java/org/apache/doris/planner/SetOperationNode.java | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/fe/fe-core/src/main/java/org/apache/doris/planner/SetOperationNode.java b/fe/fe-core/src/main/java/org/apache/doris/planner/SetOperationNode.java index 14b6ec38a2..a16ef960a1 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/planner/SetOperationNode.java +++ b/fe/fe-core/src/main/java/org/apache/doris/planner/SetOperationNode.java @@ -130,6 +130,15 @@ public abstract class SetOperationNode extends PlanNode { @Override public void finalize(Analyzer analyzer) throws UserException { super.finalize(analyzer); + // the resultExprLists should be substituted by child's output smap + // because the result exprs are column A, B, but the child output exprs are column B, A + // after substituted, the next computePassthrough method will get correct info to do its job + List<List<Expr>> substitutedResultExprLists = Lists.newArrayList(); + for (int i = 0; i < resultExprLists_.size(); ++i) { + substitutedResultExprLists.add(Expr.substituteList( + resultExprLists_.get(i), children.get(i).getOutputSmap(), analyzer, true)); + } + resultExprLists_ = substitutedResultExprLists; // In Doris-6380, moved computePassthrough() and the materialized position of resultExprs/constExprs from this.init() // to this.finalize(), and will not call SetOperationNode::init() again at the end of createSetOperationNodeFragment(). // @@ -164,8 +173,7 @@ public abstract class SetOperationNode extends PlanNode { newExprList.add(exprList.get(j)); } } - materializedResultExprLists_.add( - Expr.substituteList(newExprList, getChild(i).getOutputSmap(), analyzer, true)); + materializedResultExprLists_.add(newExprList); } Preconditions.checkState( materializedResultExprLists_.size() == getChildren().size()); --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org