[ 
https://issues.apache.org/jira/browse/IMPALA-11612?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17610023#comment-17610023
 ] 

jhkcool edited comment on IMPALA-11612 at 9/29/22 7:01 AM:
-----------------------------------------------------------

-I submitted a PR to solve this problem:
https://github.com/apache/impala/pull/35/commits/6b78b113cf050b2a471a75d622bf4eda42bdecb4-


was (Author: jhkcool):
I submitted a PR to solve this problem:
https://github.com/apache/impala/pull/35/commits/6b78b113cf050b2a471a75d622bf4eda42bdecb4

> ORDER BY expression not produced by aggregation output
> ------------------------------------------------------
>
>                 Key: IMPALA-11612
>                 URL: https://issues.apache.org/jira/browse/IMPALA-11612
>             Project: IMPALA
>          Issue Type: Bug
>          Components: Frontend
>    Affects Versions: Impala 4.1.0
>            Reporter: jhkcool
>            Assignee: jhkcool
>            Priority: Major
>          Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> Create execute plan failed : org.apache.impala.common.AnalysisException: 
> ORDER BY expression not produced by aggregation output (missing from GROUP BY 
> clause?): (CASE WHEN (to_date(CAST(t1.dt AS TIMESTAMP)) = TIMESTAMP 
> '2022-05-12 00:00:00') THEN '2022-05-12' WHEN (to_date(CAST(t1.dt AS 
> TIMESTAMP)) = TIMESTAMP '2022-05-13 00:00:00') THEN '2022-05-13' END) at 
> org.apache.impala.analysis.SelectStmt$SelectAnalyzer.verifyAggregation(SelectStmt.java:1090)
>  at 
> org.apache.impala.analysis.SelectStmt$SelectAnalyzer.analyze(SelectStmt.java:312)
>  at 
> org.apache.impala.analysis.SelectStmt$SelectAnalyzer.access$100(SelectStmt.java:276)
>  at org.apache.impala.analysis.SelectStmt.analyze(SelectStmt.java:269) at 
> org.apache.impala.analysis.AnalysisContext.reAnalyze(AnalysisContext.java:611)
>  at 
> org.apache.impala.analysis.AnalysisContext.analyze(AnalysisContext.java:585) 
> at 
> org.apache.impala.analysis.AnalysisContext.analyzeAndAuthorize(AnalysisContext.java:468)
>  at 
> org.apache.impala.service.Frontend.doCreateExecRequest(Frontend.java:2084) at 
> org.apache.impala.service.Frontend.getTExecRequest(Frontend.java:1967) at 
> org.apache.impala.service.Frontend.createExecRequest(Frontend.java:1791) at 
> org.apache.impala.service.Frontend$4.run(Frontend.java:2867) at 
> org.apache.impala.service.Frontend$4.run(Frontend.java:2863) at 
> java.security.AccessController.doPrivileged(Native Method) at 
> javax.security.auth.Subject.doAs(Subject.java:360) at 
> org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1864)
>  at 
> org.apache.impala.service.Frontend.createExecRequestWithProxy(Frontend.java:2863)
>  at 
> org.apache.impala.service.JniFrontend.createExecRequest(JniFrontend.java:208)
> query_option:
> ENABLE_EXPR_REWRITES : true
> while execute query sql:
> {noformat}
> SELECT (CASE WHEN (1 = 1 AND `t1`.`dt` = '2022-05-13') THEN '2022-05-13' END) 
> d0
> FROM `jhk_test`.`p1` `t1`
> GROUP BY (CASE WHEN (1 = 1 AND `t1`.`dt` = '2022-05-13') THEN '2022-05-13' 
> END)
> ORDER BY (CASE WHEN (1 = 1 AND `t1`.`dt` = '2022-05-13') THEN '2022-05-13' 
> END)
> limit 10
> {noformat}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

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

Reply via email to