This is an automated email from the ASF dual-hosted git repository. panxiaolei pushed a commit to branch branch-1.2-lts in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/branch-1.2-lts by this push: new d69c2cec26 [Bug](materialized-view) fix mv match failed when aggregate function not materialized (#18439) d69c2cec26 is described below commit d69c2cec265eff6ae178744eb947763aa3eb34dc Author: Pxl <pxl...@qq.com> AuthorDate: Thu Apr 6 18:45:07 2023 +0800 [Bug](materialized-view) fix mv match failed when aggregate function not materialized (#18439) --- .../java/org/apache/doris/planner/MaterializedViewSelector.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/fe/fe-core/src/main/java/org/apache/doris/planner/MaterializedViewSelector.java b/fe/fe-core/src/main/java/org/apache/doris/planner/MaterializedViewSelector.java index a3e7f2b0f8..94ce9e1b53 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/planner/MaterializedViewSelector.java +++ b/fe/fe-core/src/main/java/org/apache/doris/planner/MaterializedViewSelector.java @@ -43,6 +43,7 @@ import com.google.common.collect.Sets; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; +import java.util.ArrayList; import java.util.Collection; import java.util.Iterator; import java.util.List; @@ -455,6 +456,14 @@ public class MaterializedViewSelector { aggExpr.getTableIdToColumnNames(tableIdToAggColumnNames); // count(*): tableIdToAggColumnNames is empty which must forbidden the SPJG MV. // TODO(ml): support count(*) + List<SlotRef> slots = new ArrayList<>(); + aggExpr.collect(SlotRef.class, slots); + if (!slots.isEmpty()) { + SlotDescriptor desc = ((SlotRef) slots.get(0)).getDesc(); + if (desc != null && !desc.isMaterialized()) { + continue; + } + } if (tableIdToAggColumnNames.size() != 1) { reasonOfDisable = "aggExpr[" + aggExpr.debugString() + "] should involved only one column"; disableSPJGView = true; --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org