Skip to content

Regression since 45.0.0: select count(), count(*) does not work #14855

@alamb

Description

@alamb

Describe the bug

@jonahgao noticed this in #14824

This query works in DataFusion 44 and 45:

select count(), count(*);

However, it does not work on main (what would become DataFusion 46)

DataFusion CLI v45.0.0
> select count(), count(*);
Error during planning: Projections require unique expression names but the expression "count(*)" at position 0 and "count(*)" at position 1 have the same name. Consider aliasing ("AS") one of them.
>

To Reproduce

No response

Expected behavior

The query should produce the same results as in datafusion 44 and 45

andrewlamb@Andrews-MacBook-Pro-2:~/Software/datafusion$ ~/Downloads/datafusion-cli-44
DataFusion CLI v44.0.0
> select count(), count(*);
+---------+----------+
| count() | count(*) |
+---------+----------+
| 1       | 1        |
+---------+----------+
1 row(s) fetched.
Elapsed 0.013 seconds.

>
\q
andrewlamb@Andrews-MacBook-Pro-2:~/Software/datafusion$ ~/Downloads/datafusion-cli-45
DataFusion CLI v45.0.0
> select count(), count(*);
+---------+----------+
| count() | count(*) |
+---------+----------+
| 1       | 1        |
+---------+----------+
1 row(s) fetched.
Elapsed 0.013 seconds.

Additional context

It is likely this was introduced by

There is more discussion on

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingregressionSomething that used to work no longer does

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions