[Bug] In version 1.3.3 of IoTDB, The time series function TIME_DIFFERENCE returns an index out of bounds error.
- 主要语言
- Java
- 星标
- 6.4k
- 派生
- 1.2k
- 平均合并
- 1 天 23 小时
- 30 天内合并 PR
- 115
描述
### Search before asking
- [X] I searched in the [issues](https://github.com/apache/iotdb/issues) and found nothing similar.
### Version
version 1.3.3 (Build: ad95a7e)
### Describe the bug and provide the minimal reproduce step
```
DROP DATABASE root.db0.t1
CREATE DATABASE root.db0.t1
CREATE TIMESERIES root.db0.t1.c0 WITH datatype=INT32;
INSERT INTO root.db0.t1(timestamp, c0) VALUES (1641024000000, 0), (1641024005000, 1);
# query 1
SELECT TIME_DIFFERENCE(c0) FROM root.db0.t1 WHERE c0 < 0;
# query 2
SELECT TIME_DIFFERENCE(c0) FROM root.db0.t1 WHERE time != time;
```
### What did you expect to see?
The expected result set for Query 1 is: **empty set**
The expected result set for Query 2 is: **empty set**
### What did you see instead?
The actual result set returned by Query 1 is: **empty set**
The actual result set returned by Query 2 is: **Msg: org.apache.iotdb.jdbc.IoTDBSQLException: 301: Index 1 out of bounds for length 1**
### Anything else?
Dear IoTDB team, In the above queries, both Query 1 and Query 2 are unable to retrieve any data, so they both perform the `TIME_DIFFERENCE` operation on empty sets. However, Query 2 triggers an index out of bounds error during execution. This should be considered a crash error.
### Are you willing to submit a PR?
- [ ] I'm willing to submit a PR!
贡献指南
调研方向
首先针对 IoTDB 1.3.3 运行最小复现,并比较 Query 1 和 Query 2。跟踪 Query 2 产生的空结果的 TIME_DIFFERENCE 执行路径;当两个查询都返回空集且没有发生 index-out-of-bounds 异常时,即表示完成。issue 中没有指定源文件或现有测试。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- java, sql
- 领域
- databases
- Issue 类型
- 缺陷
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 活跃度
- 停滞
- 描述清晰度
- 基本清楚
- 新手友好度
- 35/100