[Bug] Support inclusive end time syntax ] in GROUP BY clause IoTDB 2.0.5
还没有人认领这个 Issue。
评估
调研方向
首先定位 SQL GROUP BY 子句的入口点以及区间结束边界的处理方式。复现 issue 中的示例,然后验证是否接受闭合的 ],并确认时间戳恰好等于结束时间的数据会被包含,同时不改变现有的 [start, end) 行为。
由索引模型根据 Issue 内容生成。
描述
Search before asking
- I searched in the issues and found nothing similar.
Version
OS: Ubuntu 24.04 LTS
IoTDB: 2.0.5
Describe the bug and provide the minimal reproduce step
Currently, the GROUP BY clause in IoTDB strictly uses the left-closed, right-open [start, end) time interval format. Users often need to include the data point exactly at the end time (e.g., [start, end]), but the current syntax does not support using ] to specify an inclusive end time.
When querying time-series data, it is common to want a precise inclusive range (e.g., from 12:00 to 13:00 inclusive). To achieve this now, users must manually extend the end_time by a small fraction (e.g., +1ms) or by a full time interval unit, which is unintuitive and can lead to errors or off-by-one queries.
What did you expect to see?
Support the standard interval syntax ] to denote an inclusive end time in the GROUP BY clause.
Example:
Allow this syntax:
SELECT count(s1) FROM root.sg.d1
GROUP BY ([2026-01-27T12:00:00, 2026-01-27T13:00:00], 1m)
What did you see instead?
Current syntex doesn't allow ] for end time. I have to use the below syntex:
SELECT count(s1) FROM root.sg.d1
GROUP BY ([2026-01-27T12:00:00, 2026-01-27T13:00:00), 1m)
but it excludes the value at 13:00:00
Anything else?
Current Workaround:
Users currently have to modify the timestamp manually:
-- Extended by 1ms to capture the last point
GROUP BY ([2026-01-27T12:00:00, 2026-01-27T13:00:00.001), 1m)
Are you willing to submit a PR?
- I'm willing to submit a PR!
- 主要语言
- Java
- 星标
- 6.4k
- 派生
- 1.2k
- 平均合并
- 1 天 17 小时
- 30 天内合并 PR
- 152
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
apache/iotdb 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 82/100
-
IoTDB Edge: stop-edge.sh does not stop its own process when IOTDB_HOME is set, and reports success 未关闭
难度 2/5 1-3 小时 新手友好度 78/100
-
难度 2/5 1-3 小时 新手友好度 78/100
-
难度 2/5 1-3 小时 新手友好度 78/100
-
难度 2/5 1-3 小时 新手友好度 78/100
相似的 Issue
-
area-deployment area-integrations triage:bot-seen
难度 2/5 半天 新手友好度 86/100
-
难度 2/5 1-3 小时 新手友好度 75/100
apache/flink-agents#1156 ·
-
area/connectors autoteam community connectors/source/shopify needs-triage team/use type/bug
难度 2/5 1-3 小时 新手友好度 84/100
-
难度 2/5 1-3 小时 新手友好度 70/100
-
难度 1/5 1 小时以内 新手友好度 85/100