In select into statement, default encoding type may cause compatibility problems
- 主要言語
- Java
- スター
- 6.4k
- フォーク
- 1.2k
- 平均マージ
- 1日 23時間
- マージ済み PR(30日)
- 115
説明
**Describe the bug**
1. In the documentation, GORILLA encoding type has a restriction. However, some select into statements will automatic create a timeseries with GORILLA encoding type(while the original timeseries is not a GORILLA type), which may be conflict with GORILLA's restriction.
If we can't change the default encoding type in select...into... clause, this problem may exist. Perhaps there will be other conficts in this select...into... clause.
2. I try to insert a -Double.MAX_VALUE point into the database, with other points all positive, which means the sum will not over Double; but it still returns -Infinity while I use a avg agggregation statement with group by.
**To Reproduce**
1. running the following iotdb-sql in iotdb-client:
SET STORAGE GROUP TO root.sg0;
CREATE TIMESERIES root.sg0.t1 WITH DATATYPE=DOUBLE, ENCODING=PLAIN;
INSERT INTO root.sg0(timestamp, t1) VALUES (9603, 0.732498412173562);
INSERT INTO root.sg0(timestamp, t1) VALUES (12492, 0.885314087043015);
INSERT INTO root.sg0(timestamp, t1) VALUES (39503, 0.08816170378111365);
INSERT INTO root.sg0(timestamp, t1) VALUES (25965, -1.7976931348623157E308);
INSERT INTO root.sg0(timestamp, t1) VALUES (78893, 0.47220064168506504);
select t1 into t0 from root.sg0
select avg(t1),avg(t0) from root.* group by([1000, 100000), 40000ms)
**Expected behavior**
1. There will be a -Double.MAX_VALUE in a GORILLA type timeseries(root.sg0.t0), which might be invalid? (I think there will also be a restriction in GORILLA while using Double datatype, but the document doesn't mention it)
2. There will be no Infinity exists in the result, since all single points are in the range of double, (though there is a point has a value of -Double.MAX_VALUE)
**Screenshots**
This is the result of the last query, which has -Infinity.

This avg aggregation return -Infinity, while some other range of group by / sum aggregation will not return infinity.


The encoding of t0 becomes GORILLA

- OS: Windows 10
- Version: iotdb 0.13.1
コントリビューションガイド
調査の方向性
まず、iotdb-client で SQL シーケンスを再現し、select...into 文、GORILLA エンコーディング、group by を伴う avg に焦点を当てます。自動時系列作成と集計を処理するパスを追跡し、エンコーディング制限と -Infinity の結果が発生する理由を特定します。再現したケースで互換性のないエンコーディングが作成されず、有限の double 値に対して -Infinity が返されなくなれば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- java
- 領域
- databases
- issue の種類
- バグ
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 活発さ
- 停滞
- 明瞭さ
- 説明が足りない
- 初心者へのやさしさ
- 30/100