yujun777 commented on code in PR #49774:
URL: https://github.com/apache/doris/pull/49774#discussion_r2086539775


##########
fe/fe-core/src/main/java/org/apache/doris/nereids/rules/expression/rules/ExtractCommonFactorRule.java:
##########
@@ -87,17 +88,16 @@ private static Expression 
extractCommonFactor(CompoundPredicate originExpr) {
 
         // combine and delete some boolean literal predicate
         // e.g. (a and true) -> true
-        Expression simplified = 
ExpressionUtils.combineAsLeftDeepTree(originExpr.getClass(), flatten);
+        Expression simplified = ExpressionUtils.compound(originExpr instanceof 
And, flatten);
         if (!(simplified instanceof CompoundPredicate)) {
             return simplified;
         }
 
         // separate two levels CompoundPredicate to partitions
         // e.g. ((a and (b or c)) and c) -> [[a], [b, c], c]
-        CompoundPredicate leftDeapTree = (CompoundPredicate) simplified;
         ImmutableSet.Builder<List<Expression>> partitionsBuilder
-                = ImmutableSet.builderWithExpectedSize(flatten.size());
-        for (Expression onPartition : ExpressionUtils.extract(leftDeapTree)) {
+                = 
ImmutableSet.builderWithExpectedSize(simplified.children().size());

Review Comment:
   the old coding mix with left deap tree,    the simplified is a flatten plan, 
 its children is just equals ExpressionUtils.extract(leftDeapTree), 



-- 
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