This is an automated email from the ASF dual-hosted git repository.

englefly pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/master by this push:
     new dc10c65a148 [opt](nereids)add comments for CompressedMaterialize and 
NormalizeAggregate order (#52238)
dc10c65a148 is described below

commit dc10c65a14835b6f93b6bf4bf8c2c0c2e549daa0
Author: minghong <[email protected]>
AuthorDate: Fri Jul 4 10:23:30 2025 +0800

    [opt](nereids)add comments for CompressedMaterialize and NormalizeAggregate 
order (#52238)
    
    ### What problem does this PR solve?
    add comments to explain why CompressedMaterialize rule should be applied 
before NormalizeAggregate
---
 .../java/org/apache/doris/nereids/jobs/executor/Analyzer.java | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/nereids/jobs/executor/Analyzer.java 
b/fe/fe-core/src/main/java/org/apache/doris/nereids/jobs/executor/Analyzer.java
index a63ac2fe2b8..c49b840c1b3 100644
--- 
a/fe/fe-core/src/main/java/org/apache/doris/nereids/jobs/executor/Analyzer.java
+++ 
b/fe/fe-core/src/main/java/org/apache/doris/nereids/jobs/executor/Analyzer.java
@@ -145,6 +145,17 @@ public class Analyzer extends AbstractBatchJobExecutor {
             // errCode = 2, detailMessage = GROUP BY expression must not 
contain aggregate functions: sum(lo_tax)
             bottomUp(new CheckAnalysis()),
             topDown(new SimplifyAggGroupBy()),
+            // compressedMaterialize should be applied before 
NormalizeAggregate, because the plan generated by
+            // compressedMaterialize also needs normalize. for example:
+            //    Agg(groupby=[A]
+            //        -->scan(T)
+            // after applying CompressedMaterialize plan transformed to
+            //   Agg(groupby=[encode(A)]
+            //       -->scan(T)
+            // encode(A) has to be pushed down
+            //    Agg(groupby=[x]
+            //       -->project(encode A as x)
+            //            -->scan(T)
             bottomUp(new CompressedMaterialize()),
             topDown(new NormalizeAggregate()),
             topDown(new HavingToFilter()),


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

Reply via email to