You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@iotdb.apache.org by "Lei Rui (Jira)" <ji...@apache.org> on 2023/03/30 15:07:00 UTC

[jira] [Created] (IOTDB-5747) UDF SlidingTimeWindow slidingStep bug

Lei Rui created IOTDB-5747:
------------------------------

             Summary: UDF SlidingTimeWindow slidingStep bug
                 Key: IOTDB-5747
                 URL: https://issues.apache.org/jira/browse/IOTDB-5747
             Project: Apache IoTDB
          Issue Type: Bug
            Reporter: Lei Rui


To reproduce the bug in IoTDB v1.0.1:
```
insert into root.sg1.d1(timestamp,s1) values(1,1)
insert into root.sg1.d1(timestamp,s1) values(2,2)
insert into root.sg1.d1(timestamp,s1) values(3,3)
insert into root.sg1.d1(timestamp,s1) values(4,4)
insert into root.sg1.d1(timestamp,s1) values(5,5)
insert into root.sg1.d1(timestamp,s1) values(6,6)
insert into root.sg1.d1(timestamp,s1) values(7,7)
insert into root.sg1.d1(timestamp,s1) values(8,8)
select M4(s1,'timeInterval'='3','slidingStep'='2') from root.sg1.d1
```
The query result is:
```
+-----------------------------+---------------------------------------------------------+
|                         Time|M4(root.sg1.d1.s1, "timeInterval"="3", "slidingStep"="2")|
+-----------------------------+---------------------------------------------------------+
|1970-01-01T08:00:00.001+08:00|                                                      1.0|
|1970-01-01T08:00:00.003+08:00|                                                      3.0|
+-----------------------------+---------------------------------------------------------+
Total line number = 2
```
which is wrong, as the sliding time windows and the M4 samples of each window should be:
- [1,4): samples (1,1),(3,3)
- [3,6): samples (3,3),(5,5)
- [5,8): samples (5,5), (7,7)
- [7,10): samples (7,7), (8,8)

From my observation, the bug tends to happen when the slidingStep equals timeInterval-1. I think there are bugs in the sliding time window code, but I couldn't locate the bug because I am not familiar with the UDF module.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)