Details
-
Bug
-
Status: Open
-
Major
-
Resolution: Unresolved
-
1.5.0
-
None
Description
The following queries give different results, although they are similar:
SELECT position_id, COUNT(*) OVER w AS `count` FROM (SELECT position_id FROM `/b1p2tbl` ORDER BY employee_id, sub) WINDOW w AS (PARTITION BY position_id); +--------------+--------+ | position_id | count | +--------------+--------+ | 1 | 10 | | 1 | 10 | | 1 | 10 | | 1 | 10 | | 1 | 10 | | 1 | 10 | | 1 | 10 | | 1 | 10 | | 1 | 10 | | 1 | 10 | | 2 | 10 | | 2 | 10 | | 2 | 10 | | 2 | 10 | | 2 | 10 | | 2 | 10 | | 2 | 10 | | 2 | 10 | | 2 | 10 | | 2 | 10 | +--------------+--------+
SELECT position_id, COUNT(*) OVER w AS `count` FROM (SELECT * FROM dfs.data.`b1p2tbl` ORDER BY employee_id, sub) WINDOW w AS (PARTITION BY position_id); +--------------+--------+ | position_id | count | +--------------+--------+ | 1 | 20 | | 1 | 20 | | 1 | 20 | | 1 | 20 | | 1 | 20 | | 1 | 20 | | 1 | 20 | | 1 | 20 | | 1 | 20 | | 1 | 20 | | 2 | 20 | | 2 | 20 | | 2 | 20 | | 2 | 20 | | 2 | 20 | | 2 | 20 | | 2 | 20 | | 2 | 20 | | 2 | 20 | | 2 | 20 | +--------------+--------+
the results of the second query are incorrect.