CUME_DIST window function returns incorrect results #6827
Last updated: 2020-02-24 09:32:58 +0100
Date: 2020-02-20 15:48:36 +0100
The CUME_DIST() window function is returning incorrect results, even returning values above 1 (the return values should always be within 0 and 1).
How to reproduce:
create table employees (dep varchar(10), name varchar(20), salary double);
2 - Execute one of these queries, which give incorrect results:
SELECT dep, name, salary, CUME_DIST() OVER (partition by dep ORDER BY salary) cume_dist_val FROM employees;
SELECT dep, name, salary, CUME_DIST() OVER (PARTITION BY dep) cume_dist_val FROM employees;
The expected results would be values between 0 and 1, with each row's value being the number of rows with values lower or equal divided by the total number of rows in the window or partition.
Date: 2020-02-20 16:11:11 +0100
For complete details, see https//devmonetdborg/hg/MonetDB?cmd=changeset;node=176ea6bea667
The text was updated successfully, but these errors were encountered: