Skip to content

Commit f63fccc

Browse files
authored
Merge branch 'branch-3.0' into cp-3
2 parents 6536f08 + a70eed3 commit f63fccc

File tree

3 files changed

+25
-0
lines changed

3 files changed

+25
-0
lines changed

.github/CODEOWNERS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,5 @@
1515
# limitations under the License.
1616
#
1717
* @dataroaring
18+
* @liutang123
19+
* @lide-reed

fe/fe-core/src/main/java/org/apache/doris/nereids/rules/rewrite/ReorderJoin.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,10 @@ public Plan joinToMultiJoin(Plan plan, Map<Plan, DistributeHint> planToHintType)
124124
join = (LogicalJoin<?, ?>) plan;
125125
}
126126

127+
if (join.isMarkJoin()) {
128+
return plan;
129+
}
130+
127131
if (join.getJoinType().isInnerOrCrossJoin()) {
128132
joinFilter.addAll(join.getHashJoinConjuncts());
129133
joinFilter.addAll(join.getOtherJoinConjuncts());

fe/fe-core/src/test/java/org/apache/doris/nereids/rules/rewrite/ReorderJoinTest.java

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,25 @@ public void testLeftSemiJoin() {
105105
);
106106
}
107107

108+
@Test
109+
public void testLeftSemiMarkJoin() {
110+
LogicalPlan plan = new LogicalPlanBuilder(scan1)
111+
.markJoin(scan2, JoinType.LEFT_SEMI_JOIN, Pair.of(0, 0))
112+
.join(scan3, JoinType.INNER_JOIN, Pair.of(0, 0))
113+
.filter(new EqualTo(scan3.getOutput().get(0), scan1.getOutput().get(0)))
114+
.build();
115+
ConnectContext connectContext = MemoTestUtils.createConnectContext();
116+
connectContext.getSessionVariable().setDisableNereidsRules("PRUNE_EMPTY_PARTITION");
117+
PlanChecker.from(connectContext, plan)
118+
.applyBottomUp(new ReorderJoin())
119+
.matchesFromRoot(
120+
logicalJoin(
121+
logicalJoin().when(join -> join.isMarkJoin()),
122+
logicalOlapScan()
123+
).whenNot(join -> join.getJoinType().isCrossJoin())
124+
);
125+
}
126+
108127
@Test
109128
public void testRightSemiJoin() {
110129
LogicalPlan plan1 = new LogicalPlanBuilder(scan1)

0 commit comments

Comments
 (0)