You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues-all@impala.apache.org by "N Campbell (Jira)" <ji...@apache.org> on 2019/09/10 11:26:00 UTC

[jira] [Commented] (IMPALA-5098) Correct handling of DISTINCT in the select list

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

N Campbell commented on IMPALA-5098:
------------------------------------

Any plans for 3.x to be enhanced?

i.e. using 3.1


select distinct 
 sum ( cx ) over ( partition by c1 ) 
from (
 select c1, c2, sum ( c3 ) cx
 from CERT.TOLAP
 group by c1, c2 
) T1 

Error: [Cloudera][ImpalaJDBCDriver](500051) ERROR processing query/statement. Error Code: 0, SQL state: TStatus(statusCode:ERROR_STATUS, sqlState:HY000, errorMessage:AnalysisException: cannot combine SELECT DISTINCT with analytic functions
), Query: select distinct 
 sum ( cx ) over ( partition by c1 ) 
from (
 select c1, c2, sum ( c3 ) cx
 from CERT.TOLAP
 group by c1, c2 
) T1.
SQLState: HY000
ErrorCode: 500051

vs


select distinct *
from ( select 
 sum ( cx ) over ( partition by c1 ) 
 from ( select c1, c2, sum ( c3 ) cx
 from CERT.TOLAP
 group by c1, c2 
 ) T1 
) T2

> Correct handling of DISTINCT in the select list
> -----------------------------------------------
>
>                 Key: IMPALA-5098
>                 URL: https://issues.apache.org/jira/browse/IMPALA-5098
>             Project: IMPALA
>          Issue Type: Bug
>          Components: Frontend
>    Affects Versions: Impala 2.6.0
>            Reporter: N Campbell
>            Priority: Major
>              Labels: ansi-sql, sql-language
>
> DB2, ORACLE and various other systems will support the following statement but Impala will not
> {noformat}
> [Simba][ImpalaJDBCDriver](500051) ERROR processing query/statement. Error Code: 0, 
> SQL state: TStatus(statusCode:ERROR_STATUS, sqlState:HY000,
> errorMessage:AnalysisException: cannot combine SELECT DISTINCT with analytic functions
> ), Query: SELECT DISTINCT 
>     `sno` AS `c1`, 
>     `pno` AS `c2`, 
>     SUM(`qty`)
>         OVER(
>         ) AS `c3`
> FROM
>     `cert`.`tsupply` 
> ORDER BY 
>     `sno` ASC NULLS LAST, 
>     `pno` ASC NULLS LAST.
> {noformat}



--
This message was sent by Atlassian Jira
(v8.3.2#803003)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-all-unsubscribe@impala.apache.org
For additional commands, e-mail: issues-all-help@impala.apache.org