Skip to content

UNION ALL not correctly projects the floating numbers #10688

Closed as not planned
Closed as not planned
@comphead

Description

@comphead

there is some issue with UNION ALL and type derivation

> select avg(a) from (select -128.2::float a union all select 32768.3 union all select 27.3);
+--------------------+
| AVG(a)             |
+--------------------+
| 10889.133334350587 |
+--------------------+
1 row(s) fetched. 
Elapsed 0.011 seconds.

> select avg(a) from (select -128.2::float a union all select 32768.3::float union all select 27.3::float);
+-------------------+
| AVG(a)            |
+-------------------+
| 10889.13359451294 |
+-------------------+
1 row(s) fetched. 
Elapsed 0.011 seconds.

I expect those numbers to be the same. And that what duck db does

Originally posted by @comphead in #10634 (review)

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions