This is an automated email from the ASF dual-hosted git repository.

jackietien pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/iotdb-docs.git


The following commit(s) were added to refs/heads/main by this push:
     new 56dfcfb  Add docs for fill timeout
56dfcfb is described below

commit 56dfcfb010632fad354a59f3645ae5c092d7907c
Author: Jackie Tien <[email protected]>
AuthorDate: Thu May 9 11:15:19 2024 +0800

    Add docs for fill timeout
---
 src/UserGuide/Master/SQL-Manual/SQL-Manual.md     |   9 +-
 src/UserGuide/Master/User-Manual/Query-Data.md    | 124 ++++++++++++++++++++-
 src/UserGuide/Master/stage/Query-Data/Fill.md     | 124 +++++++++++++++++++++
 src/UserGuide/latest/SQL-Manual/SQL-Manual.md     |   9 +-
 src/UserGuide/latest/User-Manual/Query-Data.md    | 124 ++++++++++++++++++++-
 src/UserGuide/latest/stage/Query-Data/Fill.md     | 125 ++++++++++++++++++++++
 src/zh/UserGuide/Master/SQL-Manual/SQL-Manual.md  |  10 +-
 src/zh/UserGuide/Master/User-Manual/Query-Data.md | 125 +++++++++++++++++++++-
 src/zh/UserGuide/Master/stage/Query-Data/Fill.md  | 124 +++++++++++++++++++++
 src/zh/UserGuide/latest/SQL-Manual/SQL-Manual.md  |  10 +-
 src/zh/UserGuide/latest/User-Manual/Query-Data.md | 125 +++++++++++++++++++++-
 src/zh/UserGuide/latest/stage/Query-Data/Fill.md  | 124 +++++++++++++++++++++
 12 files changed, 1019 insertions(+), 14 deletions(-)

diff --git a/src/UserGuide/Master/SQL-Manual/SQL-Manual.md 
b/src/UserGuide/Master/SQL-Manual/SQL-Manual.md
index 16bacec..a3f4a12 100644
--- a/src/UserGuide/Master/SQL-Manual/SQL-Manual.md
+++ b/src/UserGuide/Master/SQL-Manual/SQL-Manual.md
@@ -538,7 +538,7 @@ SELECT [LAST] selectExpr [, selectExpr] ...
     }]
     [HAVING havingCondition]
     [ORDER BY sortKey {ASC | DESC}]
-    [FILL ({PREVIOUS | LINEAR | constant})]
+    [FILL ({PREVIOUS | LINEAR | constant} (, interval=DURATION_LITERAL)?)]
     [SLIMIT seriesLimit] [SOFFSET seriesOffset]
     [LIMIT rowLimit] [OFFSET rowOffset]
     [ALIGN BY {TIME | DEVICE}]
@@ -792,6 +792,11 @@ IoTDB > select count(d1.s1) from root.** group by 
([1,3),1ms), level=1 having su
 IoTDB > select temperature, status from root.sgcc.wf03.wt01 where time >= 
2017-11-01T16:37:00.000 and time <= 2017-11-01T16:40:00.000 fill(previous);
 ```
 
+#### `PREVIOUS` FILL and specify the fill timeout threshold
+```sql
+select temperature, status from root.sgcc.wf03.wt01 where time >= 
2017-11-01T16:37:00.000 and time <= 2017-11-01T16:40:00.000 fill(previous, 2m);
+```
+
 #### `LINEAR` Fill
 
 ```sql
@@ -1459,7 +1464,7 @@ BEGIN
     [WHERE CLAUSE]
     [GROUP BY(<group_by_interval>[, <sliding_step>]) [, level = <level>]]
     [HAVING CLAUSE]
-    [FILL {PREVIOUS | LINEAR | constant}]
+    [FILL ({PREVIOUS | LINEAR | constant} (, interval=DURATION_LITERAL)?)]
     [LIMIT rowLimit OFFSET rowOffset]
     [ALIGN BY DEVICE]
 END
diff --git a/src/UserGuide/Master/User-Manual/Query-Data.md 
b/src/UserGuide/Master/User-Manual/Query-Data.md
index 7c2f5f0..e016e15 100644
--- a/src/UserGuide/Master/User-Manual/Query-Data.md
+++ b/src/UserGuide/Master/User-Manual/Query-Data.md
@@ -41,7 +41,7 @@ SELECT [LAST] selectExpr [, selectExpr] ...
     }]
     [HAVING havingCondition]
     [ORDER BY sortKey {ASC | DESC}]
-    [FILL ({PREVIOUS | LINEAR | constant})]
+    [FILL ({PREVIOUS | LINEAR | constant}) (, interval=DURATION_LITERAL)?)]
     [SLIMIT seriesLimit] [SOFFSET seriesOffset]
     [LIMIT rowLimit] [OFFSET rowOffset]
     [ALIGN BY {TIME | DEVICE}]
@@ -1775,6 +1775,128 @@ result will be like:
 Total line number = 4
 ```
 
+**While using `FILL(PREVIOUS)`, you can specify a time interval. If the 
interval between the timestamp of the current null value and the timestamp of 
the previous non-null value exceeds the specified time interval, no filling 
will be performed.**
+
+> 1. In the case of FILL(LINEAR) and FILL(CONSTANT), if the second parameter 
is specified, an exception will be thrown
+> 2. The interval parameter only supports integers
+     For example, the raw data looks like this:
+
+```sql
+select s1 from root.db.d1
+```
+```
++-----------------------------+-------------+
+|                         Time|root.db.d1.s1|
++-----------------------------+-------------+
+|2023-11-08T16:41:50.008+08:00|          1.0|
++-----------------------------+-------------+
+|2023-11-08T16:46:50.011+08:00|          2.0|
++-----------------------------+-------------+
+|2023-11-08T16:48:50.011+08:00|          3.0|
++-----------------------------+-------------+
+```
+
+We want to group the data by 1 min time interval:
+
+```sql
+select avg(s1) 
+  from root.db.d1 
+  group by([2023-11-08T16:40:00.008+08:00, 2023-11-08T16:50:00.008+08:00), 1m)
+```
+```
++-----------------------------+------------------+
+|                         Time|avg(root.db.d1.s1)|
++-----------------------------+------------------+
+|2023-11-08T16:40:00.008+08:00|              null|
++-----------------------------+------------------+
+|2023-11-08T16:41:00.008+08:00|               1.0|
++-----------------------------+------------------+
+|2023-11-08T16:42:00.008+08:00|              null|
++-----------------------------+------------------+
+|2023-11-08T16:43:00.008+08:00|              null|
++-----------------------------+------------------+
+|2023-11-08T16:44:00.008+08:00|              null|
++-----------------------------+------------------+
+|2023-11-08T16:45:00.008+08:00|              null|
++-----------------------------+------------------+
+|2023-11-08T16:46:00.008+08:00|               2.0|
++-----------------------------+------------------+
+|2023-11-08T16:47:00.008+08:00|              null|
++-----------------------------+------------------+
+|2023-11-08T16:48:00.008+08:00|               3.0|
++-----------------------------+------------------+
+|2023-11-08T16:49:00.008+08:00|              null|
++-----------------------------+------------------+
+```
+
+After grouping, we want to fill the null value:
+
+```sql
+select avg(s1) 
+  from root.db.d1 
+  group by([2023-11-08T16:40:00.008+08:00, 2023-11-08T16:50:00.008+08:00), 1m)
+  FILL(PREVIOUS);
+```
+```
++-----------------------------+------------------+
+|                         Time|avg(root.db.d1.s1)|
++-----------------------------+------------------+
+|2023-11-08T16:40:00.008+08:00|              null|
++-----------------------------+------------------+
+|2023-11-08T16:41:00.008+08:00|               1.0|
++-----------------------------+------------------+
+|2023-11-08T16:42:00.008+08:00|               1.0|
++-----------------------------+------------------+
+|2023-11-08T16:43:00.008+08:00|               1.0|
++-----------------------------+------------------+
+|2023-11-08T16:44:00.008+08:00|               1.0|
++-----------------------------+------------------+
+|2023-11-08T16:45:00.008+08:00|               1.0|
++-----------------------------+------------------+
+|2023-11-08T16:46:00.008+08:00|               2.0|
++-----------------------------+------------------+
+|2023-11-08T16:47:00.008+08:00|               2.0|
++-----------------------------+------------------+
+|2023-11-08T16:48:00.008+08:00|               3.0|
++-----------------------------+------------------+
+|2023-11-08T16:49:00.008+08:00|               3.0|
++-----------------------------+------------------+
+```
+
+we also don't want the null value to be filled if it keeps null for 2 min.
+
+```sql
+select avg(s1)
+from root.db.d1
+group by([2023-11-08T16:40:00.008+08:00, 2023-11-08T16:50:00.008+08:00), 1m)
+  FILL(PREVIOUS, 2m);
+```
+```
++-----------------------------+------------------+
+|                         Time|avg(root.db.d1.s1)|
++-----------------------------+------------------+
+|2023-11-08T16:40:00.008+08:00|              null|
++-----------------------------+------------------+
+|2023-11-08T16:41:00.008+08:00|               1.0|
++-----------------------------+------------------+
+|2023-11-08T16:42:00.008+08:00|               1.0|
++-----------------------------+------------------+
+|2023-11-08T16:43:00.008+08:00|               1.0|
++-----------------------------+------------------+
+|2023-11-08T16:44:00.008+08:00|              null|
++-----------------------------+------------------+
+|2023-11-08T16:45:00.008+08:00|              null|
++-----------------------------+------------------+
+|2023-11-08T16:46:00.008+08:00|               2.0|
++-----------------------------+------------------+
+|2023-11-08T16:47:00.008+08:00|               2.0|
++-----------------------------+------------------+
+|2023-11-08T16:48:00.008+08:00|               3.0|
++-----------------------------+------------------+
+|2023-11-08T16:49:00.008+08:00|               3.0|
++-----------------------------+------------------+
+```
+
 #### `LINEAR` Fill
 
 **For null values in the query result set, fill the column with a linear 
interpolation of the previous non-null value and the next non-null value of the 
column.**
diff --git a/src/UserGuide/Master/stage/Query-Data/Fill.md 
b/src/UserGuide/Master/stage/Query-Data/Fill.md
index 32e619e..73c23bc 100644
--- a/src/UserGuide/Master/stage/Query-Data/Fill.md
+++ b/src/UserGuide/Master/stage/Query-Data/Fill.md
@@ -114,6 +114,130 @@ result will be like:
 Total line number = 4
 ```
 
+**While using `FILL(PREVIOUS)`, you can specify a time interval. If the 
interval between the timestamp of the current null value and the timestamp of 
the previous non-null value exceeds the specified time interval, no filling 
will be performed.**
+
+> 1. In the case of FILL(LINEAR) and FILL(CONSTANT), if the second parameter 
is specified, an exception will be thrown
+> 2. The interval parameter only supports integers
+
+For example, the raw data looks like this: 
+
+```sql
+select s1 from root.db.d1
+```
+```
++-----------------------------+-------------+
+|                         Time|root.db.d1.s1|
++-----------------------------+-------------+
+|2023-11-08T16:41:50.008+08:00|          1.0|
++-----------------------------+-------------+
+|2023-11-08T16:46:50.011+08:00|          2.0|
++-----------------------------+-------------+
+|2023-11-08T16:48:50.011+08:00|          3.0|
++-----------------------------+-------------+
+```
+
+We want to group the data by 1 min time interval:
+
+```sql
+select avg(s1) 
+  from root.db.d1 
+  group by([2023-11-08T16:40:00.008+08:00, 2023-11-08T16:50:00.008+08:00), 1m)
+```
+```
++-----------------------------+------------------+
+|                         Time|avg(root.db.d1.s1)|
++-----------------------------+------------------+
+|2023-11-08T16:40:00.008+08:00|              null|
++-----------------------------+------------------+
+|2023-11-08T16:41:00.008+08:00|               1.0|
++-----------------------------+------------------+
+|2023-11-08T16:42:00.008+08:00|              null|
++-----------------------------+------------------+
+|2023-11-08T16:43:00.008+08:00|              null|
++-----------------------------+------------------+
+|2023-11-08T16:44:00.008+08:00|              null|
++-----------------------------+------------------+
+|2023-11-08T16:45:00.008+08:00|              null|
++-----------------------------+------------------+
+|2023-11-08T16:46:00.008+08:00|               2.0|
++-----------------------------+------------------+
+|2023-11-08T16:47:00.008+08:00|              null|
++-----------------------------+------------------+
+|2023-11-08T16:48:00.008+08:00|               3.0|
++-----------------------------+------------------+
+|2023-11-08T16:49:00.008+08:00|              null|
++-----------------------------+------------------+
+```
+
+After grouping, we want to fill the null value:
+
+```sql
+select avg(s1) 
+  from root.db.d1 
+  group by([2023-11-08T16:40:00.008+08:00, 2023-11-08T16:50:00.008+08:00), 1m)
+  FILL(PREVIOUS);
+```
+```
++-----------------------------+------------------+
+|                         Time|avg(root.db.d1.s1)|
++-----------------------------+------------------+
+|2023-11-08T16:40:00.008+08:00|              null|
++-----------------------------+------------------+
+|2023-11-08T16:41:00.008+08:00|               1.0|
++-----------------------------+------------------+
+|2023-11-08T16:42:00.008+08:00|               1.0|
++-----------------------------+------------------+
+|2023-11-08T16:43:00.008+08:00|               1.0|
++-----------------------------+------------------+
+|2023-11-08T16:44:00.008+08:00|               1.0|
++-----------------------------+------------------+
+|2023-11-08T16:45:00.008+08:00|               1.0|
++-----------------------------+------------------+
+|2023-11-08T16:46:00.008+08:00|               2.0|
++-----------------------------+------------------+
+|2023-11-08T16:47:00.008+08:00|               2.0|
++-----------------------------+------------------+
+|2023-11-08T16:48:00.008+08:00|               3.0|
++-----------------------------+------------------+
+|2023-11-08T16:49:00.008+08:00|               3.0|
++-----------------------------+------------------+
+```
+
+we also don't want the null value to be filled if it keeps null for 2 min.
+
+```sql
+select avg(s1)
+from root.db.d1
+group by([2023-11-08T16:40:00.008+08:00, 2023-11-08T16:50:00.008+08:00), 1m)
+  FILL(PREVIOUS, 2m);
+```
+```
++-----------------------------+------------------+
+|                         Time|avg(root.db.d1.s1)|
++-----------------------------+------------------+
+|2023-11-08T16:40:00.008+08:00|              null|
++-----------------------------+------------------+
+|2023-11-08T16:41:00.008+08:00|               1.0|
++-----------------------------+------------------+
+|2023-11-08T16:42:00.008+08:00|               1.0|
++-----------------------------+------------------+
+|2023-11-08T16:43:00.008+08:00|               1.0|
++-----------------------------+------------------+
+|2023-11-08T16:44:00.008+08:00|              null|
++-----------------------------+------------------+
+|2023-11-08T16:45:00.008+08:00|              null|
++-----------------------------+------------------+
+|2023-11-08T16:46:00.008+08:00|               2.0|
++-----------------------------+------------------+
+|2023-11-08T16:47:00.008+08:00|               2.0|
++-----------------------------+------------------+
+|2023-11-08T16:48:00.008+08:00|               3.0|
++-----------------------------+------------------+
+|2023-11-08T16:49:00.008+08:00|               3.0|
++-----------------------------+------------------+
+```
+
+
 ### `LINEAR` Fill
 
 **For null values in the query result set, fill the column with a linear 
interpolation of the previous non-null value and the next non-null value of the 
column.**
diff --git a/src/UserGuide/latest/SQL-Manual/SQL-Manual.md 
b/src/UserGuide/latest/SQL-Manual/SQL-Manual.md
index 553d89c..8fbd4f9 100644
--- a/src/UserGuide/latest/SQL-Manual/SQL-Manual.md
+++ b/src/UserGuide/latest/SQL-Manual/SQL-Manual.md
@@ -538,7 +538,7 @@ SELECT [LAST] selectExpr [, selectExpr] ...
     }]
     [HAVING havingCondition]
     [ORDER BY sortKey {ASC | DESC}]
-    [FILL ({PREVIOUS | LINEAR | constant})]
+    [FILL ({PREVIOUS | LINEAR | constant} (, interval=DURATION_LITERAL)?)]
     [SLIMIT seriesLimit] [SOFFSET seriesOffset]
     [LIMIT rowLimit] [OFFSET rowOffset]
     [ALIGN BY {TIME | DEVICE}]
@@ -792,6 +792,11 @@ IoTDB > select count(d1.s1) from root.** group by 
([1,3),1ms), level=1 having su
 IoTDB > select temperature, status from root.sgcc.wf03.wt01 where time >= 
2017-11-01T16:37:00.000 and time <= 2017-11-01T16:40:00.000 fill(previous);
 ```
 
+#### `PREVIOUS` FILL and specify the fill timeout threshold
+```sql
+select temperature, status from root.sgcc.wf03.wt01 where time >= 
2017-11-01T16:37:00.000 and time <= 2017-11-01T16:40:00.000 fill(previous, 2m);
+```
+
 #### `LINEAR` Fill
 
 ```sql
@@ -1458,7 +1463,7 @@ BEGIN
     [WHERE CLAUSE]
     [GROUP BY(<group_by_interval>[, <sliding_step>]) [, level = <level>]]
     [HAVING CLAUSE]
-    [FILL {PREVIOUS | LINEAR | constant}]
+    [FILL ({PREVIOUS | LINEAR | constant} (, interval=DURATION_LITERAL)?)]
     [LIMIT rowLimit OFFSET rowOffset]
     [ALIGN BY DEVICE]
 END
diff --git a/src/UserGuide/latest/User-Manual/Query-Data.md 
b/src/UserGuide/latest/User-Manual/Query-Data.md
index 7c2f5f0..e016e15 100644
--- a/src/UserGuide/latest/User-Manual/Query-Data.md
+++ b/src/UserGuide/latest/User-Manual/Query-Data.md
@@ -41,7 +41,7 @@ SELECT [LAST] selectExpr [, selectExpr] ...
     }]
     [HAVING havingCondition]
     [ORDER BY sortKey {ASC | DESC}]
-    [FILL ({PREVIOUS | LINEAR | constant})]
+    [FILL ({PREVIOUS | LINEAR | constant}) (, interval=DURATION_LITERAL)?)]
     [SLIMIT seriesLimit] [SOFFSET seriesOffset]
     [LIMIT rowLimit] [OFFSET rowOffset]
     [ALIGN BY {TIME | DEVICE}]
@@ -1775,6 +1775,128 @@ result will be like:
 Total line number = 4
 ```
 
+**While using `FILL(PREVIOUS)`, you can specify a time interval. If the 
interval between the timestamp of the current null value and the timestamp of 
the previous non-null value exceeds the specified time interval, no filling 
will be performed.**
+
+> 1. In the case of FILL(LINEAR) and FILL(CONSTANT), if the second parameter 
is specified, an exception will be thrown
+> 2. The interval parameter only supports integers
+     For example, the raw data looks like this:
+
+```sql
+select s1 from root.db.d1
+```
+```
++-----------------------------+-------------+
+|                         Time|root.db.d1.s1|
++-----------------------------+-------------+
+|2023-11-08T16:41:50.008+08:00|          1.0|
++-----------------------------+-------------+
+|2023-11-08T16:46:50.011+08:00|          2.0|
++-----------------------------+-------------+
+|2023-11-08T16:48:50.011+08:00|          3.0|
++-----------------------------+-------------+
+```
+
+We want to group the data by 1 min time interval:
+
+```sql
+select avg(s1) 
+  from root.db.d1 
+  group by([2023-11-08T16:40:00.008+08:00, 2023-11-08T16:50:00.008+08:00), 1m)
+```
+```
++-----------------------------+------------------+
+|                         Time|avg(root.db.d1.s1)|
++-----------------------------+------------------+
+|2023-11-08T16:40:00.008+08:00|              null|
++-----------------------------+------------------+
+|2023-11-08T16:41:00.008+08:00|               1.0|
++-----------------------------+------------------+
+|2023-11-08T16:42:00.008+08:00|              null|
++-----------------------------+------------------+
+|2023-11-08T16:43:00.008+08:00|              null|
++-----------------------------+------------------+
+|2023-11-08T16:44:00.008+08:00|              null|
++-----------------------------+------------------+
+|2023-11-08T16:45:00.008+08:00|              null|
++-----------------------------+------------------+
+|2023-11-08T16:46:00.008+08:00|               2.0|
++-----------------------------+------------------+
+|2023-11-08T16:47:00.008+08:00|              null|
++-----------------------------+------------------+
+|2023-11-08T16:48:00.008+08:00|               3.0|
++-----------------------------+------------------+
+|2023-11-08T16:49:00.008+08:00|              null|
++-----------------------------+------------------+
+```
+
+After grouping, we want to fill the null value:
+
+```sql
+select avg(s1) 
+  from root.db.d1 
+  group by([2023-11-08T16:40:00.008+08:00, 2023-11-08T16:50:00.008+08:00), 1m)
+  FILL(PREVIOUS);
+```
+```
++-----------------------------+------------------+
+|                         Time|avg(root.db.d1.s1)|
++-----------------------------+------------------+
+|2023-11-08T16:40:00.008+08:00|              null|
++-----------------------------+------------------+
+|2023-11-08T16:41:00.008+08:00|               1.0|
++-----------------------------+------------------+
+|2023-11-08T16:42:00.008+08:00|               1.0|
++-----------------------------+------------------+
+|2023-11-08T16:43:00.008+08:00|               1.0|
++-----------------------------+------------------+
+|2023-11-08T16:44:00.008+08:00|               1.0|
++-----------------------------+------------------+
+|2023-11-08T16:45:00.008+08:00|               1.0|
++-----------------------------+------------------+
+|2023-11-08T16:46:00.008+08:00|               2.0|
++-----------------------------+------------------+
+|2023-11-08T16:47:00.008+08:00|               2.0|
++-----------------------------+------------------+
+|2023-11-08T16:48:00.008+08:00|               3.0|
++-----------------------------+------------------+
+|2023-11-08T16:49:00.008+08:00|               3.0|
++-----------------------------+------------------+
+```
+
+we also don't want the null value to be filled if it keeps null for 2 min.
+
+```sql
+select avg(s1)
+from root.db.d1
+group by([2023-11-08T16:40:00.008+08:00, 2023-11-08T16:50:00.008+08:00), 1m)
+  FILL(PREVIOUS, 2m);
+```
+```
++-----------------------------+------------------+
+|                         Time|avg(root.db.d1.s1)|
++-----------------------------+------------------+
+|2023-11-08T16:40:00.008+08:00|              null|
++-----------------------------+------------------+
+|2023-11-08T16:41:00.008+08:00|               1.0|
++-----------------------------+------------------+
+|2023-11-08T16:42:00.008+08:00|               1.0|
++-----------------------------+------------------+
+|2023-11-08T16:43:00.008+08:00|               1.0|
++-----------------------------+------------------+
+|2023-11-08T16:44:00.008+08:00|              null|
++-----------------------------+------------------+
+|2023-11-08T16:45:00.008+08:00|              null|
++-----------------------------+------------------+
+|2023-11-08T16:46:00.008+08:00|               2.0|
++-----------------------------+------------------+
+|2023-11-08T16:47:00.008+08:00|               2.0|
++-----------------------------+------------------+
+|2023-11-08T16:48:00.008+08:00|               3.0|
++-----------------------------+------------------+
+|2023-11-08T16:49:00.008+08:00|               3.0|
++-----------------------------+------------------+
+```
+
 #### `LINEAR` Fill
 
 **For null values in the query result set, fill the column with a linear 
interpolation of the previous non-null value and the next non-null value of the 
column.**
diff --git a/src/UserGuide/latest/stage/Query-Data/Fill.md 
b/src/UserGuide/latest/stage/Query-Data/Fill.md
index 32e619e..97eeed0 100644
--- a/src/UserGuide/latest/stage/Query-Data/Fill.md
+++ b/src/UserGuide/latest/stage/Query-Data/Fill.md
@@ -114,6 +114,131 @@ result will be like:
 Total line number = 4
 ```
 
+
+**While using `FILL(PREVIOUS)`, you can specify a time interval. If the 
interval between the timestamp of the current null value and the timestamp of 
the previous non-null value exceeds the specified time interval, no filling 
will be performed.**
+
+> 1. In the case of FILL(LINEAR) and FILL(CONSTANT), if the second parameter 
is specified, an exception will be thrown
+> 2. The interval parameter only supports integers
+
+For example, the raw data looks like this:
+
+```sql
+select s1 from root.db.d1
+```
+```
++-----------------------------+-------------+
+|                         Time|root.db.d1.s1|
++-----------------------------+-------------+
+|2023-11-08T16:41:50.008+08:00|          1.0|
++-----------------------------+-------------+
+|2023-11-08T16:46:50.011+08:00|          2.0|
++-----------------------------+-------------+
+|2023-11-08T16:48:50.011+08:00|          3.0|
++-----------------------------+-------------+
+```
+
+We want to group the data by 1 min time interval:
+
+```sql
+select avg(s1) 
+  from root.db.d1 
+  group by([2023-11-08T16:40:00.008+08:00, 2023-11-08T16:50:00.008+08:00), 1m)
+```
+```
++-----------------------------+------------------+
+|                         Time|avg(root.db.d1.s1)|
++-----------------------------+------------------+
+|2023-11-08T16:40:00.008+08:00|              null|
++-----------------------------+------------------+
+|2023-11-08T16:41:00.008+08:00|               1.0|
++-----------------------------+------------------+
+|2023-11-08T16:42:00.008+08:00|              null|
++-----------------------------+------------------+
+|2023-11-08T16:43:00.008+08:00|              null|
++-----------------------------+------------------+
+|2023-11-08T16:44:00.008+08:00|              null|
++-----------------------------+------------------+
+|2023-11-08T16:45:00.008+08:00|              null|
++-----------------------------+------------------+
+|2023-11-08T16:46:00.008+08:00|               2.0|
++-----------------------------+------------------+
+|2023-11-08T16:47:00.008+08:00|              null|
++-----------------------------+------------------+
+|2023-11-08T16:48:00.008+08:00|               3.0|
++-----------------------------+------------------+
+|2023-11-08T16:49:00.008+08:00|              null|
++-----------------------------+------------------+
+```
+
+After grouping, we want to fill the null value:
+
+```sql
+select avg(s1) 
+  from root.db.d1 
+  group by([2023-11-08T16:40:00.008+08:00, 2023-11-08T16:50:00.008+08:00), 1m)
+  FILL(PREVIOUS);
+```
+```
++-----------------------------+------------------+
+|                         Time|avg(root.db.d1.s1)|
++-----------------------------+------------------+
+|2023-11-08T16:40:00.008+08:00|              null|
++-----------------------------+------------------+
+|2023-11-08T16:41:00.008+08:00|               1.0|
++-----------------------------+------------------+
+|2023-11-08T16:42:00.008+08:00|               1.0|
++-----------------------------+------------------+
+|2023-11-08T16:43:00.008+08:00|               1.0|
++-----------------------------+------------------+
+|2023-11-08T16:44:00.008+08:00|               1.0|
++-----------------------------+------------------+
+|2023-11-08T16:45:00.008+08:00|               1.0|
++-----------------------------+------------------+
+|2023-11-08T16:46:00.008+08:00|               2.0|
++-----------------------------+------------------+
+|2023-11-08T16:47:00.008+08:00|               2.0|
++-----------------------------+------------------+
+|2023-11-08T16:48:00.008+08:00|               3.0|
++-----------------------------+------------------+
+|2023-11-08T16:49:00.008+08:00|               3.0|
++-----------------------------+------------------+
+```
+
+we also don't want the null value to be filled if it keeps null for 2 min.
+
+```sql
+select avg(s1)
+from root.db.d1
+group by([2023-11-08T16:40:00.008+08:00, 2023-11-08T16:50:00.008+08:00), 1m)
+  FILL(PREVIOUS, 2m);
+```
+```
++-----------------------------+------------------+
+|                         Time|avg(root.db.d1.s1)|
++-----------------------------+------------------+
+|2023-11-08T16:40:00.008+08:00|              null|
++-----------------------------+------------------+
+|2023-11-08T16:41:00.008+08:00|               1.0|
++-----------------------------+------------------+
+|2023-11-08T16:42:00.008+08:00|               1.0|
++-----------------------------+------------------+
+|2023-11-08T16:43:00.008+08:00|               1.0|
++-----------------------------+------------------+
+|2023-11-08T16:44:00.008+08:00|              null|
++-----------------------------+------------------+
+|2023-11-08T16:45:00.008+08:00|              null|
++-----------------------------+------------------+
+|2023-11-08T16:46:00.008+08:00|               2.0|
++-----------------------------+------------------+
+|2023-11-08T16:47:00.008+08:00|               2.0|
++-----------------------------+------------------+
+|2023-11-08T16:48:00.008+08:00|               3.0|
++-----------------------------+------------------+
+|2023-11-08T16:49:00.008+08:00|               3.0|
++-----------------------------+------------------+
+```
+
+
 ### `LINEAR` Fill
 
 **For null values in the query result set, fill the column with a linear 
interpolation of the previous non-null value and the next non-null value of the 
column.**
diff --git a/src/zh/UserGuide/Master/SQL-Manual/SQL-Manual.md 
b/src/zh/UserGuide/Master/SQL-Manual/SQL-Manual.md
index 84c9ee5..45ff773 100644
--- a/src/zh/UserGuide/Master/SQL-Manual/SQL-Manual.md
+++ b/src/zh/UserGuide/Master/SQL-Manual/SQL-Manual.md
@@ -812,12 +812,16 @@ SQL 示例:
 ```
 ### 6、结果集补空值
 ```sql
-FILL '(' PREVIOUS | LINEAR | constant ')'
+FILL '(' PREVIOUS | LINEAR | constant (, interval=DURATION_LITERAL)? ')'
 ```
 #### `PREVIOUS` 填充
 ```sql
 select temperature, status from root.sgcc.wf03.wt01 where time >= 
2017-11-01T16:37:00.000 and time <= 2017-11-01T16:40:00.000 fill(previous);
 ```
+#### `PREVIOUS` 填充并指定填充超时阈值
+```sql
+select temperature, status from root.sgcc.wf03.wt01 where time >= 
2017-11-01T16:37:00.000 and time <= 2017-11-01T16:40:00.000 fill(previous, 2m);
+```
 #### `LINEAR` 填充
 ```sql
 select temperature, status from root.sgcc.wf03.wt01 where time >= 
2017-11-01T16:37:00.000 and time <= 2017-11-01T16:40:00.000 fill(linear);
@@ -914,7 +918,7 @@ selectIntoStatement
 
 ​        [GROUP BY groupByTimeClause, groupByLevelClause]
 
-​        [FILL {PREVIOUS | LINEAR | constant}]
+​        [FILL ({PREVIOUS | LINEAR | constant} (, interval=DURATION_LITERAL)?)]
 
 ​        [LIMIT rowLimit OFFSET rowOffset]
 
@@ -1628,7 +1632,7 @@ BEGIN
         [WHERE CLAUSE]
         [GROUP BY(<group_by_interval>[, <sliding_step>]) [, level = <level>]]
         [HAVING CLAUSE]
-        [FILL {PREVIOUS | LINEAR | constant}]
+        [FILL ({PREVIOUS | LINEAR | constant} (, interval=DURATION_LITERAL)?)]
         [LIMIT rowLimit OFFSET rowOffset]
         [ALIGN BY DEVICE]
 END
diff --git a/src/zh/UserGuide/Master/User-Manual/Query-Data.md 
b/src/zh/UserGuide/Master/User-Manual/Query-Data.md
index 354e288..604490c 100644
--- a/src/zh/UserGuide/Master/User-Manual/Query-Data.md
+++ b/src/zh/UserGuide/Master/User-Manual/Query-Data.md
@@ -42,7 +42,7 @@ SELECT [LAST] selectExpr [, selectExpr] ...
     }]
     [HAVING havingCondition]
     [ORDER BY sortKey {ASC | DESC}]
-    [FILL ({PREVIOUS | LINEAR | constant})]
+    [FILL ({PREVIOUS | LINEAR | constant}) (, interval=DURATION_LITERAL)?)]
     [SLIMIT seriesLimit] [SOFFSET seriesOffset]
     [LIMIT rowLimit] [OFFSET rowOffset]
     [ALIGN BY {TIME | DEVICE}]
@@ -1929,6 +1929,129 @@ select temperature, status from root.sgcc.wf03.wt01 
where time >= 2017-11-01T16:
 Total line number = 4
 ```
 
+**在前值填充时,能够支持指定一个时间间隔,如果当前null值的时间戳与前一个非null值的时间戳的间隔,超过指定的时间间隔,则不进行填充。**
+
+> 1. 在线性填充和常量填充的情况下,如果指定了第二个参数,会抛出异常
+> 2. 时间超时参数仅支持整数
+     例如,原始数据如下所示:
+
+```sql
+select s1 from root.db.d1
+```
+```
++-----------------------------+-------------+
+|                         Time|root.db.d1.s1|
++-----------------------------+-------------+
+|2023-11-08T16:41:50.008+08:00|          1.0|
++-----------------------------+-------------+
+|2023-11-08T16:46:50.011+08:00|          2.0|
++-----------------------------+-------------+
+|2023-11-08T16:48:50.011+08:00|          3.0|
++-----------------------------+-------------+
+```
+
+根据时间分组,每1分钟求一个平均值
+
+```sql
+select avg(s1) 
+  from root.db.d1 
+  group by([2023-11-08T16:40:00.008+08:00, 2023-11-08T16:50:00.008+08:00), 1m)
+```
+```
++-----------------------------+------------------+
+|                         Time|avg(root.db.d1.s1)|
++-----------------------------+------------------+
+|2023-11-08T16:40:00.008+08:00|              null|
++-----------------------------+------------------+
+|2023-11-08T16:41:00.008+08:00|               1.0|
++-----------------------------+------------------+
+|2023-11-08T16:42:00.008+08:00|              null|
++-----------------------------+------------------+
+|2023-11-08T16:43:00.008+08:00|              null|
++-----------------------------+------------------+
+|2023-11-08T16:44:00.008+08:00|              null|
++-----------------------------+------------------+
+|2023-11-08T16:45:00.008+08:00|              null|
++-----------------------------+------------------+
+|2023-11-08T16:46:00.008+08:00|               2.0|
++-----------------------------+------------------+
+|2023-11-08T16:47:00.008+08:00|              null|
++-----------------------------+------------------+
+|2023-11-08T16:48:00.008+08:00|               3.0|
++-----------------------------+------------------+
+|2023-11-08T16:49:00.008+08:00|              null|
++-----------------------------+------------------+
+```
+
+根据时间分组并用前值填充
+
+```sql
+select avg(s1) 
+  from root.db.d1 
+  group by([2023-11-08T16:40:00.008+08:00, 2023-11-08T16:50:00.008+08:00), 1m)
+  FILL(PREVIOUS);
+```
+```
++-----------------------------+------------------+
+|                         Time|avg(root.db.d1.s1)|
++-----------------------------+------------------+
+|2023-11-08T16:40:00.008+08:00|              null|
++-----------------------------+------------------+
+|2023-11-08T16:41:00.008+08:00|               1.0|
++-----------------------------+------------------+
+|2023-11-08T16:42:00.008+08:00|               1.0|
++-----------------------------+------------------+
+|2023-11-08T16:43:00.008+08:00|               1.0|
++-----------------------------+------------------+
+|2023-11-08T16:44:00.008+08:00|               1.0|
++-----------------------------+------------------+
+|2023-11-08T16:45:00.008+08:00|               1.0|
++-----------------------------+------------------+
+|2023-11-08T16:46:00.008+08:00|               2.0|
++-----------------------------+------------------+
+|2023-11-08T16:47:00.008+08:00|               2.0|
++-----------------------------+------------------+
+|2023-11-08T16:48:00.008+08:00|               3.0|
++-----------------------------+------------------+
+|2023-11-08T16:49:00.008+08:00|               3.0|
++-----------------------------+------------------+
+```
+
+根据时间分组并用前值填充,并指定超过2分钟的就不填充
+
+```sql
+select avg(s1)
+from root.db.d1
+group by([2023-11-08T16:40:00.008+08:00, 2023-11-08T16:50:00.008+08:00), 1m)
+  FILL(PREVIOUS, 2m);
+```
+```
++-----------------------------+------------------+
+|                         Time|avg(root.db.d1.s1)|
++-----------------------------+------------------+
+|2023-11-08T16:40:00.008+08:00|              null|
++-----------------------------+------------------+
+|2023-11-08T16:41:00.008+08:00|               1.0|
++-----------------------------+------------------+
+|2023-11-08T16:42:00.008+08:00|               1.0|
++-----------------------------+------------------+
+|2023-11-08T16:43:00.008+08:00|               1.0|
++-----------------------------+------------------+
+|2023-11-08T16:44:00.008+08:00|              null|
++-----------------------------+------------------+
+|2023-11-08T16:45:00.008+08:00|              null|
++-----------------------------+------------------+
+|2023-11-08T16:46:00.008+08:00|               2.0|
++-----------------------------+------------------+
+|2023-11-08T16:47:00.008+08:00|               2.0|
++-----------------------------+------------------+
+|2023-11-08T16:48:00.008+08:00|               3.0|
++-----------------------------+------------------+
+|2023-11-08T16:49:00.008+08:00|               3.0|
++-----------------------------+------------------+
+```
+
+
 #### `LINEAR` 填充
 
 **对于查询结果集中的空值,使用该列前一个非空值和下一个非空值的线性插值进行填充。** 
diff --git a/src/zh/UserGuide/Master/stage/Query-Data/Fill.md 
b/src/zh/UserGuide/Master/stage/Query-Data/Fill.md
index 8641162..8c4f28c 100644
--- a/src/zh/UserGuide/Master/stage/Query-Data/Fill.md
+++ b/src/zh/UserGuide/Master/stage/Query-Data/Fill.md
@@ -114,6 +114,130 @@ select temperature, status from root.sgcc.wf03.wt01 where 
time >= 2017-11-01T16:
 Total line number = 4
 ```
 
+**在前值填充时,能够支持指定一个时间间隔,如果当前null值的时间戳与前一个非null值的时间戳的间隔,超过指定的时间间隔,则不进行填充。**
+
+> 1. 在线性填充和常量填充的情况下,如果指定了第二个参数,会抛出异常
+> 2. 时间超时参数仅支持整数
+
+例如,原始数据如下所示:
+
+```sql
+select s1 from root.db.d1
+```
+```
++-----------------------------+-------------+
+|                         Time|root.db.d1.s1|
++-----------------------------+-------------+
+|2023-11-08T16:41:50.008+08:00|          1.0|
++-----------------------------+-------------+
+|2023-11-08T16:46:50.011+08:00|          2.0|
++-----------------------------+-------------+
+|2023-11-08T16:48:50.011+08:00|          3.0|
++-----------------------------+-------------+
+```
+
+根据时间分组,每1分钟求一个平均值
+
+```sql
+select avg(s1) 
+  from root.db.d1 
+  group by([2023-11-08T16:40:00.008+08:00, 2023-11-08T16:50:00.008+08:00), 1m)
+```
+```
++-----------------------------+------------------+
+|                         Time|avg(root.db.d1.s1)|
++-----------------------------+------------------+
+|2023-11-08T16:40:00.008+08:00|              null|
++-----------------------------+------------------+
+|2023-11-08T16:41:00.008+08:00|               1.0|
++-----------------------------+------------------+
+|2023-11-08T16:42:00.008+08:00|              null|
++-----------------------------+------------------+
+|2023-11-08T16:43:00.008+08:00|              null|
++-----------------------------+------------------+
+|2023-11-08T16:44:00.008+08:00|              null|
++-----------------------------+------------------+
+|2023-11-08T16:45:00.008+08:00|              null|
++-----------------------------+------------------+
+|2023-11-08T16:46:00.008+08:00|               2.0|
++-----------------------------+------------------+
+|2023-11-08T16:47:00.008+08:00|              null|
++-----------------------------+------------------+
+|2023-11-08T16:48:00.008+08:00|               3.0|
++-----------------------------+------------------+
+|2023-11-08T16:49:00.008+08:00|              null|
++-----------------------------+------------------+
+```
+
+根据时间分组并用前值填充
+
+```sql
+select avg(s1) 
+  from root.db.d1 
+  group by([2023-11-08T16:40:00.008+08:00, 2023-11-08T16:50:00.008+08:00), 1m)
+  FILL(PREVIOUS);
+```
+```
++-----------------------------+------------------+
+|                         Time|avg(root.db.d1.s1)|
++-----------------------------+------------------+
+|2023-11-08T16:40:00.008+08:00|              null|
++-----------------------------+------------------+
+|2023-11-08T16:41:00.008+08:00|               1.0|
++-----------------------------+------------------+
+|2023-11-08T16:42:00.008+08:00|               1.0|
++-----------------------------+------------------+
+|2023-11-08T16:43:00.008+08:00|               1.0|
++-----------------------------+------------------+
+|2023-11-08T16:44:00.008+08:00|               1.0|
++-----------------------------+------------------+
+|2023-11-08T16:45:00.008+08:00|               1.0|
++-----------------------------+------------------+
+|2023-11-08T16:46:00.008+08:00|               2.0|
++-----------------------------+------------------+
+|2023-11-08T16:47:00.008+08:00|               2.0|
++-----------------------------+------------------+
+|2023-11-08T16:48:00.008+08:00|               3.0|
++-----------------------------+------------------+
+|2023-11-08T16:49:00.008+08:00|               3.0|
++-----------------------------+------------------+
+```
+
+根据时间分组并用前值填充,并指定超过2分钟的就不填充
+
+```sql
+select avg(s1)
+from root.db.d1
+group by([2023-11-08T16:40:00.008+08:00, 2023-11-08T16:50:00.008+08:00), 1m)
+  FILL(PREVIOUS, 2m);
+```
+```
++-----------------------------+------------------+
+|                         Time|avg(root.db.d1.s1)|
++-----------------------------+------------------+
+|2023-11-08T16:40:00.008+08:00|              null|
++-----------------------------+------------------+
+|2023-11-08T16:41:00.008+08:00|               1.0|
++-----------------------------+------------------+
+|2023-11-08T16:42:00.008+08:00|               1.0|
++-----------------------------+------------------+
+|2023-11-08T16:43:00.008+08:00|               1.0|
++-----------------------------+------------------+
+|2023-11-08T16:44:00.008+08:00|              null|
++-----------------------------+------------------+
+|2023-11-08T16:45:00.008+08:00|              null|
++-----------------------------+------------------+
+|2023-11-08T16:46:00.008+08:00|               2.0|
++-----------------------------+------------------+
+|2023-11-08T16:47:00.008+08:00|               2.0|
++-----------------------------+------------------+
+|2023-11-08T16:48:00.008+08:00|               3.0|
++-----------------------------+------------------+
+|2023-11-08T16:49:00.008+08:00|               3.0|
++-----------------------------+------------------+
+```
+
+
 ### `LINEAR` 填充
 
 **对于查询结果集中的空值,使用该列前一个非空值和下一个非空值的线性插值进行填充。** 
diff --git a/src/zh/UserGuide/latest/SQL-Manual/SQL-Manual.md 
b/src/zh/UserGuide/latest/SQL-Manual/SQL-Manual.md
index 640b666..b77beee 100644
--- a/src/zh/UserGuide/latest/SQL-Manual/SQL-Manual.md
+++ b/src/zh/UserGuide/latest/SQL-Manual/SQL-Manual.md
@@ -812,12 +812,16 @@ SQL 示例:
 ```
 ### 6、结果集补空值
 ```sql
-FILL '(' PREVIOUS | LINEAR | constant ')'
+FILL '(' PREVIOUS | LINEAR | constant (, interval=DURATION_LITERAL)? ')'
 ```
 #### `PREVIOUS` 填充
 ```sql
 select temperature, status from root.sgcc.wf03.wt01 where time >= 
2017-11-01T16:37:00.000 and time <= 2017-11-01T16:40:00.000 fill(previous);
 ```
+#### `PREVIOUS` 填充并指定填充超时阈值
+```sql
+select temperature, status from root.sgcc.wf03.wt01 where time >= 
2017-11-01T16:37:00.000 and time <= 2017-11-01T16:40:00.000 fill(previous, 2m);
+```
 #### `LINEAR` 填充
 ```sql
 select temperature, status from root.sgcc.wf03.wt01 where time >= 
2017-11-01T16:37:00.000 and time <= 2017-11-01T16:40:00.000 fill(linear);
@@ -914,7 +918,7 @@ selectIntoStatement
 
 ​        [GROUP BY groupByTimeClause, groupByLevelClause]
 
-​        [FILL {PREVIOUS | LINEAR | constant}]
+​        [FILL ({PREVIOUS | LINEAR | constant} (, interval=DURATION_LITERAL)?)]
 
 ​        [LIMIT rowLimit OFFSET rowOffset]
 
@@ -1626,7 +1630,7 @@ BEGIN
         [WHERE CLAUSE]
         [GROUP BY(<group_by_interval>[, <sliding_step>]) [, level = <level>]]
         [HAVING CLAUSE]
-        [FILL {PREVIOUS | LINEAR | constant}]
+        [FILL ({PREVIOUS | LINEAR | constant} (, interval=DURATION_LITERAL)?)]
         [LIMIT rowLimit OFFSET rowOffset]
         [ALIGN BY DEVICE]
 END
diff --git a/src/zh/UserGuide/latest/User-Manual/Query-Data.md 
b/src/zh/UserGuide/latest/User-Manual/Query-Data.md
index 354e288..604490c 100644
--- a/src/zh/UserGuide/latest/User-Manual/Query-Data.md
+++ b/src/zh/UserGuide/latest/User-Manual/Query-Data.md
@@ -42,7 +42,7 @@ SELECT [LAST] selectExpr [, selectExpr] ...
     }]
     [HAVING havingCondition]
     [ORDER BY sortKey {ASC | DESC}]
-    [FILL ({PREVIOUS | LINEAR | constant})]
+    [FILL ({PREVIOUS | LINEAR | constant}) (, interval=DURATION_LITERAL)?)]
     [SLIMIT seriesLimit] [SOFFSET seriesOffset]
     [LIMIT rowLimit] [OFFSET rowOffset]
     [ALIGN BY {TIME | DEVICE}]
@@ -1929,6 +1929,129 @@ select temperature, status from root.sgcc.wf03.wt01 
where time >= 2017-11-01T16:
 Total line number = 4
 ```
 
+**在前值填充时,能够支持指定一个时间间隔,如果当前null值的时间戳与前一个非null值的时间戳的间隔,超过指定的时间间隔,则不进行填充。**
+
+> 1. 在线性填充和常量填充的情况下,如果指定了第二个参数,会抛出异常
+> 2. 时间超时参数仅支持整数
+     例如,原始数据如下所示:
+
+```sql
+select s1 from root.db.d1
+```
+```
++-----------------------------+-------------+
+|                         Time|root.db.d1.s1|
++-----------------------------+-------------+
+|2023-11-08T16:41:50.008+08:00|          1.0|
++-----------------------------+-------------+
+|2023-11-08T16:46:50.011+08:00|          2.0|
++-----------------------------+-------------+
+|2023-11-08T16:48:50.011+08:00|          3.0|
++-----------------------------+-------------+
+```
+
+根据时间分组,每1分钟求一个平均值
+
+```sql
+select avg(s1) 
+  from root.db.d1 
+  group by([2023-11-08T16:40:00.008+08:00, 2023-11-08T16:50:00.008+08:00), 1m)
+```
+```
++-----------------------------+------------------+
+|                         Time|avg(root.db.d1.s1)|
++-----------------------------+------------------+
+|2023-11-08T16:40:00.008+08:00|              null|
++-----------------------------+------------------+
+|2023-11-08T16:41:00.008+08:00|               1.0|
++-----------------------------+------------------+
+|2023-11-08T16:42:00.008+08:00|              null|
++-----------------------------+------------------+
+|2023-11-08T16:43:00.008+08:00|              null|
++-----------------------------+------------------+
+|2023-11-08T16:44:00.008+08:00|              null|
++-----------------------------+------------------+
+|2023-11-08T16:45:00.008+08:00|              null|
++-----------------------------+------------------+
+|2023-11-08T16:46:00.008+08:00|               2.0|
++-----------------------------+------------------+
+|2023-11-08T16:47:00.008+08:00|              null|
++-----------------------------+------------------+
+|2023-11-08T16:48:00.008+08:00|               3.0|
++-----------------------------+------------------+
+|2023-11-08T16:49:00.008+08:00|              null|
++-----------------------------+------------------+
+```
+
+根据时间分组并用前值填充
+
+```sql
+select avg(s1) 
+  from root.db.d1 
+  group by([2023-11-08T16:40:00.008+08:00, 2023-11-08T16:50:00.008+08:00), 1m)
+  FILL(PREVIOUS);
+```
+```
++-----------------------------+------------------+
+|                         Time|avg(root.db.d1.s1)|
++-----------------------------+------------------+
+|2023-11-08T16:40:00.008+08:00|              null|
++-----------------------------+------------------+
+|2023-11-08T16:41:00.008+08:00|               1.0|
++-----------------------------+------------------+
+|2023-11-08T16:42:00.008+08:00|               1.0|
++-----------------------------+------------------+
+|2023-11-08T16:43:00.008+08:00|               1.0|
++-----------------------------+------------------+
+|2023-11-08T16:44:00.008+08:00|               1.0|
++-----------------------------+------------------+
+|2023-11-08T16:45:00.008+08:00|               1.0|
++-----------------------------+------------------+
+|2023-11-08T16:46:00.008+08:00|               2.0|
++-----------------------------+------------------+
+|2023-11-08T16:47:00.008+08:00|               2.0|
++-----------------------------+------------------+
+|2023-11-08T16:48:00.008+08:00|               3.0|
++-----------------------------+------------------+
+|2023-11-08T16:49:00.008+08:00|               3.0|
++-----------------------------+------------------+
+```
+
+根据时间分组并用前值填充,并指定超过2分钟的就不填充
+
+```sql
+select avg(s1)
+from root.db.d1
+group by([2023-11-08T16:40:00.008+08:00, 2023-11-08T16:50:00.008+08:00), 1m)
+  FILL(PREVIOUS, 2m);
+```
+```
++-----------------------------+------------------+
+|                         Time|avg(root.db.d1.s1)|
++-----------------------------+------------------+
+|2023-11-08T16:40:00.008+08:00|              null|
++-----------------------------+------------------+
+|2023-11-08T16:41:00.008+08:00|               1.0|
++-----------------------------+------------------+
+|2023-11-08T16:42:00.008+08:00|               1.0|
++-----------------------------+------------------+
+|2023-11-08T16:43:00.008+08:00|               1.0|
++-----------------------------+------------------+
+|2023-11-08T16:44:00.008+08:00|              null|
++-----------------------------+------------------+
+|2023-11-08T16:45:00.008+08:00|              null|
++-----------------------------+------------------+
+|2023-11-08T16:46:00.008+08:00|               2.0|
++-----------------------------+------------------+
+|2023-11-08T16:47:00.008+08:00|               2.0|
++-----------------------------+------------------+
+|2023-11-08T16:48:00.008+08:00|               3.0|
++-----------------------------+------------------+
+|2023-11-08T16:49:00.008+08:00|               3.0|
++-----------------------------+------------------+
+```
+
+
 #### `LINEAR` 填充
 
 **对于查询结果集中的空值,使用该列前一个非空值和下一个非空值的线性插值进行填充。** 
diff --git a/src/zh/UserGuide/latest/stage/Query-Data/Fill.md 
b/src/zh/UserGuide/latest/stage/Query-Data/Fill.md
index 8641162..8c4f28c 100644
--- a/src/zh/UserGuide/latest/stage/Query-Data/Fill.md
+++ b/src/zh/UserGuide/latest/stage/Query-Data/Fill.md
@@ -114,6 +114,130 @@ select temperature, status from root.sgcc.wf03.wt01 where 
time >= 2017-11-01T16:
 Total line number = 4
 ```
 
+**在前值填充时,能够支持指定一个时间间隔,如果当前null值的时间戳与前一个非null值的时间戳的间隔,超过指定的时间间隔,则不进行填充。**
+
+> 1. 在线性填充和常量填充的情况下,如果指定了第二个参数,会抛出异常
+> 2. 时间超时参数仅支持整数
+
+例如,原始数据如下所示:
+
+```sql
+select s1 from root.db.d1
+```
+```
++-----------------------------+-------------+
+|                         Time|root.db.d1.s1|
++-----------------------------+-------------+
+|2023-11-08T16:41:50.008+08:00|          1.0|
++-----------------------------+-------------+
+|2023-11-08T16:46:50.011+08:00|          2.0|
++-----------------------------+-------------+
+|2023-11-08T16:48:50.011+08:00|          3.0|
++-----------------------------+-------------+
+```
+
+根据时间分组,每1分钟求一个平均值
+
+```sql
+select avg(s1) 
+  from root.db.d1 
+  group by([2023-11-08T16:40:00.008+08:00, 2023-11-08T16:50:00.008+08:00), 1m)
+```
+```
++-----------------------------+------------------+
+|                         Time|avg(root.db.d1.s1)|
++-----------------------------+------------------+
+|2023-11-08T16:40:00.008+08:00|              null|
++-----------------------------+------------------+
+|2023-11-08T16:41:00.008+08:00|               1.0|
++-----------------------------+------------------+
+|2023-11-08T16:42:00.008+08:00|              null|
++-----------------------------+------------------+
+|2023-11-08T16:43:00.008+08:00|              null|
++-----------------------------+------------------+
+|2023-11-08T16:44:00.008+08:00|              null|
++-----------------------------+------------------+
+|2023-11-08T16:45:00.008+08:00|              null|
++-----------------------------+------------------+
+|2023-11-08T16:46:00.008+08:00|               2.0|
++-----------------------------+------------------+
+|2023-11-08T16:47:00.008+08:00|              null|
++-----------------------------+------------------+
+|2023-11-08T16:48:00.008+08:00|               3.0|
++-----------------------------+------------------+
+|2023-11-08T16:49:00.008+08:00|              null|
++-----------------------------+------------------+
+```
+
+根据时间分组并用前值填充
+
+```sql
+select avg(s1) 
+  from root.db.d1 
+  group by([2023-11-08T16:40:00.008+08:00, 2023-11-08T16:50:00.008+08:00), 1m)
+  FILL(PREVIOUS);
+```
+```
++-----------------------------+------------------+
+|                         Time|avg(root.db.d1.s1)|
++-----------------------------+------------------+
+|2023-11-08T16:40:00.008+08:00|              null|
++-----------------------------+------------------+
+|2023-11-08T16:41:00.008+08:00|               1.0|
++-----------------------------+------------------+
+|2023-11-08T16:42:00.008+08:00|               1.0|
++-----------------------------+------------------+
+|2023-11-08T16:43:00.008+08:00|               1.0|
++-----------------------------+------------------+
+|2023-11-08T16:44:00.008+08:00|               1.0|
++-----------------------------+------------------+
+|2023-11-08T16:45:00.008+08:00|               1.0|
++-----------------------------+------------------+
+|2023-11-08T16:46:00.008+08:00|               2.0|
++-----------------------------+------------------+
+|2023-11-08T16:47:00.008+08:00|               2.0|
++-----------------------------+------------------+
+|2023-11-08T16:48:00.008+08:00|               3.0|
++-----------------------------+------------------+
+|2023-11-08T16:49:00.008+08:00|               3.0|
++-----------------------------+------------------+
+```
+
+根据时间分组并用前值填充,并指定超过2分钟的就不填充
+
+```sql
+select avg(s1)
+from root.db.d1
+group by([2023-11-08T16:40:00.008+08:00, 2023-11-08T16:50:00.008+08:00), 1m)
+  FILL(PREVIOUS, 2m);
+```
+```
++-----------------------------+------------------+
+|                         Time|avg(root.db.d1.s1)|
++-----------------------------+------------------+
+|2023-11-08T16:40:00.008+08:00|              null|
++-----------------------------+------------------+
+|2023-11-08T16:41:00.008+08:00|               1.0|
++-----------------------------+------------------+
+|2023-11-08T16:42:00.008+08:00|               1.0|
++-----------------------------+------------------+
+|2023-11-08T16:43:00.008+08:00|               1.0|
++-----------------------------+------------------+
+|2023-11-08T16:44:00.008+08:00|              null|
++-----------------------------+------------------+
+|2023-11-08T16:45:00.008+08:00|              null|
++-----------------------------+------------------+
+|2023-11-08T16:46:00.008+08:00|               2.0|
++-----------------------------+------------------+
+|2023-11-08T16:47:00.008+08:00|               2.0|
++-----------------------------+------------------+
+|2023-11-08T16:48:00.008+08:00|               3.0|
++-----------------------------+------------------+
+|2023-11-08T16:49:00.008+08:00|               3.0|
++-----------------------------+------------------+
+```
+
+
 ### `LINEAR` 填充
 
 **对于查询结果集中的空值,使用该列前一个非空值和下一个非空值的线性插值进行填充。** 

Reply via email to