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

adonisling pushed a commit to branch branch-1.1-lts
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/branch-1.1-lts by this push:
     new 3123113b71 [fix](fe)predicate is wrongly pushed through CUBE function 
(#16150) (#21364)
3123113b71 is described below

commit 3123113b7158160c35946393b75d52e7bfa7532f
Author: Adonis Ling <adonis0...@gmail.com>
AuthorDate: Fri Jun 30 14:03:37 2023 +0800

    [fix](fe)predicate is wrongly pushed through CUBE function (#16150) (#21364)
    
    pick from master #15831
    
    Co-authored-by: starocean999 
<40539150+starocean...@users.noreply.github.com>
---
 .../src/main/java/org/apache/doris/planner/SingleNodePlanner.java | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/planner/SingleNodePlanner.java 
b/fe/fe-core/src/main/java/org/apache/doris/planner/SingleNodePlanner.java
index 153bf6ce9d..141903831d 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/planner/SingleNodePlanner.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/planner/SingleNodePlanner.java
@@ -2443,8 +2443,9 @@ public class SingleNodePlanner {
                     //eg: select distinct c from ( select distinct c from 
table) t where c > 1;
                     continue;
                 }
-                if (stmt.getGroupByClause().isGroupByExtension()
-                        && 
stmt.getGroupByClause().getGroupingExprs().contains(sourceExpr)) {
+                if (sourceExpr.getFn() instanceof AggregateFunction) {
+                    isAllSlotReferToGroupBys = false;
+                } else if (stmt.getGroupByClause().isGroupByExtension()) {
                     // if grouping type is CUBE or ROLLUP will definitely 
produce null
                     if (stmt.getGroupByClause().getGroupingType() == 
GroupByClause.GroupingType.CUBE
                             || stmt.getGroupByClause().getGroupingType() == 
GroupByClause.GroupingType.ROLLUP) {
@@ -2460,9 +2461,6 @@ public class SingleNodePlanner {
                         }
                     }
                 }
-                if (sourceExpr.getFn() instanceof AggregateFunction) {
-                    isAllSlotReferToGroupBys = false;
-                }
             }
 
             if (isAllSlotReferToGroupBys) {


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to