Skip to content

[BUG] row_number and group by have inconsistent partition results for (0.0, -0.0) #5225

@xinyiZzz

Description

@xinyiZzz

Describe the bug
row_number and group by have inconsistent partition results for (0.0, -0.0)

To Reproduce
A.k1 contains -0.0 and 0.0
The result of select k1, count(1) from A group by k1 is as follows.
+------+----------+
| k1 | count(1) |
+------+----------+
| 0 | 2 |
| -0 | 1 |
+------+----------+
The result of select k1, row_number() over (partition by k1 order by k2) as t from A is as follows.
+------+------+
| k1 | t |
+------+------+
| 0 | 1 |
| 0 | 2 |
| -0 | 3 |
+------+------+

Expected behavior
We hope to unify the partition results of group by and row_number

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/fixCategorizes issue or PR as related to a bug.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions