apache / apache/iotdb

[Bug] 使用 GROUP BY LEVEL 搭配多個聚合函數時,結果出現不一致(sum / avg / count 異常)

Aperta
#17,409 1 commento 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
Java
Stelle
6.4k
Fork
1.2k
Merge medio
1g 23h
PR unite (30g)
115

Descrizione

### Search before asking

- [x] I searched in the [issues](https://github.com/apache/iotdb/issues) and found nothing similar.

### Version

2.0.7

### Describe the bug and provide the minimal reproduce step

在 IoTDB 中使用 GROUP BY LEVEL 查詢時,當同時使用多個聚合函數(如 sum、avg、count)會出現結果不一致的情況。

具體問題如下:

- sum(cpu) 單獨查詢與搭配其他 aggregation 時,結果不同
- avg(cpu) 與 count(cpu) 的結果也會異常變化
- 同一筆資料在不同 aggregation 組合下,計算基準似乎不一致

### Query 1: 僅查 sum(結果正常)
Image

### Query 2: sum + avg(sum 變成 2 倍)
Image

### Query 3: sum + avg + count(全部異常)
Image

### Query 4: sum + count(結果又正常)
Image

### What did you expect to see?

- 不論 aggregation function 組合如何:
- sum(cpu) 應該一致
- count(cpu) 應該一致
- avg(cpu) 應滿足:
👉 avg = sum / count
- 多個 aggregation 應基於同一批資料計算

### What did you see instead?

Image

### Anything else?

_No response_

### Are you willing to submit a PR?

- [ ] I'm willing to submit a PR!

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Inizia riproducendo le quattro combinazioni di aggregazione GROUP BY LEVEL descritte per IoTDB 2.0.7, usando gli screenshot per confrontare sum, avg e count. Il report non indica file sorgente né test e non fornisce SQL eseguibile né dati di esempio; il lavoro è completato quando lo stesso input produce aggregati coerenti per tutte le combinazioni e viene aggiunta la copertura di regressione nell’area rilevante dei test delle query.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Ambito
databases
Tipo di issue
Bug
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Tranquilla
Chiarezza
Da chiarire
Idoneità per principianti
42/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.