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

Open
#17,409 1 comment 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
42/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Quiet
Domain
databases

Research direction

Start by reproducing the four GROUP BY LEVEL aggregation combinations described for IoTDB 2.0.7, using the screenshots to compare sum, avg, and count. The report does not name source files, tests, or provide executable SQL and sample data; done means the same input produces consistent aggregates across all combinations, with regression coverage added in the relevant query test area.

Written by the indexing model from the issue text.

Description

Search before asking
  • I searched in the 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!
Dominant language
Java
Stars
6.4k
Forks
1.2k
Avg merge
1d 12h
Merged PRs (30d)
284

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from apache/iotdb

All issues in apache/iotdb

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.