Abhishek Girish created DRILL-3358:
--------------------------------------
Summary: CUME_DIST window function provides wrong result when only
ORDER BY clause is specified
Key: DRILL-3358
URL: https://issues.apache.org/jira/browse/DRILL-3358
Project: Apache Drill
Issue Type: Bug
Components: Query Planning & Optimization
Affects Versions: 1.1.0
Reporter: Abhishek Girish
Assignee: Deneche A. Hakim
*Drill:*
{code:sql}
> SELECT CUME_DIST() OVER (ORDER BY ss.ss_store_sk) FROM store_sales ss ORDER
> BY 1 LIMIT 20;
+---------------------+
| EXPR$0 |
+---------------------+
| 0.9923989432198661 |
| 0.9923989432198661 |
| 0.9923989432198661 |
| 0.9923989432198661 |
| 0.9923989432198661 |
| 0.9923989432198661 |
| 0.9923989432198661 |
| 0.9923989432198661 |
| 0.9923989432198661 |
| 0.9923989432198661 |
| 0.9923989432198661 |
| 0.9923989432198661 |
| 0.9923989432198661 |
| 0.9923989432198661 |
| 0.9923989432198661 |
| 0.9923989432198661 |
| 0.9923989432198661 |
| 0.9923989432198661 |
| 0.9923989432198661 |
| 0.9923989432198661 |
+---------------------+
20 rows selected (17.317 seconds)
{code}
*Postgres*
{code:sql}
# SELECT CUME_DIST() OVER (ORDER BY ss.ss_store_sk) FROM store_sales ss ORDER
BY 1 LIMIT 20;
cume_dist
-------------------
0.158622193275665
0.158622193275665
0.158622193275665
0.158622193275665
0.158622193275665
0.158622193275665
0.158622193275665
0.158622193275665
0.158622193275665
0.158622193275665
0.158622193275665
0.158622193275665
0.158622193275665
0.158622193275665
0.158622193275665
0.158622193275665
0.158622193275665
0.158622193275665
0.158622193275665
0.158622193275665
(20 rows)
{code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)