spaces-X opened a new issue, #10120:
URL: https://github.com/apache/incubator-doris/issues/10120

   ### Search before asking
   
   - [X] I had searched in the 
[issues](https://github.com/apache/incubator-doris/issues?q=is%3Aissue) and 
found no similar issues.
   
   
   ### Version
   
   dev 1.0 or older version
   
   
   ### What's Wrong?
   
   ```
   select a,b, sum(c) from table  group by grouping sets((a,b),(a,b,c))
   ```
   
   This sql will fail in the analyze period cause `column c` could not be both 
in the agg function and the grouping sets.
   
   However if i change the sql like the followings, the sql will pass the 
analyze.
   ```
   select a,b, if (c !=null, sum(c), null) from table grouping 
sets((a,b),(a,b,c))
   ```
   
   ### What You Expected?
   
   Deep checks of function exprs in selectStmt are needed to ensure that the 
colomns in the gouping set should not in the agg function.
   
   In this case the following sql will fail in analyze.
   
   ```
   select a,b, if (c !=null, sum(c), null) from table grouping 
sets((a,b),(a,b,c))
   ```
   
   ### How to Reproduce?
   
   sql like this.
   
   ```
   select a,b, if (c !=null, sum(c), null) from table grouping 
sets((a,b),(a,b,c))
   ```
   
   
   ### Anything Else?
   
   No 
   
   ### Are you willing to submit PR?
   
   - [X] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [X] I agree to follow this project's [Code of 
Conduct](https://www.apache.org/foundation/policies/conduct)
   


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