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

Aihua Xu commented on HIVE-12881:
---------------------------------

Seems we intentionally interprets a windowing spec with no start and end for 
ORDER BY as UNBOUNDED PRECEDING and CURRENT ROW and match at least SQL Server 
and Oracle. Not an issue.

> Count() function over partitions doesn't work properly with ORDER BY 
> ---------------------------------------------------------------------
>
>                 Key: HIVE-12881
>                 URL: https://issues.apache.org/jira/browse/HIVE-12881
>             Project: Hive
>          Issue Type: Bug
>          Components: PTF-Windowing
>    Affects Versions: 2.1.0
>            Reporter: Aihua Xu
>            Assignee: Aihua Xu
>
> The following query doesn't seem to return the correct result.
> {noformat}
> create table test (empno string, deptno string, level string, manager string);
> insert into test values ('1', '2', 'B', 'Else'); 
> insert into test values ('1', '2', 'B', 'Else');
> insert into test values ('2', '2', 'B', 'Other');
> select  count( manager) over (partition by deptno, level order by manager) 
> from test; 
> {noformat}
> It  returns 
> {noformat}
> 2
> 2
> 3
> {noformat}
> Without ORDER BY, it returns correct result
> {noformat}
> 3
> 3
> 3
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to