morrySnow opened a new pull request, #26222:
URL: https://github.com/apache/doris/pull/26222

   cherry-pick from master
   PR: #25938 
   commit id: 2229d82acd895ab968f707b851f47c67d9a820ae
   
   we put bound expr into unbound group by list by mistake. This will lead to 
bind twice on some exprssion.
   Since binding is not idempotent, below exception will be thrown for sql
   
   ```sql
   select k5 / k5 as nu, sum(k1) from test group by nu order by nu nulls first
   ```
   
   ```
   Caused by: org.apache.doris.nereids.exceptions.AnalysisException: Input 
slot(s) not in child's output: k5#5 in plan: LogicalProject[176] ( 
distinct=false, projects=[(cast(k5#5 as DECIMALV3(16, 10)) / k5#5) AS `nu`#14, 
sum(k1)#15], excepts=[] ), child output is: [nu#16, sum(k1)#15]
   plan tree:
   LogicalProject[176] ( distinct=false, projects=[(cast(k5#5 as DECIMALV3(16, 
10)) / k5#5) AS `nu`#14, sum(k1)#15], excepts=[] )
   +--LogicalAggregate[168] ( groupByExpr=[nu#16], outputExpr=[nu#16, sum(k1#1) 
AS `sum(k1)`#15], hasRepeat=false )
      +--LogicalProject[156] ( distinct=false, projects=[k1#1, (cast(k5#5 as 
DECIMALV3(16, 10)) / k5#5) AS `nu`#16], excepts=[] )
         +--LogicalOlapScan ( 
qualified=default_cluster:regression_test_nereids_syntax_p0.test, 
indexName=test, selectedIndexId=503229, preAgg=OFF, Aggregate function sum(k1) 
contains key column k1. )
       at 
org.apache.doris.nereids.rules.analysis.CheckAfterRewrite.checkAllSlotReferenceFromChildren(CheckAfterRewrite.java:108)
 ~[classes/:?]
   ```
   
   ## Proposed changes
   
   Issue Number: close #xxx
   
   <!--Describe your changes.-->
   
   ## Further comments
   
   If this is a relatively large or complex change, kick off the discussion at 
[[email protected]](mailto:[email protected]) by explaining why you 
chose the solution you did and what alternatives you considered, etc...
   
   


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