apache / apache/iotdb

[Bug] In version 1.3.3 of IoTDB, The time series function TIME_DIFFERENCE returns an index out of bounds error.

オープン
#14,522 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
Java
スター
6.4k
フォーク
1.2k
平均マージ
1日 23時間
マージ済み PR(30日)
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

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。