[
https://issues.apache.org/jira/browse/DRILL-3595?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14652903#comment-14652903
]
Khurram Faraaz commented on DRILL-3595:
---------------------------------------
Agreed that using LIMIT clause does not guarantee that the final results
returned are in a deterministic order, unless we use a global order by.
> Wrong results returned by query that uses LEAD window function
> --------------------------------------------------------------
>
> Key: DRILL-3595
> URL: https://issues.apache.org/jira/browse/DRILL-3595
> Project: Apache Drill
> Issue Type: Bug
> Components: Execution - Codegen, Execution - Flow
> Affects Versions: 1.2.0
> Environment: private-branch-new-window-funcs
> Reporter: Khurram Faraaz
> Assignee: Deneche A. Hakim
> Labels: window_function
> Fix For: 1.2.0
>
> Attachments: union_01.parquet
>
>
> Query that uses LEAD window function returns wrong results on developer's
> private branch (new-window-funcs).
> Results returned by Drill
> {code}
> 0: jdbc:drill:schema=dfs.tmp> select lead(c1) over w from union_01 window w
> as (partition by c3 order by c1) limit 10;
> +---------+
> | EXPR$0 |
> +---------+
> | 878 |
> | -150 |
> | 402 |
> | 402 |
> | 402 |
> | 402 |
> | 402 |
> | 160 |
> | 160 |
> | 160 |
> +---------+
> 10 rows selected (0.349 seconds)
> {code}
> Results returned by Postgres
> {code}
> postgres=# select lead(c1) over w from union_01 window w as (partition by c3
> order by c1) limit 10;
> lead
> ------
>
>
> 402
> 402
> 402
> 402
> 402
>
> 160
> 160
> (10 rows)
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)