ClickHouse / ClickHouse/ClickHouse

GROUP BY const(0./-0.) differ from materialized columns

Open
#103,027 1 comment 0 reactions 0 assignees View on GitHub
comp-aggregation external potential bug
Dominant language
C++
Stars
49.9k
Forks
9k
Avg merge
21h 32m
Merged PRs (30d)
515

Description

### Company or project name

_No response_

### Describe what's wrong

```
SELECT float
FROM
(
SELECT -0. AS float
UNION ALL
SELECT 0.
)
GROUP BY float

┌─float─┐
1. │ -0 │
└───────┘

SELECT float
FROM
(
SELECT materialize(-0.) AS float
UNION ALL
SELECT materialize(0.)
)
GROUP BY float

┌─float─┐
1. │ 0 │
2. │ -0 │
└───────┘

SELECT float
FROM
(
SELECT 0. AS float
UNION ALL
SELECT -0.
)
GROUP BY float

┌─float─┐
1. │ 0 │
└───────┘

```

### Does it reproduce on the most recent release?

Yes

### How to reproduce

https://fiddle.clickhouse.com/bf6f293b-c170-4bb9-99ec-2caa89b6802b

### Expected behavior

_No response_

### Error message and/or stacktrace

_No response_

### Additional context

Related https://github.com/ClickHouse/ClickHouse/issues/50192

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.