You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by GitBox <gi...@apache.org> on 2022/06/14 07:24:30 UTC

[GitHub] [incubator-doris] spaces-X opened a new issue, #10120: [Bug] deep checks agg-function exprs are needed in SelectStmt analyze with groupingsets

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: commits-unsubscribe@doris.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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