morrySnow commented on code in PR #56266:
URL: https://github.com/apache/doris/pull/56266#discussion_r2459691399


##########
fe/fe-core/src/main/java/org/apache/doris/nereids/rules/exploration/mv/HyperGraphComparator.java:
##########


Review Comment:
   add ut for this file



##########
fe/fe-core/src/main/java/org/apache/doris/nereids/util/ExpressionUtils.java:
##########
@@ -539,6 +539,26 @@ public static Set<Expression> replace(Set<Expression> 
exprs,
         return result.build();
     }
 
+    /**
+     * replaceNullAware, if could not be replaced by map, the return null
+     */
+    public static Expression replaceNullAware(Expression expr,
+            Map<? extends Expression, ? extends Expression> replaceMap) {

Review Comment:
   add ut



##########
fe/fe-core/src/main/java/org/apache/doris/nereids/rules/exploration/mv/AbstractMaterializedViewScanRule.java:
##########
@@ -83,4 +83,11 @@ protected boolean checkQueryPattern(StructInfo structInfo, 
CascadesContext casca
         return 
structInfo.getTopPlan().accept(StructInfo.SCAN_PLAN_PATTERN_CHECKER, 
checkContext)
                 && !checkContext.isContainsTopAggregate();
     }
+
+    @Override
+    protected boolean checkMaterializationPattern(StructInfo structInfo, 
CascadesContext cascadesContext) {
+        PlanCheckContext checkContext = 
PlanCheckContext.of(SUPPORTED_JOIN_TYPE_SET);
+        return structInfo.getTopPlan().accept(StructInfo.PLAN_PATTERN_CHECKER, 
checkContext)

Review Comment:
   add ut



##########
fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/visitor/ExpressionLineageReplacer.java:
##########
@@ -84,6 +84,13 @@ public static class ExpressionReplacer extends 
DefaultExpressionRewriter<Map<Exp
         public Expression visitNamedExpression(NamedExpression namedExpression,
                 Map<ExprId, Expression> exprIdExpressionMap) {
             Expression childExpr = 
exprIdExpressionMap.get(namedExpression.getExprId());
+            // avoid loop when non_nullable(o_orderkey#0) AS `o_orderkey`#0 
after join eliminate when
+            // inner join
+            if (childExpr != null && !childExpr.children().isEmpty()
+                    && childExpr.child(0) instanceof NamedExpression
+                    && ((NamedExpression) 
childExpr.child(0)).getExprId().equals(namedExpression.getExprId())) {
+                return namedExpression;
+            }

Review Comment:
   i think this need ut too



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to