Bug in MAX Function with MergeTree Engine

未關閉
#403 2 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

維護者通常 1 天內回覆

還沒有人認領這個 Issue。

評估

難度
4/5
預估耗時
3-5 天
新手友好度
35/100
Issue 類型
缺陷
描述清晰度
描述清楚
活躍度
停滯
技術堆疊
sql
領域
databases

研究方向

首先,在指定環境中執行所提供的 CREATE TABLE、INSERT 和 SELECT 序列,並將重複結果與預期值進行比較。追蹤 MergeTree 分割區路徑,以及對 NaN 相關值的 MAX/MIN 處理;當重複查詢一律回傳 766544500,且回歸測試涵蓋此重現時,即表示完成。

由索引模型根據 Issue 內容生成。

描述

bug environment needs-info

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)

主要語言
C
星號
388
分支
220
平均合併
1 天 25 分鐘
30 天內合併 PR
16

環境準備

這個專案沒有提供開發容器、Dockerfile 或貢獻指南,環境需要你自己搭建:先看它的 README,通用步驟見我們的新手貢獻指南。

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

ClickHouse/clickhouse-cpp 的其他 Issue

查看 ClickHouse/clickhouse-cpp 的全部 Issue

相似的 Issue

更多 C Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。