Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -428,11 +428,11 @@ public Void visitLogicalJoin(LogicalJoin<? extends Plan, ? extends Plan> join,
} else if ((joinType.isLeftJoin()
|| joinType.isLeftSemiJoin()
|| joinType.isLeftAntiJoin()) && useLeft) {
return visit(join.left(), context);
return join.left().accept(this, context);
} else if ((joinType.isRightJoin()
|| joinType.isRightAntiJoin()
|| joinType.isRightSemiJoin()) && !useLeft) {
return visit(join.right(), context);
return join.right().accept(this, context);
}
context.addFailReason(String.format("partition column is in un supported join null generate side, "
+ "current join type is %s", joinType));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -421,6 +421,26 @@ public void getRelatedTableInfoLeftAntiJoinTest() {
});
}

// if select * used in partition table side, should get related table
@Test
public void getRelatedTableInfoLeftJoinSelectStarTest() {
PlanChecker.from(connectContext)
.checkExplain(" select l1.*, O_CUSTKEY \n"
+ " from lineitem_list_partition l1\n"
+ " left outer join orders_list_partition\n"
+ " on l1.l_shipdate = o_orderdate\n",
nereidsPlanner -> {
Plan rewrittenPlan = nereidsPlanner.getRewrittenPlan();
RelatedTableInfo relatedTableInfo =
MaterializedViewUtils.getRelatedTableInfo("l_orderkey", null,
rewrittenPlan, nereidsPlanner.getCascadesContext());
checkRelatedTableInfo(relatedTableInfo,
"lineitem_list_partition",
"l_orderkey",
true);
});
}

@Test
public void getRelatedTableInfoSelfJoinTest() {
PlanChecker.from(connectContext)
Expand Down