This is an automated email from the ASF dual-hosted git repository. morrysnow 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 1913e4e78d1 branch-2.1: [fix](mtmv) Fix partition track column fail when 'select *' used in related partition side #43531 (#43941) 1913e4e78d1 is described below commit 1913e4e78d16030e559cbe3d7a54a891075bb0eb Author: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> AuthorDate: Tue Nov 19 20:27:13 2024 +0800 branch-2.1: [fix](mtmv) Fix partition track column fail when 'select *' used in related partition side #43531 (#43941) Cherry-picked from #43531 Co-authored-by: seawinde <w...@selectdb.com> --- .../rules/exploration/mv/MaterializedViewUtils.java | 4 ++-- .../exploration/mv/MaterializedViewUtilsTest.java | 20 ++++++++++++++++++++ 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/rules/exploration/mv/MaterializedViewUtils.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/rules/exploration/mv/MaterializedViewUtils.java index f094898c372..04e27d0e83b 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/rules/exploration/mv/MaterializedViewUtils.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/rules/exploration/mv/MaterializedViewUtils.java @@ -374,11 +374,11 @@ public class MaterializedViewUtils { } else if ((joinType.isLeftJoin() || joinType.isLefSemiJoin() || 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)); diff --git a/fe/fe-core/src/test/java/org/apache/doris/nereids/rules/exploration/mv/MaterializedViewUtilsTest.java b/fe/fe-core/src/test/java/org/apache/doris/nereids/rules/exploration/mv/MaterializedViewUtilsTest.java index 2c8b1e1466b..f7ea121ec62 100644 --- a/fe/fe-core/src/test/java/org/apache/doris/nereids/rules/exploration/mv/MaterializedViewUtilsTest.java +++ b/fe/fe-core/src/test/java/org/apache/doris/nereids/rules/exploration/mv/MaterializedViewUtilsTest.java @@ -421,6 +421,26 @@ public class MaterializedViewUtilsTest extends TestWithFeService { }); } + // 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) --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org