Skip to content

Potential bug in bool_and() aggregate function #11846

@2010YOUY01

Description

@2010YOUY01

Describe the bug

The last query in reproducer should return true

Run in datafusion-cli:

DataFusion CLI v40.0.0
> create table t1(v1 int, v2 boolean);
0 row(s) fetched.
Elapsed 0.073 seconds.

> insert into t1 values (1, true), (1, true);
+-------+
| count |
+-------+
| 2     |
+-------+
1 row(s) fetched.
Elapsed 0.051 seconds.

> select bool_and(v2) from t1;
+-----------------+
| bool_and(t1.v2) |
+-----------------+
| true            |
+-----------------+
1 row(s) fetched.
Elapsed 0.016 seconds.

> select v1, bool_and(v2) from t1 group by v1;
+----+-----------------+
| v1 | bool_and(t1.v2) |
+----+-----------------+
| 1  | false           |
+----+-----------------+
1 row(s) fetched.
Elapsed 0.011 seconds.
dd

To Reproduce

No response

Expected behavior

No response

Additional context

No response

Metadata

Metadata

Assignees

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