apache / apache/iotdb

In select into statement, default encoding type may cause compatibility problems

Đang mở
#6,953 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
Java
Star
6.4k
Fork
1.2k
Merge trung bình
1 ngày 23 giờ
Pull request đã merge (30 ngày)
115

Mô tả

**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.
![image](https://user-images.githubusercontent.com/25195216/184050086-21002450-f58e-4d0c-838d-79e3617fc0a7.png)

This avg aggregation return -Infinity, while some other range of group by / sum aggregation will not return infinity.
![1660181660436](https://user-images.githubusercontent.com/25195216/184050285-88fe2821-6ad7-416b-8b3e-3a6c7d80b5b9.png)
![image](https://user-images.githubusercontent.com/25195216/184050315-16a0cdca-ef23-4c21-8b48-29936adac9df.png)

The encoding of t0 becomes GORILLA
![image](https://user-images.githubusercontent.com/25195216/184052028-8d9185c3-1a0f-4bee-9a32-cfa29003b1aa.png)

- OS: Windows 10
- Version: iotdb 0.13.1

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Hướng nghiên cứu

Bắt đầu bằng cách tái hiện chuỗi SQL trong iotdb-client, tập trung vào câu lệnh select...into, mã hóa GORILLA và avg với group by. Theo dõi các đường dẫn xử lý việc tự động tạo time series và phép tổng hợp để xác định lý do xảy ra hạn chế mã hóa và kết quả -Infinity. Được xem là hoàn tất khi các trường hợp được tái hiện không còn tạo mã hóa không tương thích hoặc trả về -Infinity đối với các giá trị double hữu hạn.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
java
Lĩnh vực
databases
Loại issue
Lỗi
Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Cần làm rõ
Mức phù hợp với người mới
30/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.