This is an automated email from the ASF dual-hosted git repository.
dataroaring pushed a commit to branch branch-3.0
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/branch-3.0 by this push:
new 0c695b94156 branch-3.0: [fix](mtmv) Fix partition track column fail
when 'select *' used in related partition side #43531 (#43940)
0c695b94156 is described below
commit 0c695b941562e8a99c603ecf2ded544d815a3c9b
Author: github-actions[bot]
<41898282+github-actions[bot]@users.noreply.github.com>
AuthorDate: Thu Nov 14 19:20:21 2024 +0800
branch-3.0: [fix](mtmv) Fix partition track column fail when 'select *'
used in related partition side #43531 (#43940)
Cherry-picked from #43531
Co-authored-by: seawinde <[email protected]>
---
.../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 2d483c45185..a659c2f9990 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
@@ -428,11 +428,11 @@ public class MaterializedViewUtils {
} 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));
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 ccc759dff3d..f824a40eda6 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: [email protected]
For additional commands, e-mail: [email protected]