apache / apache/iotdb

Improve GROUP BY TIME when endtime - starttime < interval

Open
#2,600 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
6.4k
Forks
1.2k
Avg merge
1d 23h
Merged PRs (30d)
115

Description

When use GROUP BY TIME if endtime - starttime < interval currently the row result is rounding down, showing 1 row less.

now
(endtime - starttime) / interval = 5.3 -> 5 rows, currently we will show 5 rows of result. it rounds down

want
(endtime - starttime) / interval = 5.3 -> 6 rows, show 6 rows of result. it rounds up.

e.g., select avg(*) from root group by ( [now() -1h, now()), 7200s) will return 1 row

Contributor guide

Open the contributing guide

Research direction

Search the repository for the GROUP BY TIME implementation and its query or aggregation tests, then reproduce the interval case from the issue: a one-hour range grouped by 7200s. Done means the 5.3-interval case produces 6 rows rather than rounding down to 5, with a regression test covering the behavior.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.