Skip to content

regr_count should return an int #11726

@Michael-J-Ward

Description

@Michael-J-Ward

Describe the bug

regr_count currently returns a Float64.

To Reproduce

DataFusion CLI v40.0.0
> select regr_count(1, 1);
+-------------------------------+
| regr_count(Int64(1),Int64(1)) |
+-------------------------------+
| 1.0                           |
+-------------------------------+
1 row(s) fetched. 
Elapsed 0.011 seconds.

> select arrow_typeof(regr_count(1, 1));
+---------------------------------------------+
| arrow_typeof(regr_count(Int64(1),Int64(1))) |
+---------------------------------------------+
| Float64                                     |
+---------------------------------------------+
1 row(s) fetched. 
Elapsed 0.001 seconds.

Expected behavior

Consistent with postgres, it should return Int64 or Uint64

https://www.postgresql.org/docs/9.4/functions-aggregate.html

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions