This is an automated email from the ASF dual-hosted git repository. yiguolei pushed a commit to branch branch-2.1 in repository https://gitbox.apache.org/repos/asf/doris.git
commit a391cf6bfe6281bb44ee301e399bed7990aa304a Author: morrySnow <[email protected]> AuthorDate: Mon Apr 29 19:33:48 2024 +0800 [fix](Nereids) rewritten mv should check output set and should not return null (#34288) 1. we should check output set, since we will remove top project and result output size will diff with its child output size if there are dup slot in result list 2. should not return null, instead we should return rewritten plan itself, because we will use return result in many place and do not check null at all --- .../doris/nereids/rules/exploration/mv/MaterializedViewUtils.java | 5 ++--- 1 file changed, 2 insertions(+), 3 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 73029b4ec14..0fbcf6b7d63 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 @@ -204,9 +204,8 @@ public class MaterializedViewUtils { CascadesContext cascadesContext, Function<CascadesContext, Plan> planRewriter, Plan rewrittenPlan, Plan originPlan) { - List<Slot> originOutputs = originPlan.getOutput(); - if (originOutputs.size() != rewrittenPlan.getOutput().size()) { - return null; + if (originPlan.getOutputSet().size() != rewrittenPlan.getOutputSet().size()) { + return rewrittenPlan; } // After RBO, slot order may change, so need originSlotToRewrittenExprId which record // origin plan slot order --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
