From 1e3da9535902b648cb53d849dc3d8a235170c570 Mon Sep 17 00:00:00 2001 From: jakevin Date: Wed, 15 Mar 2023 13:39:08 +0800 Subject: [PATCH] [fix](Nereids): fix LAsscom split conjuncts. (#17792) --- .../rules/exploration/join/InnerJoinLAsscomProject.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/rules/exploration/join/InnerJoinLAsscomProject.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/rules/exploration/join/InnerJoinLAsscomProject.java index 4a64610fab..b48e429ccf 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/rules/exploration/join/InnerJoinLAsscomProject.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/rules/exploration/join/InnerJoinLAsscomProject.java @@ -65,7 +65,7 @@ public class InnerJoinLAsscomProject extends OneExplorationRuleFactory { GroupPlan a = bottomJoin.left(); GroupPlan b = bottomJoin.right(); GroupPlan c = topJoin.right(); - Set cOutputSet = c.getOutputSet(); + Set cExprIdSet = c.getOutputExprIdSet(); /* ********** Split projects ********** */ Map> map = JoinReorderUtils.splitProjection(projects, b); @@ -95,15 +95,16 @@ public class InnerJoinLAsscomProject extends OneExplorationRuleFactory { // Add all slots used by OnCondition when projects not empty. Set aExprIdSet = JoinReorderUtils.combineProjectAndChildExprId(a, aProjects); Map> abOnUsedSlots = Stream.concat( - bottomJoin.getHashJoinConjuncts().stream(), - bottomJoin.getHashJoinConjuncts().stream()) + newTopHashConjuncts.stream(), + newTopOtherConjuncts.stream()) .flatMap(onExpr -> onExpr.getInputSlots().stream()) + .filter(slot -> !cExprIdSet.contains(slot.getExprId())) .collect(Collectors.partitioningBy( slot -> aExprIdSet.contains(slot.getExprId()), Collectors.toSet())); JoinReorderUtils.addSlotsUsedByOn(abOnUsedSlots.get(true), aProjects); JoinReorderUtils.addSlotsUsedByOn(abOnUsedSlots.get(false), bProjects); - aProjects.addAll(cOutputSet); + aProjects.addAll(c.getOutput()); /* ********** new Plan ********** */ LogicalJoin newBottomJoin = topJoin.withConjunctsChildren(newBottomHashConjuncts,