ClickHouse / ClickHouse/clickhouse-cpp
Bug in MAX Function with MergeTree Engine
- 主要语言
- C
- 星标
- 382
- 派生
- 209
- 平均合并
- 2 天 19 小时
- 30 天内合并 PR
- 14
描述
Dear CK Team, I have a bug that I need to report to you.
Description:
While using the MAX/MIN function on a column with MergeTree table engine, the query produces inconsistent results. Specifically, this bug is triggered when a specific partition key is selected and the corresponding column contains NaN values
Steps to Reproduce:
```
CREATE TABLE t1 (c0 Int32)
ENGINE = MergeTree()
ORDER BY c0
PARTITION BY (toUInt64 (c0))
INSERT INTO t1 (c0)
VALUES (-766544500), (2052205600), (2064494500), (824848640), (0)
SELECT MAX(-(c0/c0/c0+c0))
FROM t1
```
Expected Behavior:
The result should be consistent and return the unique positive value 766544500.
Actual Behavior:
Different values are returned across multiple queries, including all values in c0 execpt NaN ( -766544500, 2052205600, 2064494500, 824848640, 0).
Environment
OS:Ubuntu Server 22.04 LTS 64bit
TDengine Version:24.5.1.1010 (official build)
贡献指南
这个仓库没有索引到贡献指南
调研方向
首先,在指定环境中运行所提供的 CREATE TABLE、INSERT 和 SELECT 序列,并将重复结果与预期值进行比较。跟踪 MergeTree 分区路径以及对 NaN 相关值的 MAX/MIN 处理;当重复查询始终返回 766544500,且回归测试覆盖该复现时,即表示完成。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- sql
- 领域
- databases
- Issue 类型
- 缺陷
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 活跃度
- 停滞
- 描述清晰度
- 描述清楚
- 新手友好度
- 35/100