apache / apache/iotdb

[Bug] Support group by natural year

Open
#11,133 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
6.4k
Forks
1.2k
Avg merge
1d 23h
Merged PRs (30d)
115

Description

Search before asking
  • I searched in the issues and found nothing similar.
Version

操作系统:CentOS 7.9
IoTDB:1.12

Describe the bug and provide the minimal reproduce step

36b286f9031b417a41072392cbcdba0
使用iotdb的分段分组聚合,指定聚合窗口大小和步长为1y,发现聚合结果步长是固定的365天,这并没有考虑到闰年为366天的事实。
我查询了基于月是可以实现每28|29|30|31天作为自然月来分组的
image
这应当是一个错误,请尽快解决一下

What did you expect to see?

期望的查询结果应是
+-----------------------------+----+----+-------+------+
| Time| pv|load|selfuse|charge|
+-----------------------------+----+----+-------+------+
|2023-01-01T00:00:00.000+08:00| 39| 3| 0| 35|
|2024-01-01T00:00:00.000+08:00|null|null| null| null|
|2025-01-01T00:00:00.000+08:00|null|null| null| null|
|2026-01-01T00:00:00.000+08:00|null|null| null| null|
+-----------------------------+----+----+-------+------+

What did you see instead?

实际的查询结果是
+-----------------------------+----+----+-------+------+
| Time| pv|load|selfuse|charge|
+-----------------------------+----+----+-------+------+
|2023-01-01T00:00:00.000+08:00| 39| 3| 0| 35|
|2024-01-01T00:00:00.000+08:00|null|null| null| null|
|2024-12-31T00:00:00.000+08:00|null|null| null| null|
|2025-12-31T00:00:00.000+08:00|null|null| null| null|
+-----------------------------+----+----+-------+------+

Anything else?

No response

Are you willing to submit a PR?
  • I'm willing to submit a PR!

Contributor guide

Open the contributing guide

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.

Research direction

Start with the minimal reproduction and the expected and actual query results described in this issue, focusing on the time-window grouping behavior for a 1y interval. The fix is done when yearly groups begin on successive calendar-year boundaries, including leap years, and the reproduced output matches the expected timestamps.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
databases
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.