ClickHouse / ClickHouse/clickhouse-cpp

Bug in MAX Function with MergeTree Engine

オープン
#403 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る
bug need-info
主要言語
C
スター
382
フォーク
209
平均マージ
1日 22時間
マージ済み PR(30日)
13

説明

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 のシーケンスを実行し、繰り返し得られる結果を期待値と比較します。NaN 関連の値に対する MergeTree のパーティションパスと MAX/MIN の処理を追跡します。繰り返し実行したクエリが一貫して 766544500 を返し、回帰テストが再現をカバーすれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
sql
領域
databases
issue の種類
バグ
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
明確に書かれている
初心者へのやさしさ
35/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。