This is an automated email from the ASF dual-hosted git repository.

yiguolei pushed a commit to branch branch-2.1
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/branch-2.1 by this push:
     new ccb6c2610aa branch-2.1: [fix](nereids)fix bug of 
PushDownFilterThroughSetOperation (#46370) (#46456)
ccb6c2610aa is described below

commit ccb6c2610aa099fae18b4f2d9cda8ae18efc65a2
Author: morrySnow <[email protected]>
AuthorDate: Mon Jan 6 21:34:40 2025 +0800

    branch-2.1: [fix](nereids)fix bug of PushDownFilterThroughSetOperation 
(#46370) (#46456)
    
    pick from master #46370
    
    Co-authored-by: feiniaofeiafei <[email protected]>
---
 .../nereids/rules/rewrite/PushDownFilterThroughSetOperation.java    | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/nereids/rules/rewrite/PushDownFilterThroughSetOperation.java
 
b/fe/fe-core/src/main/java/org/apache/doris/nereids/rules/rewrite/PushDownFilterThroughSetOperation.java
index c8f83d62b49..4146fed87f6 100644
--- 
a/fe/fe-core/src/main/java/org/apache/doris/nereids/rules/rewrite/PushDownFilterThroughSetOperation.java
+++ 
b/fe/fe-core/src/main/java/org/apache/doris/nereids/rules/rewrite/PushDownFilterThroughSetOperation.java
@@ -44,16 +44,16 @@ public class PushDownFilterThroughSetOperation extends 
OneRewriteRuleFactory {
         return logicalFilter(logicalSetOperation()).then(f -> {
             LogicalSetOperation setOperation = f.child();
             List<Plan> newChildren = new ArrayList<>();
-            for (Plan child : setOperation.children()) {
+            for (int childIdx = 0; childIdx < setOperation.children().size(); 
++childIdx) {
                 Map<Expression, Expression> replaceMap = new HashMap<>();
                 for (int i = 0; i < setOperation.getOutputs().size(); ++i) {
                     NamedExpression output = setOperation.getOutputs().get(i);
-                    replaceMap.put(output, child.getOutput().get(i));
+                    replaceMap.put(output, 
setOperation.getRegularChildOutput(childIdx).get(i));
                 }
 
                 Set<Expression> newFilterPredicates = 
f.getConjuncts().stream().map(conjunct ->
                         ExpressionUtils.replace(conjunct, 
replaceMap)).collect(ImmutableSet.toImmutableSet());
-                newChildren.add(new LogicalFilter<>(newFilterPredicates, 
child));
+                newChildren.add(new LogicalFilter<>(newFilterPredicates, 
setOperation.child(childIdx)));
             }
 
             return setOperation.withChildren(newChildren);


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to