You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by ja...@apache.org on 2021/12/13 01:16:09 UTC

[iotdb] branch master updated: [IOTDB-2131] Change the fill syntax (#4550)

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

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


The following commit(s) were added to refs/heads/master by this push:
     new 9d241c7  [IOTDB-2131] Change the fill syntax (#4550)
9d241c7 is described below

commit 9d241c7941a6a257f993eb3acdeb248ec242d0ea
Author: CRZbulabula <33...@users.noreply.github.com>
AuthorDate: Mon Dec 13 09:15:27 2021 +0800

    [IOTDB-2131] Change the fill syntax (#4550)
---
 .../org/apache/iotdb/db/qp/sql/IoTDBSqlParser.g4   |   6 +-
 .../DML-Data-Manipulation-Language.md              | 177 +++--
 .../DML-Data-Manipulation-Language.md              | 177 +++--
 .../apache/iotdb/db/integration/IoTDBFillIT.java   | 261 +++++++-
 .../iotdb/db/integration/IoTDBGroupByFillIT.java   | 184 ++++--
 .../db/integration/IoTDBGroupByFillMixPathsIT.java | 733 ++++++++++-----------
 .../db/qp/logical/crud/FillClauseComponent.java    |   9 +
 .../db/qp/logical/crud/FillQueryOperator.java      |   2 +
 .../logical/crud/GroupByFillClauseComponent.java   |   9 +
 .../qp/logical/crud/GroupByFillQueryOperator.java  |   2 +
 .../iotdb/db/qp/physical/crud/FillQueryPlan.java   |   9 +
 .../db/qp/physical/crud/GroupByTimeFillPlan.java   |   9 +
 .../apache/iotdb/db/qp/sql/IoTDBSqlVisitor.java    | 108 ++-
 .../dataset/groupby/GroupByFillEngineDataSet.java  |  22 +-
 .../groupby/GroupByFillWithValueFilterDataSet.java |  23 +-
 .../GroupByFillWithoutValueFilterDataSet.java      |  24 +-
 .../iotdb/db/query/executor/FillQueryExecutor.java |  20 +-
 .../iotdb/db/query/executor/fill/ValueFill.java    |  44 +-
 18 files changed, 1253 insertions(+), 566 deletions(-)

diff --git a/antlr/src/main/antlr4/org/apache/iotdb/db/qp/sql/IoTDBSqlParser.g4 b/antlr/src/main/antlr4/org/apache/iotdb/db/qp/sql/IoTDBSqlParser.g4
index a151bed..eb58825 100644
--- a/antlr/src/main/antlr4/org/apache/iotdb/db/qp/sql/IoTDBSqlParser.g4
+++ b/antlr/src/main/antlr4/org/apache/iotdb/db/qp/sql/IoTDBSqlParser.g4
@@ -361,7 +361,7 @@ groupByTimeClause
 
 groupByFillClause
     : GROUP BY LR_BRACKET timeInterval COMMA DURATION_LITERAL (COMMA DURATION_LITERAL)? RR_BRACKET
-     FILL LR_BRACKET typeClause (COMMA typeClause)* RR_BRACKET
+    fillClause
     ;
 
 groupByLevelClause
@@ -369,14 +369,14 @@ groupByLevelClause
     ;
 
 fillClause
-    : FILL LR_BRACKET typeClause (COMMA typeClause)* RR_BRACKET
+    : FILL LR_BRACKET (linearClause | previousClause | specificValueClause | previousUntilLastClause | oldTypeClause (COMMA oldTypeClause)*) RR_BRACKET
     ;
 
 withoutNullClause
     : WITHOUT NULL_LITERAL (ALL | ANY)
     ;
 
-typeClause
+oldTypeClause
     : (dataType=DATATYPE_VALUE | ALL) LS_BRACKET linearClause RS_BRACKET
     | (dataType=DATATYPE_VALUE | ALL) LS_BRACKET previousClause RS_BRACKET
     | (dataType=DATATYPE_VALUE | ALL) LS_BRACKET specificValueClause RS_BRACKET
diff --git a/docs/UserGuide/IoTDB-SQL-Language/DML-Data-Manipulation-Language.md b/docs/UserGuide/IoTDB-SQL-Language/DML-Data-Manipulation-Language.md
index 0d01221..062e4cd 100644
--- a/docs/UserGuide/IoTDB-SQL-Language/DML-Data-Manipulation-Language.md
+++ b/docs/UserGuide/IoTDB-SQL-Language/DML-Data-Manipulation-Language.md
@@ -871,93 +871,163 @@ It costs 0.004s
 ```
 
 #### Down-Frequency Aggregate Query with Fill Clause
+All aggregation operators can use a uniform filling method to fill the null values
 
 In group by fill, sliding step is not supported in group by clause
 
-Now, only last_value aggregation function is supported in group by fill.
-
-Linear fill is not supported in group by fill.
-
-
 Difference Between PREVIOUSUNTILLAST And PREVIOUS:
 
 * PREVIOUS will fill any null value as long as there exist value is not null before it.
 * PREVIOUSUNTILLAST won't fill the result whose time is after the last time of that time series.
 
-first, we check value root.ln.wf01.wt01.temperature when time after 2017-11-07T23:50:00.
+first, we check value root.ln.wf01.wt01.temperature when time after 2017-11-07T23:49:00.
 
 ```
-IoTDB> SELECT temperature FROM root.ln.wf01.wt01 where time >= 2017-11-07T23:50:00
+IoTDB> SELECT temperature FROM root.ln.wf01.wt01 where time >= 2017-11-07T23:49:00
 +-----------------------------+-----------------------------+
 |                         Time|root.ln.wf01.wt01.temperature|
 +-----------------------------+-----------------------------+
-|2017-11-07T23:50:00.000+08:00|                         23.7|
+|2017-11-07T23:49:00.000+08:00|                         23.7|
 |2017-11-07T23:51:00.000+08:00|                        22.24|
-|2017-11-07T23:52:00.000+08:00|                        20.18|
 |2017-11-07T23:53:00.000+08:00|                        24.58|
 |2017-11-07T23:54:00.000+08:00|                        22.52|
-|2017-11-07T23:55:00.000+08:00|                         25.9|
-|2017-11-07T23:56:00.000+08:00|                        24.44|
 |2017-11-07T23:57:00.000+08:00|                        24.39|
-|2017-11-07T23:58:00.000+08:00|                        22.93|
-|2017-11-07T23:59:00.000+08:00|                        21.07|
+|2017-11-08T00:00:00.000+08:00|                        21.07|
 +-----------------------------+-----------------------------+
-Total line number = 10
-It costs 0.002s
+Total line number = 6
+It costs 0.010s
 ```
 
-we will find the last time and value of root.ln.wf01.wt01.temperature are 2017-11-07T23:59:00 and 21.07 respectively. 
+we will find that in root.ln.wf01.wt01.temperature the first time and value are 2017-11-07T23:49:00 and 23.7 and the last time and value are 2017-11-08T00:00:00 and 21.07 respectively. 
 
 Then execute SQL statements:
 
 ```sql
-SELECT last_value(temperature) FROM root.ln.wf01.wt01 GROUP BY([2017-11-07T23:50:00, 2017-11-08T00:01:00),1m) FILL (float[PREVIOUSUNTILLAST]);
-SELECT last_value(temperature) FROM root.ln.wf01.wt01 GROUP BY([2017-11-07T23:50:00, 2017-11-08T00:01:00),1m) FILL (float[PREVIOUS]);
+SELECT last_value(temperature) FROM root.ln.wf01.wt01 GROUP BY([2017-11-07T23:50:00, 2017-11-07T23:59:00),1m) FILL (PREVIOUSUNTILLAST);
+SELECT last_value(temperature) FROM root.ln.wf01.wt01 GROUP BY([2017-11-07T23:50:00, 2017-11-07T23:59:00),1m) FILL (PREVIOUS);
 ```
 
 result:
 
 ```
+IoTDB> SELECT last_value(temperature) FROM root.ln.wf01.wt01 GROUP BY([2017-11-07T23:50:00, 2017-11-07T23:59:00),1m) FILL (PREVIOUSUNTILLAST);
 +-----------------------------+-----------------------------------------+
 |                         Time|last_value(root.ln.wf01.wt01.temperature)|
 +-----------------------------+-----------------------------------------+
-|2017-11-07T23:50:00.000+08:00|                                     23.7|
+|2017-11-07T23:50:00.000+08:00|                                     null|
 |2017-11-07T23:51:00.000+08:00|                                    22.24|
-|2017-11-07T23:52:00.000+08:00|                                    20.18|
+|2017-11-07T23:52:00.000+08:00|                                    22.24|
 |2017-11-07T23:53:00.000+08:00|                                    24.58|
 |2017-11-07T23:54:00.000+08:00|                                    22.52|
-|2017-11-07T23:55:00.000+08:00|                                     25.9|
-|2017-11-07T23:56:00.000+08:00|                                    24.44|
+|2017-11-07T23:55:00.000+08:00|                                    22.52|
+|2017-11-07T23:56:00.000+08:00|                                    22.52|
 |2017-11-07T23:57:00.000+08:00|                                    24.39|
-|2017-11-07T23:58:00.000+08:00|                                    22.93|
-|2017-11-07T23:59:00.000+08:00|                                    21.07|
-|2017-11-08T00:00:00.000+08:00|                                     null|
+|2017-11-07T23:58:00.000+08:00|                                     null|
 +-----------------------------+-----------------------------------------+
-Total line number = 11
-It costs 0.005s
+Total line number = 9
+It costs 0.007s
 
+IoTDB> SELECT last_value(temperature) FROM root.ln.wf01.wt01 GROUP BY([2017-11-07T23:50:00, 2017-11-07T23:59:00),1m) FILL (PREVIOUS);
 +-----------------------------+-----------------------------------------+
 |                         Time|last_value(root.ln.wf01.wt01.temperature)|
 +-----------------------------+-----------------------------------------+
-|2017-11-07T23:50:00.000+08:00|                                     23.7|
+|2017-11-07T23:50:00.000+08:00|                                     null|
 |2017-11-07T23:51:00.000+08:00|                                    22.24|
-|2017-11-07T23:52:00.000+08:00|                                    20.18|
+|2017-11-07T23:52:00.000+08:00|                                    22.24|
 |2017-11-07T23:53:00.000+08:00|                                    24.58|
 |2017-11-07T23:54:00.000+08:00|                                    22.52|
-|2017-11-07T23:55:00.000+08:00|                                     25.9|
-|2017-11-07T23:56:00.000+08:00|                                    24.44|
+|2017-11-07T23:55:00.000+08:00|                                    22.52|
+|2017-11-07T23:56:00.000+08:00|                                    22.52|
 |2017-11-07T23:57:00.000+08:00|                                    24.39|
-|2017-11-07T23:58:00.000+08:00|                                    22.93|
-|2017-11-07T23:59:00.000+08:00|                                    21.07|
-|2017-11-08T00:00:00.000+08:00|                                    21.07|
+|2017-11-07T23:58:00.000+08:00|                                    24.39|
 +-----------------------------+-----------------------------------------+
-Total line number = 11
+Total line number = 9
 It costs 0.006s
 ```
 
 which means:
 
-using PREVIOUSUNTILLAST won't fill time after 2017-11-07T23:59.
+using PREVIOUSUNTILLAST won't fill time after 2017-11-07T23:57.
+
+In addition, there is no data in the first time interval [2017-11-07T23:50:00, 2017-11-07T23:51:00). The last time interval with data is [2017-11-01T23:49:00, 2017-11-07T23:50:00). The first interval can be filled by setting the forward query parameter beforeRange of PreviousFill as shown in the following example:
+
+```sql
+SELECT last_value(temperature) FROM root.ln.wf01.wt01 GROUP BY([2017-11-07T23:50:00, 2017-11-07T23:59:00),1m) FILL (PREVIOUS, 1m);
+```
+
+result:
+
+```
+IoTDB> SELECT last_value(temperature) FROM root.ln.wf01.wt01 GROUP BY([2017-11-07T23:50:00, 2017-11-07T23:59:00),1m) FILL (PREVIOUS, 1m);
++-----------------------------+-----------------------------------------+
+|                         Time|last_value(root.ln.wf01.wt01.temperature)|
++-----------------------------+-----------------------------------------+
+|2017-11-07T23:50:00.000+08:00|                                     23.7|
+|2017-11-07T23:51:00.000+08:00|                                    22.24|
+|2017-11-07T23:52:00.000+08:00|                                    22.24|
+|2017-11-07T23:53:00.000+08:00|                                    24.58|
+|2017-11-07T23:54:00.000+08:00|                                    22.52|
+|2017-11-07T23:55:00.000+08:00|                                    22.52|
+|2017-11-07T23:56:00.000+08:00|                                     null|
+|2017-11-07T23:57:00.000+08:00|                                    24.39|
+|2017-11-07T23:58:00.000+08:00|                                    24.39|
++-----------------------------+-----------------------------------------+
+Total line number = 9
+It costs 0.005s
+```
+
+explain:
+
+Because the beforeRange parameter sets the maximum value of forward query at the same time, and there is no data within the time interval [2017-11-07T23:55:00, 2017-11-07T23:57:00), [2017-11-07T23:56:00, 2017-11-07T23:57:00]. If beforeRange is not specified, PreviousFill will use the previous not null value in the query range by default
+
+Time range group aggregation query results can also be filled using VALUE and LINEAR, as shown in the following example:
+
+```sql
+SELECT last_value(temperature) FROM root.ln.wf01.wt01 GROUP BY([2017-11-07T23:50:00, 2017-11-07T23:59:00),1m) FILL (10.0);
+SELECT last_value(temperature) FROM root.ln.wf01.wt01 GROUP BY([2017-11-07T23:50:00, 2017-11-07T23:59:00),1m) FILL (LINEAR, 5m, 5m);
+```
+
+result:
+
+```
+IoTDB> SELECT last_value(temperature) FROM root.ln.wf01.wt01 GROUP BY([2017-11-07T23:50:00, 2017-11-07T23:59:00),1m) FILL (10.0);
++-----------------------------+-----------------------------------------+
+|                         Time|last_value(root.ln.wf01.wt01.temperature)|
++-----------------------------+-----------------------------------------+
+|2017-11-07T23:50:00.000+08:00|                                     10.0|
+|2017-11-07T23:51:00.000+08:00|                                    22.24|
+|2017-11-07T23:52:00.000+08:00|                                     10.0|
+|2017-11-07T23:53:00.000+08:00|                                    24.58|
+|2017-11-07T23:54:00.000+08:00|                                    22.52|
+|2017-11-07T23:55:00.000+08:00|                                     10.0|
+|2017-11-07T23:56:00.000+08:00|                                     10.0|
+|2017-11-07T23:57:00.000+08:00|                                    24.39|
+|2017-11-07T23:58:00.000+08:00|                                     10.0|
++-----------------------------+-----------------------------------------+
+Total line number = 9
+It costs 0.018s
+
+IoTDB> SELECT last_value(temperature) FROM root.ln.wf01.wt01 GROUP BY([2017-11-07T23:50:00, 2017-11-07T23:59:00),1m) FILL (LINEAR, 5m, 5m);
++-----------------------------+-----------------------------------------+
+|                         Time|last_value(root.ln.wf01.wt01.temperature)|
++-----------------------------+-----------------------------------------+
+|2017-11-07T23:50:00.000+08:00|                                22.970001|
+|2017-11-07T23:51:00.000+08:00|                                    22.24|
+|2017-11-07T23:52:00.000+08:00|                                    23.41|
+|2017-11-07T23:53:00.000+08:00|                                    24.58|
+|2017-11-07T23:54:00.000+08:00|                                    22.52|
+|2017-11-07T23:55:00.000+08:00|                                23.143333|
+|2017-11-07T23:56:00.000+08:00|                                23.766666|
+|2017-11-07T23:57:00.000+08:00|                                    24.39|
+|2017-11-07T23:58:00.000+08:00|                                23.283333|
++-----------------------------+-----------------------------------------+
+Total line number = 9
+It costs 0.008s
+```
+
+explain:
+
+Similar to PREVIOUS, LINEAR has two parameters, beforeRange and afterRange, which can be filled with data outside the query interval
 
 #### Down-Frequency Aggregate Query with Level Clause
 
@@ -1104,7 +1174,7 @@ Automated fill function refers to filling empty values according to the user's s
 When the value of the queried timestamp is null, the value of the previous timestamp is used to fill the blank. The formalized previous method is as follows (see Section 7.1.3.6 for detailed syntax):
 
 ```sql
-select <path> from <prefixPath> where time = <T> fill(<data_type>[previous, <before_range>], …)
+select <path> from <prefixPath> where time = <T> fill(previous(, <before_range>)?)
 ```
 
 Detailed descriptions of all parameters are given in Table 3-4.
@@ -1117,14 +1187,13 @@ Detailed descriptions of all parameters are given in Table 3-4.
 |:---|:---|
 |path, prefixPath|query path; mandatory field|
 |T|query timestamp (only one can be specified); mandatory field|
-|data\_type|the type of data used by the fill method. Optional values are int32, int64, float, double, boolean, text; optional field|
 |before\_range|represents the valid time range of the previous method. The previous method works when there are values in the [T-before\_range, T] range. When before\_range is not specified, before\_range takes the default value default\_fill\_interval; -1 represents infinit; optional field|
 </center>
 
 Here we give an example of filling null values using the previous method. The SQL statement is as follows:
 
 ```sql
-select temperature from root.sgcc.wf03.wt01 where time = 2017-11-01T16:37:50.000 fill(float[previous, 1s]) 
+select temperature from root.sgcc.wf03.wt01 where time = 2017-11-01T16:37:50.000 fill(previous, 1s) 
 ```
 which means:
 
@@ -1160,7 +1229,7 @@ It costs 0.004s
 When the value of the queried timestamp is null, the value of the previous and the next timestamp is used to fill the blank. The formalized linear method is as follows:
 
 ```sql
-select <path> from <prefixPath> where time = <T> fill(<data_type>[linear, <before_range>, <after_range>]…)
+select <path> from <prefixPath> where time = <T> fill(linear(, <before_range>, <after_range>)?)
 ```
 Detailed descriptions of all parameters are given in Table 3-5.
 
@@ -1172,7 +1241,6 @@ Detailed descriptions of all parameters are given in Table 3-5.
 |:---|:---|
 |path, prefixPath|query path; mandatory field|
 |T|query timestamp (only one can be specified); mandatory field|
-|data_type|the type of data used by the fill method. Optional values are int32, int64, float, double, boolean, text; optional field|
 |before\_range, after\_range|represents the valid time range of the linear method. The previous method works when there are values in the [T-before\_range, T+after\_range] range. When before\_range and after\_range are not explicitly specified, default\_fill\_interval is used. -1 represents infinity; optional field|
 </center>
 
@@ -1182,7 +1250,7 @@ Otherwise, if there is no valid fill value in either range [T-before_range,T]
 Here we give an example of filling null values using the linear method. The SQL statement is as follows:
 
 ```sql
-select temperature from root.sgcc.wf03.wt01 where time = 2017-11-01T16:37:50.000 fill(float [linear, 1m, 1m])
+select temperature from root.sgcc.wf03.wt01 where time = 2017-11-01T16:37:50.000 fill(linear, 1m, 1m)
 ```
 which means:
 
@@ -1205,7 +1273,7 @@ It costs 0.017s
 When the value of the queried timestamp is null, given fill value is used to fill the blank. The formalized value method is as follows:
 
 ```sql
-select <path> from <prefixPath> where time = <T> fill(<data_type>[constant]…)
+select <path> from <prefixPath> where time = <T> fill(constant)
 ```
 Detailed descriptions of all parameters are given in Table 3-6.
 
@@ -1217,7 +1285,6 @@ Detailed descriptions of all parameters are given in Table 3-6.
 |:---|:---|
 |path, prefixPath|query path; mandatory field|
 |T|query timestamp (only one can be specified); mandatory field|
-|data_type|the type of data used by the fill method. Optional values are int32, int64, float, double, boolean, text; optional field|
 |constant|represents given fill value|
 </center>
 
@@ -1226,7 +1293,7 @@ Detailed descriptions of all parameters are given in Table 3-6.
 Here we give an example of filling null values using the value method. The SQL statement is as follows:
 
 ```sql
-select temperature from root.sgcc.wf03.wt01 where time = 2017-11-01T16:37:50.000 fill(float [2.0])
+select temperature from root.sgcc.wf03.wt01 where time = 2017-11-01T16:37:50.000 fill(2.0)
 ```
 which means:
 
@@ -1244,6 +1311,26 @@ Total line number = 1
 It costs 0.007s
 ```
 
+When using the ValueFill, note that IoTDB will not fill the query result if the data type is different from the input constant
+
+example:
+
+```sql
+select temperature from root.sgcc.wf03.wt01 where time = 2017-11-01T16:37:50.000 fill('test')
+```
+
+result:
+
+```
++-----------------------------+-------------------------------+
+|                         Time|root.sgcc.wf03.wt01.temperature|
++-----------------------------+-------------------------------+
+|2017-11-01T16:37:50.000+08:00|                          null |
++-----------------------------+-------------------------------+
+Total line number = 1
+It costs 0.007s
+```
+
 #### Correspondence between Data Type and Fill Method
 
 Data types and the supported fill methods are shown in Table 3-6.
diff --git a/docs/zh/UserGuide/IoTDB-SQL-Language/DML-Data-Manipulation-Language.md b/docs/zh/UserGuide/IoTDB-SQL-Language/DML-Data-Manipulation-Language.md
index 5759925..79bb8c7 100644
--- a/docs/zh/UserGuide/IoTDB-SQL-Language/DML-Data-Manipulation-Language.md
+++ b/docs/zh/UserGuide/IoTDB-SQL-Language/DML-Data-Manipulation-Language.md
@@ -882,91 +882,161 @@ It costs 0.004s
 
 #### 时间区间分组聚合查询补空值
 
-时间区间分组聚合出的各个时间段的结果,支持使用前值补空。
+时间区间分组聚合出的各个时间段的结果,支持所有聚合算子使用统一的填充方式补空
 
-不允许设置滑动步长,默认为聚合时间区间,实际为定长采样。现在只支持 last_value 聚合函数。
-
-目前不支持线性插值补空值。
+不允许设置滑动步长,默认为聚合时间区间,实际为定长采样
 
 PREVIOUS 和 PREVIOUSUNTILLAST 的区别
 
-* PREVIOUS:只要空值前边有值,就会用其填充空值。
+* PREVIOUS:只要空值前边有值,就会用其填充空值
 * PREVIOUSUNTILLAST:不会填充此序列最新点后的空值
 
-首先我们检查一下 root.ln.wf01.wt01.temperature 在时间 2017-11-07T23:50:00 以后的值
+首先检查一下 root.ln.wf01.wt01.temperature 在时间 2017-11-07T23:49:00 以后的值
 
 ```
-IoTDB> SELECT temperature FROM root.ln.wf01.wt01 where time >= 2017-11-07T23:50:00
+IoTDB> SELECT temperature FROM root.ln.wf01.wt01 where time >= 2017-11-07T23:49:00
 +-----------------------------+-----------------------------+
 |                         Time|root.ln.wf01.wt01.temperature|
 +-----------------------------+-----------------------------+
-|2017-11-07T23:50:00.000+08:00|                         23.7|
+|2017-11-07T23:49:00.000+08:00|                         23.7|
 |2017-11-07T23:51:00.000+08:00|                        22.24|
-|2017-11-07T23:52:00.000+08:00|                        20.18|
 |2017-11-07T23:53:00.000+08:00|                        24.58|
 |2017-11-07T23:54:00.000+08:00|                        22.52|
-|2017-11-07T23:55:00.000+08:00|                         25.9|
-|2017-11-07T23:56:00.000+08:00|                        24.44|
 |2017-11-07T23:57:00.000+08:00|                        24.39|
-|2017-11-07T23:58:00.000+08:00|                        22.93|
-|2017-11-07T23:59:00.000+08:00|                        21.07|
+|2017-11-08T00:00:00.000+08:00|                        21.07|
 +-----------------------------+-----------------------------+
-Total line number = 10
-It costs 0.002s
+Total line number = 6
+It costs 0.010s
 ```
 
-我们发现 root.ln.wf01.wt01.temperature 的最后时间和值是 2017-11-07T23:59:00 和 21.07。
+root.ln.wf01.wt01.temperature 最早时间和值是 2017-11-07T23:49:00 和 23.7;最后时间和值是 2017-11-08T00:00:00 和 21.07
 
 SQL 示例:
 
 ```sql
-SELECT last_value(temperature) FROM root.ln.wf01.wt01 GROUP BY([2017-11-07T23:50:00, 2017-11-08T00:01:00),1m) FILL (float[PREVIOUSUNTILLAST]);
-SELECT last_value(temperature) FROM root.ln.wf01.wt01 GROUP BY([2017-11-07T23:50:00, 2017-11-08T00:01:00),1m) FILL (float[PREVIOUS]);
+SELECT last_value(temperature) FROM root.ln.wf01.wt01 GROUP BY([2017-11-07T23:50:00, 2017-11-07T23:59:00),1m) FILL (PREVIOUSUNTILLAST);
+SELECT last_value(temperature) FROM root.ln.wf01.wt01 GROUP BY([2017-11-07T23:50:00, 2017-11-07T23:59:00),1m) FILL (PREVIOUS);
 ```
 
 结果:
 
 ```
+IoTDB> SELECT last_value(temperature) FROM root.ln.wf01.wt01 GROUP BY([2017-11-07T23:50:00, 2017-11-07T23:59:00),1m) FILL (PREVIOUSUNTILLAST);
++-----------------------------+-----------------------------------------+
+|                         Time|last_value(root.ln.wf01.wt01.temperature)|
++-----------------------------+-----------------------------------------+
+|2017-11-07T23:50:00.000+08:00|                                     null|
+|2017-11-07T23:51:00.000+08:00|                                    22.24|
+|2017-11-07T23:52:00.000+08:00|                                    22.24|
+|2017-11-07T23:53:00.000+08:00|                                    24.58|
+|2017-11-07T23:54:00.000+08:00|                                    22.52|
+|2017-11-07T23:55:00.000+08:00|                                    22.52|
+|2017-11-07T23:56:00.000+08:00|                                    22.52|
+|2017-11-07T23:57:00.000+08:00|                                    24.39|
+|2017-11-07T23:58:00.000+08:00|                                     null|
++-----------------------------+-----------------------------------------+
+Total line number = 9
+It costs 0.007s
+
+IoTDB> SELECT last_value(temperature) FROM root.ln.wf01.wt01 GROUP BY([2017-11-07T23:50:00, 2017-11-07T23:59:00),1m) FILL (PREVIOUS);
++-----------------------------+-----------------------------------------+
+|                         Time|last_value(root.ln.wf01.wt01.temperature)|
++-----------------------------+-----------------------------------------+
+|2017-11-07T23:50:00.000+08:00|                                     null|
+|2017-11-07T23:51:00.000+08:00|                                    22.24|
+|2017-11-07T23:52:00.000+08:00|                                    22.24|
+|2017-11-07T23:53:00.000+08:00|                                    24.58|
+|2017-11-07T23:54:00.000+08:00|                                    22.52|
+|2017-11-07T23:55:00.000+08:00|                                    22.52|
+|2017-11-07T23:56:00.000+08:00|                                    22.52|
+|2017-11-07T23:57:00.000+08:00|                                    24.39|
+|2017-11-07T23:58:00.000+08:00|                                    24.39|
++-----------------------------+-----------------------------------------+
+Total line number = 9
+It costs 0.006s
+```
+
+解释:
+
+使用 PREVIOUSUNTILLAST 将不会填充 2017-11-07T23:57:00 以后的值。
+
+此外,第一个时间区间 [2017-11-07T23:50:00, 2017-11-07T23:51:00) 内没有任何数据,上一个有数据的时间区间是 [2017-11-01T23:49:00, 2017-11-07T23:50:00),可以通过设置 PREVIOUS 填充向前查询参数 beforeRange 来填充第一个区间的数据,示例如下:
+
+```sql
+SELECT last_value(temperature) FROM root.ln.wf01.wt01 GROUP BY([2017-11-07T23:50:00, 2017-11-07T23:59:00),1m) FILL (PREVIOUS, 1m);
+```
+
+结果:
+```
+IoTDB> SELECT last_value(temperature) FROM root.ln.wf01.wt01 GROUP BY([2017-11-07T23:50:00, 2017-11-07T23:59:00),1m) FILL (PREVIOUS, 1m);
 +-----------------------------+-----------------------------------------+
 |                         Time|last_value(root.ln.wf01.wt01.temperature)|
 +-----------------------------+-----------------------------------------+
 |2017-11-07T23:50:00.000+08:00|                                     23.7|
 |2017-11-07T23:51:00.000+08:00|                                    22.24|
-|2017-11-07T23:52:00.000+08:00|                                    20.18|
+|2017-11-07T23:52:00.000+08:00|                                    22.24|
 |2017-11-07T23:53:00.000+08:00|                                    24.58|
 |2017-11-07T23:54:00.000+08:00|                                    22.52|
-|2017-11-07T23:55:00.000+08:00|                                     25.9|
-|2017-11-07T23:56:00.000+08:00|                                    24.44|
+|2017-11-07T23:55:00.000+08:00|                                    22.52|
+|2017-11-07T23:56:00.000+08:00|                                     null|
 |2017-11-07T23:57:00.000+08:00|                                    24.39|
-|2017-11-07T23:58:00.000+08:00|                                    22.93|
-|2017-11-07T23:59:00.000+08:00|                                    21.07|
-|2017-11-08T00:00:00.000+08:00|                                     null|
+|2017-11-07T23:58:00.000+08:00|                                    24.39|
 +-----------------------------+-----------------------------------------+
-Total line number = 11
+Total line number = 9
 It costs 0.005s
+```
 
+解释:
+
+因为 beforeRange 参数同时设定了向前查询的最大值,而时间区间 [2017-11-07T23:55:00, 2017-11-07T23:57:00) 内均没有数据,所以不填充 [2017-11-07T23:56:00, 2017-11-07T23:57:00)。在不指定 beforeRange 时,前值填充默认使用查询范围内上一个非空值
+
+时间区间分组聚合查询结果也支持使用 VALUE 和 LINEAR 方式进行填充,示例如下:
+
+```sql
+SELECT last_value(temperature) FROM root.ln.wf01.wt01 GROUP BY([2017-11-07T23:50:00, 2017-11-07T23:59:00),1m) FILL (10.0);
+SELECT last_value(temperature) FROM root.ln.wf01.wt01 GROUP BY([2017-11-07T23:50:00, 2017-11-07T23:59:00),1m) FILL (LINEAR, 5m, 5m);
+```
+
+结果:
+```
+IoTDB> SELECT last_value(temperature) FROM root.ln.wf01.wt01 GROUP BY([2017-11-07T23:50:00, 2017-11-07T23:59:00),1m) FILL (10.0);
 +-----------------------------+-----------------------------------------+
 |                         Time|last_value(root.ln.wf01.wt01.temperature)|
 +-----------------------------+-----------------------------------------+
-|2017-11-07T23:50:00.000+08:00|                                     23.7|
+|2017-11-07T23:50:00.000+08:00|                                     10.0|
 |2017-11-07T23:51:00.000+08:00|                                    22.24|
-|2017-11-07T23:52:00.000+08:00|                                    20.18|
+|2017-11-07T23:52:00.000+08:00|                                     10.0|
 |2017-11-07T23:53:00.000+08:00|                                    24.58|
 |2017-11-07T23:54:00.000+08:00|                                    22.52|
-|2017-11-07T23:55:00.000+08:00|                                     25.9|
-|2017-11-07T23:56:00.000+08:00|                                    24.44|
+|2017-11-07T23:55:00.000+08:00|                                     10.0|
+|2017-11-07T23:56:00.000+08:00|                                     10.0|
 |2017-11-07T23:57:00.000+08:00|                                    24.39|
-|2017-11-07T23:58:00.000+08:00|                                    22.93|
-|2017-11-07T23:59:00.000+08:00|                                    21.07|
-|2017-11-08T00:00:00.000+08:00|                                    21.07|
+|2017-11-07T23:58:00.000+08:00|                                     10.0|
 +-----------------------------+-----------------------------------------+
-Total line number = 11
-It costs 0.006s
+Total line number = 9
+It costs 0.018s
+
+IoTDB> SELECT last_value(temperature) FROM root.ln.wf01.wt01 GROUP BY([2017-11-07T23:50:00, 2017-11-07T23:59:00),1m) FILL (LINEAR, 5m, 5m);
++-----------------------------+-----------------------------------------+
+|                         Time|last_value(root.ln.wf01.wt01.temperature)|
++-----------------------------+-----------------------------------------+
+|2017-11-07T23:50:00.000+08:00|                                22.970001|
+|2017-11-07T23:51:00.000+08:00|                                    22.24|
+|2017-11-07T23:52:00.000+08:00|                                    23.41|
+|2017-11-07T23:53:00.000+08:00|                                    24.58|
+|2017-11-07T23:54:00.000+08:00|                                    22.52|
+|2017-11-07T23:55:00.000+08:00|                                23.143333|
+|2017-11-07T23:56:00.000+08:00|                                23.766666|
+|2017-11-07T23:57:00.000+08:00|                                    24.39|
+|2017-11-07T23:58:00.000+08:00|                                23.283333|
++-----------------------------+-----------------------------------------+
+Total line number = 9
+It costs 0.008s
 ```
 
 解释:
 
-使用 PREVIOUSUNTILLAST 将不会填充 2017-11-07T23:59:00 以后的值。
+类似 PREVIOUS 方法,LINEAR 方法有 beforeRange 和 afterRange 两个参数,同时设置时可以使用查询区间外的数据进行填充
 
 #### 时间区间和路径层级分组聚合查询
 
@@ -1110,7 +1180,7 @@ It costs 0.012s
 当查询的时间戳值为空时,将使用前一个时间戳的值来填充空白。 形式化的先前方法如下(有关详细语法,请参见第 7.1.3.6 节):
 
 ```sql
-select <path> from <prefixPath> where time = <T> fill(<data_type>[previous, <before_range>], …)
+select <path> from <prefixPath> where time = <T> fill(previous(, <before_range>)?)
 ```
 
 表 3-4 给出了所有参数的详细说明。
@@ -1123,15 +1193,14 @@ select <path> from <prefixPath> where time = <T> fill(<data_type>[previous, <bef
 | :----------------------- | :----------------------------------------------------------- |
 | path, prefixPath         | 查询路径; 必填项                                            |
 | T                        | 查询时间戳(只能指定一个); 必填项                          |
-| data\_type               | 填充方法使用的数据类型。 可选值是 int32,int64,float,double,boolean,text; 可选字段 |
-| before\_range            | 表示前一种方法的有效时间范围。 当 [T-before \ _range,T] 范围内的值存在时,前一种方法将起作用。 如果未指定 before_range,则 before_range 会使用默认值 default_fill_interval; -1 表示无穷大; 可选字段 |
+| before\_range            | 表示前一种方法的有效时间范围。 当 [T-before\_range,T] 范围内的值存在时,前一种方法将起作用。 如果未指定 before_range,则 before_range 会使用默认值 default_fill_interval; -1 表示无穷大; 可选字段 |
 
 </center>
 
 在这里,我们举一个使用先前方法填充空值的示例。 SQL 语句如下:
 
 ```sql
-select temperature from root.sgcc.wf03.wt01 where time = 2017-11-01T16:37:50.000 fill(float[previous, 1m]) 
+select temperature from root.sgcc.wf03.wt01 where time = 2017-11-01T16:37:50.000 fill(previous, 1m) 
 ```
 
 意思是:
@@ -1168,7 +1237,7 @@ It costs 0.004s
 当查询的时间戳值为空时,将使用前一个和下一个时间戳的值来填充空白。 形式化线性方法如下:
 
 ```sql
-select <path> from <prefixPath> where time = <T> fill(<data_type>[linear, <before_range>, <after_range>]…)
+select <path> from <prefixPath> where time = <T> fill(linear(, <before_range>, <after_range>)?)
 ```
 
 表 3-5 中给出了所有参数的详细说明。
@@ -1181,8 +1250,7 @@ select <path> from <prefixPath> where time = <T> fill(<data_type>[linear, <befor
 | :-------------------------- | :----------------------------------------------------------- |
 | path, prefixPath            | 查询路径; 必填项                                            |
 | T                           | 查询时间戳(只能指定一个); 必填项                          |
-| data_type                   | 填充方法使用的数据类型。 可选值是 int32,int64,float,double,boolean,text; 可选字段 |
-| before\_range, after\_range | 表示线性方法的有效时间范围。 当 [T-before_range,T + after_range] 范围内的值存在时,前一种方法将起作用。 如果未明确指定 before_range 和 after_range,则使用 default\_fill\_interval。 -1 表示无穷大; 可选字段 |
+| before\_range, after\_range | 表示线性方法的有效时间范围。 当 [T-before\_range,T + after\_range] 范围内的值存在时,前一种方法将起作用。 如果未明确指定 before\_range 和 after\_range,则使用 default\_fill\_interval。 -1 表示无穷大; 可选字段 |
 
 </center>
 
@@ -1192,7 +1260,7 @@ select <path> from <prefixPath> where time = <T> fill(<data_type>[linear, <befor
 在这里,我们举一个使用线性方法填充空值的示例。 SQL 语句如下:
 
 ```sql
-select temperature from root.sgcc.wf03.wt01 where time = 2017-11-01T16:37:50.000 fill(float [linear, 1m, 1m])
+select temperature from root.sgcc.wf03.wt01 where time = 2017-11-01T16:37:50.000 fill(linear, 1m, 1m)
 ```
 
 意思是:
@@ -1218,7 +1286,7 @@ It costs 0.017s
 当查询的时间戳值为空时,将使用给定的值来填充空白。 特定值填充方法如下:
 
 ```sql
-select <path> from <prefixPath> where time = <T> fill(<data_type>[constant]…)
+select <path> from <prefixPath> where time = <T> fill(constant)
 ```
 
 表3-6中给出了所有参数的详细说明。
@@ -1231,7 +1299,6 @@ select <path> from <prefixPath> where time = <T> fill(<data_type>[constant]…)
 | :-------------------------- | :----------------------------------------------------------- |
 | path, prefixPath            | 查询路径; 必填项                                            |
 | T                           | 查询时间戳(只能指定一个); 必填项                          |
-| data_type                   | 填充方法使用的数据类型。 可选值是int32,int64,float,double,boolean,text; 可选字段 |
 | constant                    | 给定的填充值                                          |
 
 </center>
@@ -1242,7 +1309,7 @@ select <path> from <prefixPath> where time = <T> fill(<data_type>[constant]…)
 在这里,我们举一个使用特定值方法填充空值的示例。 SQL语句如下:
 
 ```sql
-select temperature from root.sgcc.wf03.wt01 where time = 2017-11-01T16:37:50.000 fill(float [2.0])
+select temperature from root.sgcc.wf03.wt01 where time = 2017-11-01T16:37:50.000 fill(2.0)
 ```
 
 意思是:
@@ -1261,6 +1328,24 @@ Total line number = 1
 It costs 0.007s
 ```
 
+在使用 VALUE 方法填充时需要注意,如果查询结果的数据类型与输入常量值不同,IoTDB 将不进行填充
+
+示例:
+```sql
+select temperature from root.sgcc.wf03.wt01 where time = 2017-11-01T16:37:50.000 fill('test')
+```
+
+结果:
+```
++-----------------------------+-------------------------------+
+|                         Time|root.sgcc.wf03.wt01.temperature|
++-----------------------------+-------------------------------+
+|2017-11-01T16:37:50.000+08:00|                          null |
++-----------------------------+-------------------------------+
+Total line number = 1
+It costs 0.007s
+```
+
 #### 数据类型和填充方法之间的对应关系
 
 数据类型和支持的填充方法如表 3-6 所示。
diff --git a/integration/src/test/java/org/apache/iotdb/db/integration/IoTDBFillIT.java b/integration/src/test/java/org/apache/iotdb/db/integration/IoTDBFillIT.java
index 1ac2d91..060d2d1 100644
--- a/integration/src/test/java/org/apache/iotdb/db/integration/IoTDBFillIT.java
+++ b/integration/src/test/java/org/apache/iotdb/db/integration/IoTDBFillIT.java
@@ -189,7 +189,7 @@ public class IoTDBFillIT {
   }
 
   @Test
-  public void LinearFillCommonTest() {
+  public void oldTypeLinearFillCommonTest() {
     String[] retArray1 =
         new String[] {"3,3.3,false,33", "70,70.34,false,374", "70,70.34,false,374"};
     try (Connection connection = EnvFactory.getEnv().getConnection();
@@ -271,6 +271,87 @@ public class IoTDBFillIT {
   }
 
   @Test
+  public void LinearFillCommonTest() {
+    String[] retArray1 = new String[] {"3,3.3,false,33", "70,70.34,null,374", "70,70.34,null,374"};
+    try (Connection connection = EnvFactory.getEnv().getConnection();
+        Statement statement = connection.createStatement()) {
+
+      boolean hasResultSet =
+          statement.execute(
+              "select temperature, status, hardware from "
+                  + "root.ln.wf01.wt01 where time = 3 "
+                  + "Fill(linear, 5ms, 5ms)");
+
+      Assert.assertTrue(hasResultSet);
+
+      ResultSet resultSet = statement.getResultSet();
+      int cnt = 0;
+      try {
+        while (resultSet.next()) {
+          String ans =
+              resultSet.getString(TIMESTAMP_STR)
+                  + ","
+                  + resultSet.getString(TEMPERATURE_STR_1)
+                  + ","
+                  + resultSet.getString(STATUS_STR_1)
+                  + ","
+                  + resultSet.getString(HARDWARE_STR);
+          Assert.assertEquals(retArray1[cnt], ans);
+          cnt++;
+        }
+
+        hasResultSet =
+            statement.execute(
+                "select temperature, status, hardware "
+                    + "from root.ln.wf01.wt01 where time = 70 "
+                    + "Fill(linear, 500ms, 500ms)");
+
+        Assert.assertTrue(hasResultSet);
+        resultSet = statement.getResultSet();
+        while (resultSet.next()) {
+          String ans =
+              resultSet.getString(TIMESTAMP_STR)
+                  + ","
+                  + resultSet.getString(TEMPERATURE_STR_1)
+                  + ","
+                  + resultSet.getString(STATUS_STR_1)
+                  + ","
+                  + resultSet.getString(HARDWARE_STR);
+          Assert.assertEquals(retArray1[cnt], ans);
+          cnt++;
+        }
+
+        hasResultSet =
+            statement.execute(
+                "select temperature, status, hardware "
+                    + "from root.ln.wf01.wt01 where time = 70 "
+                    + "Fill(linear)");
+
+        Assert.assertTrue(hasResultSet);
+        resultSet = statement.getResultSet();
+        while (resultSet.next()) {
+          String ans =
+              resultSet.getString(TIMESTAMP_STR)
+                  + ","
+                  + resultSet.getString(TEMPERATURE_STR_1)
+                  + ","
+                  + resultSet.getString(STATUS_STR_1)
+                  + ","
+                  + resultSet.getString(HARDWARE_STR);
+          Assert.assertEquals(retArray1[cnt], ans);
+          cnt++;
+        }
+      } finally {
+        resultSet.close();
+      }
+
+    } catch (Exception e) {
+      e.printStackTrace();
+      fail(e.getMessage());
+    }
+  }
+
+  @Test
   public void LinearFillWithBeforeOrAfterValueNullTest() {
     String[] retArray1 =
         new String[] {"70,null,null,null", "80,null,null,null", "625,null,false,null"};
@@ -351,7 +432,7 @@ public class IoTDBFillIT {
   }
 
   @Test
-  public void valueFillTest() {
+  public void oldTypeValueFillTest() {
     String res = "7,7.0,true,7";
     try (Connection connection = EnvFactory.getEnv().getConnection();
         Statement statement = connection.createStatement()) {
@@ -382,6 +463,99 @@ public class IoTDBFillIT {
   }
 
   @Test
+  public void valueFillTest() {
+    String res = "7,7.0,null,7";
+    try (Connection connection = EnvFactory.getEnv().getConnection();
+        Statement statement = connection.createStatement()) {
+
+      boolean hasResultSet =
+          statement.execute(
+              "select temperature, status, hardware "
+                  + "from root.ln.wf01.wt01 where time = 7 "
+                  + "Fill(7)");
+
+      Assert.assertTrue(hasResultSet);
+      ResultSet resultSet = statement.getResultSet();
+      while (resultSet.next()) {
+        String ans =
+            resultSet.getString(TIMESTAMP_STR)
+                + ","
+                + resultSet.getString(TEMPERATURE_STR_1)
+                + ","
+                + resultSet.getString(STATUS_STR_1)
+                + ","
+                + resultSet.getString(HARDWARE_STR);
+        Assert.assertEquals(res, ans);
+      }
+    } catch (Exception e) {
+      e.printStackTrace();
+      fail(e.getMessage());
+    }
+  }
+
+  @Test
+  public void stringValueFillTest() {
+    String res = "7,null,null,null";
+    try (Connection connection = EnvFactory.getEnv().getConnection();
+        Statement statement = connection.createStatement()) {
+
+      boolean hasResultSet =
+          statement.execute(
+              "select temperature, status, hardware "
+                  + "from root.ln.wf01.wt01 where time = 7 "
+                  + "Fill('test string')");
+
+      Assert.assertTrue(hasResultSet);
+      ResultSet resultSet = statement.getResultSet();
+      while (resultSet.next()) {
+        String ans =
+            resultSet.getString(TIMESTAMP_STR)
+                + ","
+                + resultSet.getString(TEMPERATURE_STR_1)
+                + ","
+                + resultSet.getString(STATUS_STR_1)
+                + ","
+                + resultSet.getString(HARDWARE_STR);
+        Assert.assertEquals(res, ans);
+      }
+    } catch (Exception e) {
+      e.printStackTrace();
+      fail(e.getMessage());
+    }
+  }
+
+  @Test
+  public void boolValueFillTest() {
+    String res = "7,null,true,null";
+    try (Connection connection = EnvFactory.getEnv().getConnection();
+        Statement statement = connection.createStatement()) {
+
+      boolean hasResultSet =
+          statement.execute(
+              "select temperature, status, hardware "
+                  + "from root.ln.wf01.wt01 where time = 7 "
+                  + "Fill(true)");
+
+      Assert.assertTrue(hasResultSet);
+      ResultSet resultSet = statement.getResultSet();
+      while (resultSet.next()) {
+        String ans =
+            resultSet.getString(TIMESTAMP_STR)
+                + ","
+                + resultSet.getString(TEMPERATURE_STR_1)
+                + ","
+                + resultSet.getString(STATUS_STR_1)
+                + ","
+                + resultSet.getString(HARDWARE_STR);
+        Assert.assertEquals(res, ans);
+      }
+    } catch (Exception e) {
+      e.printStackTrace();
+      fail(e.getMessage());
+    }
+  }
+
+  @Test
   public void valueFillNonNullTest() {
     String res = "1,1.1,false,11";
     try (Connection connection = EnvFactory.getEnv().getConnection();
@@ -413,7 +587,7 @@ public class IoTDBFillIT {
   }
 
   @Test
-  public void PreviousFillTest() {
+  public void oldTypePreviousFillTest() {
     String[] retArray1 = new String[] {"3,3.3,false,33", "70,50.5,false,550", "70,null,null,null"};
     try (Connection connection = EnvFactory.getEnv().getConnection();
         Statement statement = connection.createStatement()) {
@@ -494,6 +668,87 @@ public class IoTDBFillIT {
   }
 
   @Test
+  public void PreviousFillTest() {
+    String[] retArray1 = new String[] {"3,3.3,false,33", "70,50.5,false,550", "70,null,null,null"};
+    try (Connection connection = EnvFactory.getEnv().getConnection();
+        Statement statement = connection.createStatement()) {
+
+      boolean hasResultSet =
+          statement.execute(
+              "select temperature,status, hardware "
+                  + "from root.ln.wf01.wt01 where time = 3 "
+                  + "Fill(previous, 5ms)");
+
+      Assert.assertTrue(hasResultSet);
+      int cnt;
+      ResultSet resultSet = statement.getResultSet();
+      try {
+        cnt = 0;
+        while (resultSet.next()) {
+          String ans =
+              resultSet.getString(TIMESTAMP_STR)
+                  + ","
+                  + resultSet.getString(TEMPERATURE_STR_1)
+                  + ","
+                  + resultSet.getString(STATUS_STR_1)
+                  + ","
+                  + resultSet.getString(HARDWARE_STR);
+          Assert.assertEquals(retArray1[cnt], ans);
+          cnt++;
+        }
+
+        hasResultSet =
+            statement.execute(
+                "select temperature,status, hardware "
+                    + "from root.ln.wf01.wt01 where time = 70 "
+                    + "Fill(previous, 500ms)");
+
+        Assert.assertTrue(hasResultSet);
+        resultSet = statement.getResultSet();
+        while (resultSet.next()) {
+          String ans =
+              resultSet.getString(TIMESTAMP_STR)
+                  + ","
+                  + resultSet.getString(TEMPERATURE_STR_1)
+                  + ","
+                  + resultSet.getString(STATUS_STR_1)
+                  + ","
+                  + resultSet.getString(HARDWARE_STR);
+          Assert.assertEquals(retArray1[cnt], ans);
+          cnt++;
+        }
+
+        hasResultSet =
+            statement.execute(
+                "select temperature,status, hardware "
+                    + "from root.ln.wf01.wt01 where time = 70 "
+                    + "Fill(previous, 5ms)");
+
+        Assert.assertTrue(hasResultSet);
+        resultSet = statement.getResultSet();
+        while (resultSet.next()) {
+          String ans =
+              resultSet.getString(TIMESTAMP_STR)
+                  + ","
+                  + resultSet.getString(TEMPERATURE_STR_1)
+                  + ","
+                  + resultSet.getString(STATUS_STR_1)
+                  + ","
+                  + resultSet.getString(HARDWARE_STR);
+          Assert.assertEquals(retArray1[cnt], ans);
+          cnt++;
+        }
+        Assert.assertEquals(retArray1.length, cnt);
+      } finally {
+        resultSet.close();
+      }
+    } catch (Exception e) {
+      e.printStackTrace();
+      fail(e.getMessage());
+    }
+  }
+
+  @Test
   public void EmptyTimeRangeFillTest() {
     String[] retArray1 = new String[] {"3,3.3,false,33", "70,70.34,false,374"};
     try (Connection connection = EnvFactory.getEnv().getConnection();
diff --git a/integration/src/test/java/org/apache/iotdb/db/integration/IoTDBGroupByFillIT.java b/integration/src/test/java/org/apache/iotdb/db/integration/IoTDBGroupByFillIT.java
index 2e81fc7..9647d66 100644
--- a/integration/src/test/java/org/apache/iotdb/db/integration/IoTDBGroupByFillIT.java
+++ b/integration/src/test/java/org/apache/iotdb/db/integration/IoTDBGroupByFillIT.java
@@ -88,7 +88,7 @@ public class IoTDBGroupByFillIT {
   }
 
   @Test
-  public void previousLastValueTest() {
+  public void oldTypePreviousLastValueTest() {
     String[] retArray =
         new String[] {"17,null", "22,23", "27,23", "32,24", "37,24", "42,24", "47,30", "52,30"};
 
@@ -152,7 +152,7 @@ public class IoTDBGroupByFillIT {
               "select last_value(temperature) from "
                   + "root.ln.wf01.wt01 "
                   + "WHERE temperature > 25 "
-                  + "GROUP BY ([17, 55), 5ms) FILL(int32[previous])");
+                  + "GROUP BY ([17, 55), 5ms) FILL(previous)");
       assertTrue(hasResultSet);
       int cnt;
       try (ResultSet resultSet = statement.getResultSet()) {
@@ -173,7 +173,7 @@ public class IoTDBGroupByFillIT {
               "select last_value(temperature) from "
                   + "root.ln.wf01.wt01 "
                   + "WHERE temperature > 25 "
-                  + "GROUP BY ([17, 55), 5ms) FILL(int32[previous]) order by time desc");
+                  + "GROUP BY ([17, 55), 5ms) FILL(previous) order by time desc");
       assertTrue(hasResultSet);
       try (ResultSet resultSet = statement.getResultSet()) {
         cnt = 0;
@@ -194,7 +194,7 @@ public class IoTDBGroupByFillIT {
   }
 
   @Test
-  public void previousFirstValueTest() {
+  public void oldTypePreviousFirstValueTest() {
     String[] retArray =
         new String[] {
           "17,null", "22,34.9", "27,34.9", "32,44.6", "37,44.6", "42,44.6", "47,54.6", "52,54.6"
@@ -262,7 +262,7 @@ public class IoTDBGroupByFillIT {
           statement.execute(
               "select avg(hardware) from "
                   + "root.ln.wf01.wt01 "
-                  + "GROUP BY ([17, 55), 5ms) FILL(double[previous])");
+                  + "GROUP BY ([17, 55), 5ms) FILL(previous)");
       assertTrue(hasResultSet);
       int cnt;
       try (ResultSet resultSet = statement.getResultSet()) {
@@ -282,7 +282,7 @@ public class IoTDBGroupByFillIT {
           statement.execute(
               "select avg(hardware) from "
                   + "root.ln.wf01.wt01 "
-                  + "GROUP BY ([17, 55), 5ms) FILL(double[previous]) order by time desc");
+                  + "GROUP BY ([17, 55), 5ms) FILL(previous) order by time desc");
       assertTrue(hasResultSet);
       try (ResultSet resultSet = statement.getResultSet()) {
         cnt = 0;
@@ -303,7 +303,7 @@ public class IoTDBGroupByFillIT {
   }
 
   @Test
-  public void previousAvgWithValueFilterTest() {
+  public void oldTypePreviousAvgWithValueFilterTest() {
     String[] retArray =
         new String[] {
           "17,null", "22,null", "27,null", "32,44.7", "37,44.7", "42,44.7", "47,55.2", "52,55.2"
@@ -370,7 +370,7 @@ public class IoTDBGroupByFillIT {
           statement.execute(
               "select count(status) from "
                   + "root.ln.wf01.wt01 "
-                  + "GROUP BY ([17, 55), 5ms) FILL(int64[previous])");
+                  + "GROUP BY ([17, 55), 5ms) FILL(previous)");
       assertTrue(hasResultSet);
       int cnt;
       try (ResultSet resultSet = statement.getResultSet()) {
@@ -390,7 +390,7 @@ public class IoTDBGroupByFillIT {
           statement.execute(
               "select count(status) from "
                   + "root.ln.wf01.wt01 "
-                  + "GROUP BY ([17, 55), 5ms) FILL(int64[previous]) order by time desc");
+                  + "GROUP BY ([17, 55), 5ms) FILL(previous) order by time desc");
       assertTrue(hasResultSet);
       try (ResultSet resultSet = statement.getResultSet()) {
         cnt = 0;
@@ -423,7 +423,7 @@ public class IoTDBGroupByFillIT {
               "select count(status) from "
                   + "root.ln.wf01.wt01 "
                   + "WHERE status = true "
-                  + "GROUP BY ([17, 55), 5ms) FILL(int64[previous])");
+                  + "GROUP BY ([17, 55), 5ms) FILL(previous)");
       assertTrue(hasResultSet);
       int cnt;
       try (ResultSet resultSet = statement.getResultSet()) {
@@ -444,7 +444,7 @@ public class IoTDBGroupByFillIT {
               "select count(status) from "
                   + "root.ln.wf01.wt01 "
                   + "WHERE status = true "
-                  + "GROUP BY ([17, 55), 5ms) FILL(int64[previous]) order by time desc");
+                  + "GROUP BY ([17, 55), 5ms) FILL(previous) order by time desc");
       assertTrue(hasResultSet);
       try (ResultSet resultSet = statement.getResultSet()) {
         cnt = 0;
@@ -476,7 +476,7 @@ public class IoTDBGroupByFillIT {
           statement.execute(
               "select max_time(hardware) from "
                   + "root.ln.wf01.wt01 "
-                  + "GROUP BY ([17, 55), 5ms) FILL(int64[previous])");
+                  + "GROUP BY ([17, 55), 5ms) FILL(previous)");
       assertTrue(hasResultSet);
       int cnt;
       try (ResultSet resultSet = statement.getResultSet()) {
@@ -496,7 +496,7 @@ public class IoTDBGroupByFillIT {
           statement.execute(
               "select max_time(hardware) from "
                   + "root.ln.wf01.wt01 "
-                  + "GROUP BY ([17, 55), 5ms) FILL(int64[previous]) order by time desc");
+                  + "GROUP BY ([17, 55), 5ms) FILL(previous) order by time desc");
       assertTrue(hasResultSet);
       try (ResultSet resultSet = statement.getResultSet()) {
         cnt = 0;
@@ -517,7 +517,7 @@ public class IoTDBGroupByFillIT {
   }
 
   @Test
-  public void previousMaxValueTest() {
+  public void oldTypePreviousMaxValueTest() {
     String[] retArray =
         new String[] {"17,null", "22,28", "27,28", "32,29", "37,29", "42,29", "47,30", "52,30"};
 
@@ -580,7 +580,7 @@ public class IoTDBGroupByFillIT {
           statement.execute(
               "select min_time(hardware) from "
                   + "root.ln.wf01.wt01 "
-                  + "GROUP BY ([17, 55), 5ms) FILL(int64[previous])");
+                  + "GROUP BY ([17, 55), 5ms) FILL(previous)");
       assertTrue(hasResultSet);
       int cnt;
       try (ResultSet resultSet = statement.getResultSet()) {
@@ -600,7 +600,7 @@ public class IoTDBGroupByFillIT {
           statement.execute(
               "select min_time(hardware) from "
                   + "root.ln.wf01.wt01 "
-                  + "GROUP BY ([17, 55), 5ms) FILL(int64[previous]) order by time desc");
+                  + "GROUP BY ([17, 55), 5ms) FILL(previous) order by time desc");
       assertTrue(hasResultSet);
       try (ResultSet resultSet = statement.getResultSet()) {
         cnt = 0;
@@ -621,7 +621,7 @@ public class IoTDBGroupByFillIT {
   }
 
   @Test
-  public void previousMinValueTest() {
+  public void oldTypePreviousMinValueTest() {
     String[] retArray =
         new String[] {"17,null", "22,23", "27,23", "32,24", "37,24", "42,24", "47,28", "52,28"};
 
@@ -686,7 +686,7 @@ public class IoTDBGroupByFillIT {
           statement.execute(
               "select sum(hardware) from "
                   + "root.ln.wf01.wt01 "
-                  + "GROUP BY ([17, 55), 5ms) FILL(double[previous])");
+                  + "GROUP BY ([17, 55), 5ms) FILL(previous)");
       assertTrue(hasResultSet);
       int cnt;
       try (ResultSet resultSet = statement.getResultSet()) {
@@ -706,7 +706,7 @@ public class IoTDBGroupByFillIT {
           statement.execute(
               "select sum(hardware) from "
                   + "root.ln.wf01.wt01 "
-                  + "GROUP BY ([17, 55), 5ms) FILL(double[previous]) order by time desc");
+                  + "GROUP BY ([17, 55), 5ms) FILL(previous) order by time desc");
       assertTrue(hasResultSet);
       try (ResultSet resultSet = statement.getResultSet()) {
         cnt = 0;
@@ -727,7 +727,7 @@ public class IoTDBGroupByFillIT {
   }
 
   @Test
-  public void previousUntilLastLastValueTest() {
+  public void oldTypePreviousUntilLastLastValueTest() {
     String[] retArray =
         new String[] {
           "17,null", "22,false", "27,false", "32,true", "37,true", "42,true", "47,true", "52,null"
@@ -783,7 +783,7 @@ public class IoTDBGroupByFillIT {
   }
 
   @Test
-  public void previousUntilLastFirstValueTest() {
+  public void oldTypePreviousUntilLastFirstValueTest() {
     String[] retArray =
         new String[] {
           "17,null", "22,34.9", "27,34.9", "32,44.6", "37,44.6", "42,44.6", "47,54.6", "52,null"
@@ -852,7 +852,7 @@ public class IoTDBGroupByFillIT {
               "select first_value(hardware) from "
                   + "root.ln.wf01.wt01 "
                   + "WHERE hardware > 35.0 "
-                  + "GROUP BY ([17, 55), 5ms) FILL(double[previousUntilLast])");
+                  + "GROUP BY ([17, 55), 5ms) FILL(previousUntilLast)");
 
       assertTrue(hasResultSet);
       int cnt;
@@ -874,7 +874,7 @@ public class IoTDBGroupByFillIT {
               "select first_value(hardware) from "
                   + "root.ln.wf01.wt01 "
                   + "WHERE hardware > 35.0 "
-                  + "GROUP BY ([17, 55), 5ms) FILL(double[previousUntilLast]) order by time desc");
+                  + "GROUP BY ([17, 55), 5ms) FILL(previousUntilLast) order by time desc");
       assertTrue(hasResultSet);
       try (ResultSet resultSet = statement.getResultSet()) {
         cnt = 0;
@@ -908,7 +908,7 @@ public class IoTDBGroupByFillIT {
           statement.execute(
               "select avg(hardware) from "
                   + "root.ln.wf01.wt01 "
-                  + "GROUP BY ([17, 55), 5ms) FILL(double[previousUntilLast])");
+                  + "GROUP BY ([17, 55), 5ms) FILL(previousUntilLast)");
       assertTrue(hasResultSet);
       int cnt;
       try (ResultSet resultSet = statement.getResultSet()) {
@@ -928,7 +928,7 @@ public class IoTDBGroupByFillIT {
           statement.execute(
               "select avg(hardware) from "
                   + "root.ln.wf01.wt01 "
-                  + "GROUP BY ([17, 55), 5ms) FILL(double[previousUntilLast]) order by time desc");
+                  + "GROUP BY ([17, 55), 5ms) FILL(previousUntilLast) order by time desc");
       assertTrue(hasResultSet);
       try (ResultSet resultSet = statement.getResultSet()) {
         cnt = 0;
@@ -949,7 +949,7 @@ public class IoTDBGroupByFillIT {
   }
 
   @Test
-  public void previousUntilLastCountTest() {
+  public void oldTypePreviousUntilLastCountTest() {
     String[] retArray =
         new String[] {"17,0", "22,2", "27,0", "32,2", "37,0", "42,0", "47,2", "52,0"};
 
@@ -1001,7 +1001,7 @@ public class IoTDBGroupByFillIT {
   }
 
   @Test
-  public void previousUntilLastMaxTimeTest() {
+  public void oldTypePreviousUntilLastMaxTimeTest() {
     String[] retArray =
         new String[] {"17,null", "22,25", "27,25", "32,36", "37,36", "42,36", "47,50", "52,null"};
 
@@ -1053,7 +1053,7 @@ public class IoTDBGroupByFillIT {
   }
 
   @Test
-  public void previousUntilLastMaxValueTest() {
+  public void oldTypePreviousUntilLastMaxValueTest() {
     String[] retArray =
         new String[] {"17,null", "22,28", "27,28", "32,29", "37,29", "42,29", "47,30", "52,null"};
 
@@ -1119,7 +1119,7 @@ public class IoTDBGroupByFillIT {
               "select max_value(temperature) from "
                   + "root.ln.wf01.wt01 "
                   + "WHERE temperature <= 25"
-                  + "GROUP BY ([17, 55), 5ms) FILL(int32[previousUntilLast])");
+                  + "GROUP BY ([17, 55), 5ms) FILL(previousUntilLast)");
       assertTrue(hasResultSet);
       int cnt;
       try (ResultSet resultSet = statement.getResultSet()) {
@@ -1140,7 +1140,7 @@ public class IoTDBGroupByFillIT {
               "select max_value(temperature) from "
                   + "root.ln.wf01.wt01 "
                   + "WHERE temperature <= 25"
-                  + "GROUP BY ([17, 55), 5ms) FILL(int32[previousUntilLast]) order by time desc");
+                  + "GROUP BY ([17, 55), 5ms) FILL(previousUntilLast) order by time desc");
       assertTrue(hasResultSet);
       try (ResultSet resultSet = statement.getResultSet()) {
         cnt = 0;
@@ -1172,7 +1172,7 @@ public class IoTDBGroupByFillIT {
           statement.execute(
               "select min_time(hardware) from "
                   + "root.ln.wf01.wt01 "
-                  + "GROUP BY ([17, 55), 5ms) FILL(int64[previousUntilLast])");
+                  + "GROUP BY ([17, 55), 5ms) FILL(previousUntilLast)");
       assertTrue(hasResultSet);
       int cnt;
       try (ResultSet resultSet = statement.getResultSet()) {
@@ -1192,7 +1192,7 @@ public class IoTDBGroupByFillIT {
           statement.execute(
               "select min_time(hardware) from "
                   + "root.ln.wf01.wt01 "
-                  + "GROUP BY ([17, 55), 5ms) FILL(int64[previousUntilLast]) order by time desc");
+                  + "GROUP BY ([17, 55), 5ms) FILL(previousUntilLast) order by time desc");
       assertTrue(hasResultSet);
       try (ResultSet resultSet = statement.getResultSet()) {
         cnt = 0;
@@ -1224,7 +1224,7 @@ public class IoTDBGroupByFillIT {
           statement.execute(
               "select min_value(temperature) from "
                   + "root.ln.wf01.wt01 "
-                  + "GROUP BY ([17, 55), 5ms) FILL(int32[previousUntilLast])");
+                  + "GROUP BY ([17, 55), 5ms) FILL(previousUntilLast)");
       assertTrue(hasResultSet);
       int cnt;
       try (ResultSet resultSet = statement.getResultSet()) {
@@ -1244,7 +1244,7 @@ public class IoTDBGroupByFillIT {
           statement.execute(
               "select min_value(temperature) from "
                   + "root.ln.wf01.wt01 "
-                  + "GROUP BY ([17, 55), 5ms) FILL(int32[previousUntilLast]) order by time desc");
+                  + "GROUP BY ([17, 55), 5ms) FILL(previousUntilLast) order by time desc");
       assertTrue(hasResultSet);
       try (ResultSet resultSet = statement.getResultSet()) {
         cnt = 0;
@@ -1278,7 +1278,7 @@ public class IoTDBGroupByFillIT {
           statement.execute(
               "select sum(hardware) from "
                   + "root.ln.wf01.wt01 "
-                  + "GROUP BY ([17, 55), 5ms) FILL(double[previousUntilLast])");
+                  + "GROUP BY ([17, 55), 5ms) FILL(previousUntilLast)");
       assertTrue(hasResultSet);
       int cnt;
       try (ResultSet resultSet = statement.getResultSet()) {
@@ -1298,7 +1298,7 @@ public class IoTDBGroupByFillIT {
           statement.execute(
               "select sum(hardware) from "
                   + "root.ln.wf01.wt01 "
-                  + "GROUP BY ([17, 55), 5ms) FILL(double[previousUntilLast]) order by time desc");
+                  + "GROUP BY ([17, 55), 5ms) FILL(previousUntilLast) order by time desc");
       assertTrue(hasResultSet);
       try (ResultSet resultSet = statement.getResultSet()) {
         cnt = 0;
@@ -1366,7 +1366,7 @@ public class IoTDBGroupByFillIT {
           statement.execute(
               "select last_value(temperature) from "
                   + "root.ln.wf01.wt01 "
-                  + "GROUP BY ([17, 55), 5ms) FILL(int32[100])");
+                  + "GROUP BY ([17, 55), 5ms) FILL(100)");
 
       assertTrue(hasResultSet);
       int cnt;
@@ -1387,7 +1387,7 @@ public class IoTDBGroupByFillIT {
           statement.execute(
               "select last_value(temperature) from "
                   + "root.ln.wf01.wt01 "
-                  + "GROUP BY ([17, 55), 5ms) FILL(int32[100]) order by time desc");
+                  + "GROUP BY ([17, 55), 5ms) FILL(100) order by time desc");
       assertTrue(hasResultSet);
       try (ResultSet resultSet = statement.getResultSet()) {
         cnt = 0;
@@ -1408,7 +1408,7 @@ public class IoTDBGroupByFillIT {
   }
 
   @Test
-  public void valueFirstValueTest() {
+  public void oldTypeValueFirstValueTest() {
     String[] retArray =
         new String[] {
           "17,2.33", "22,34.9", "27,2.33", "32,44.6", "37,2.33", "42,2.33", "47,54.6", "52,2.33"
@@ -1463,7 +1463,7 @@ public class IoTDBGroupByFillIT {
   }
 
   @Test
-  public void valueAvgTest() {
+  public void oldTypeValueAvgTest() {
     String[] retArray =
         new String[] {
           "17,66.6", "22,33.3", "27,66.6", "32,44.7", "37,66.6", "42,66.6", "47,55.2", "52,66.6"
@@ -1528,7 +1528,7 @@ public class IoTDBGroupByFillIT {
           statement.execute(
               "select count(status) from "
                   + "root.ln.wf01.wt01 "
-                  + "GROUP BY ([17, 55), 5ms) FILL(int64[10])");
+                  + "GROUP BY ([17, 55), 5ms) FILL(10)");
       assertTrue(hasResultSet);
       int cnt;
       try (ResultSet resultSet = statement.getResultSet()) {
@@ -1548,7 +1548,7 @@ public class IoTDBGroupByFillIT {
           statement.execute(
               "select count(status) from "
                   + "root.ln.wf01.wt01 "
-                  + "GROUP BY ([17, 55), 5ms) FILL(int64[10]) order by time desc");
+                  + "GROUP BY ([17, 55), 5ms) FILL(10) order by time desc");
       assertTrue(hasResultSet);
       try (ResultSet resultSet = statement.getResultSet()) {
         cnt = 0;
@@ -1580,7 +1580,7 @@ public class IoTDBGroupByFillIT {
           statement.execute(
               "select max_time(hardware) from "
                   + "root.ln.wf01.wt01 "
-                  + "GROUP BY ([17, 55), 5ms) FILL(int64[888])");
+                  + "GROUP BY ([17, 55), 5ms) FILL(888)");
       assertTrue(hasResultSet);
       int cnt;
       try (ResultSet resultSet = statement.getResultSet()) {
@@ -1600,7 +1600,7 @@ public class IoTDBGroupByFillIT {
           statement.execute(
               "select max_time(hardware) from "
                   + "root.ln.wf01.wt01 "
-                  + "GROUP BY ([17, 55), 5ms) FILL(int64[888]) order by time desc");
+                  + "GROUP BY ([17, 55), 5ms) FILL(888) order by time desc");
       assertTrue(hasResultSet);
       try (ResultSet resultSet = statement.getResultSet()) {
         cnt = 0;
@@ -1621,7 +1621,7 @@ public class IoTDBGroupByFillIT {
   }
 
   @Test
-  public void valueMaxValueTest() {
+  public void oldTypeValueMaxValueTest() {
     String[] retArray =
         new String[] {"17,100", "22,28", "27,100", "32,29", "37,100", "42,100", "47,30", "52,100"};
 
@@ -1673,7 +1673,7 @@ public class IoTDBGroupByFillIT {
   }
 
   @Test
-  public void valueMinTimeTest() {
+  public void oldTypeValueMinTimeTest() {
     String[] retArray =
         new String[] {"17,1", "22,23", "27,1", "32,33", "37,1", "42,1", "47,48", "52,1"};
 
@@ -1725,7 +1725,7 @@ public class IoTDBGroupByFillIT {
   }
 
   @Test
-  public void valueMinValueTest() {
+  public void oldTypeValueMinValueTest() {
     String[] retArray =
         new String[] {"17,10", "22,23", "27,10", "32,24", "37,10", "42,10", "47,28", "52,10"};
 
@@ -1789,6 +1789,60 @@ public class IoTDBGroupByFillIT {
               "select min_value(temperature) from "
                   + "root.ln.wf01.wt01 "
                   + "WHERE temperature > 25 "
+                  + "GROUP BY ([17, 55), 5ms) FILL(10)");
+      assertTrue(hasResultSet);
+      int cnt;
+      try (ResultSet resultSet = statement.getResultSet()) {
+        cnt = 0;
+        while (resultSet.next()) {
+          String ans =
+              resultSet.getString(TIMESTAMP_STR)
+                  + ","
+                  + resultSet.getString(minValue("root.ln.wf01.wt01.temperature"));
+          assertEquals(retArray[cnt], ans);
+          cnt++;
+        }
+        assertEquals(retArray.length, cnt);
+      }
+
+      hasResultSet =
+          statement.execute(
+              "select min_value(temperature) from "
+                  + "root.ln.wf01.wt01 "
+                  + "WHERE temperature > 25 "
+                  + "GROUP BY ([17, 55), 5ms) FILL(10) order by time desc");
+      assertTrue(hasResultSet);
+      try (ResultSet resultSet = statement.getResultSet()) {
+        cnt = 0;
+        while (resultSet.next()) {
+          String ans =
+              resultSet.getString(TIMESTAMP_STR)
+                  + ","
+                  + resultSet.getString(minValue("root.ln.wf01.wt01.temperature"));
+          assertEquals(retArray[retArray.length - cnt - 1], ans);
+          cnt++;
+        }
+        assertEquals(retArray.length, cnt);
+      }
+    } catch (Exception e) {
+      e.printStackTrace();
+      fail(e.getMessage());
+    }
+  }
+
+  @Test
+  public void oldTypeValueMinValueWithValueFilterTest() {
+    String[] retArray =
+        new String[] {"17,10", "22,28", "27,10", "32,29", "37,10", "42,10", "47,28", "52,10"};
+
+    try (Connection connection =
+            DriverManager.getConnection("jdbc:iotdb://127.0.0.1:6667/", "root", "root");
+        Statement statement = connection.createStatement()) {
+      boolean hasResultSet =
+          statement.execute(
+              "select min_value(temperature) from "
+                  + "root.ln.wf01.wt01 "
+                  + "WHERE temperature > 25 "
                   + "GROUP BY ([17, 55), 5ms) FILL(int32[10])");
       assertTrue(hasResultSet);
       int cnt;
@@ -1851,7 +1905,7 @@ public class IoTDBGroupByFillIT {
           statement.execute(
               "select sum(hardware) from "
                   + "root.ln.wf01.wt01 "
-                  + "GROUP BY ([17, 55), 5ms) FILL(double[233.0])");
+                  + "GROUP BY ([17, 55), 5ms) FILL(233.0)");
       assertTrue(hasResultSet);
       int cnt;
       try (ResultSet resultSet = statement.getResultSet()) {
@@ -1871,7 +1925,7 @@ public class IoTDBGroupByFillIT {
           statement.execute(
               "select sum(hardware) from "
                   + "root.ln.wf01.wt01 "
-                  + "GROUP BY ([17, 55), 5ms) FILL(double[233.0]) order by time desc");
+                  + "GROUP BY ([17, 55), 5ms) FILL(233.0) order by time desc");
       assertTrue(hasResultSet);
       try (ResultSet resultSet = statement.getResultSet()) {
         cnt = 0;
@@ -1892,7 +1946,7 @@ public class IoTDBGroupByFillIT {
   }
 
   @Test
-  public void linearLastValueTest() {
+  public void oldTypeLinearLastValueTest() {
     String[] retArray =
         new String[] {"17,null", "22,23", "27,23", "32,24", "37,26", "42,28", "47,30", "52,null"};
 
@@ -1945,7 +1999,7 @@ public class IoTDBGroupByFillIT {
   }
 
   @Test
-  public void linearFirstValueTest() {
+  public void oldTypeLinearFirstValueTest() {
     String[] retArray =
         new String[] {
           "17,null",
@@ -2020,7 +2074,7 @@ public class IoTDBGroupByFillIT {
           statement.execute(
               "select avg(hardware) from "
                   + "root.ln.wf01.wt01 "
-                  + "GROUP BY ([17, 55), 5ms) FILL(double[linear])");
+                  + "GROUP BY ([17, 55), 5ms) FILL(linear)");
       assertTrue(hasResultSet);
       int cnt;
       try (ResultSet resultSet = statement.getResultSet()) {
@@ -2040,7 +2094,7 @@ public class IoTDBGroupByFillIT {
           statement.execute(
               "select avg(hardware) from "
                   + "root.ln.wf01.wt01 "
-                  + "GROUP BY ([17, 55), 5ms) FILL(double[linear]) order by time desc");
+                  + "GROUP BY ([17, 55), 5ms) FILL(linear) order by time desc");
       assertTrue(hasResultSet);
       try (ResultSet resultSet = statement.getResultSet()) {
         cnt = 0;
@@ -2072,7 +2126,7 @@ public class IoTDBGroupByFillIT {
           statement.execute(
               "select count(status) from "
                   + "root.ln.wf01.wt01 "
-                  + "GROUP BY ([17, 55), 5ms) FILL(int64[linear])");
+                  + "GROUP BY ([17, 55), 5ms) FILL(linear)");
       assertTrue(hasResultSet);
       int cnt;
       try (ResultSet resultSet = statement.getResultSet()) {
@@ -2092,7 +2146,7 @@ public class IoTDBGroupByFillIT {
           statement.execute(
               "select count(status) from "
                   + "root.ln.wf01.wt01 "
-                  + "GROUP BY ([17, 55), 5ms) FILL(int64[linear]) order by time desc");
+                  + "GROUP BY ([17, 55), 5ms) FILL(linear) order by time desc");
       assertTrue(hasResultSet);
       try (ResultSet resultSet = statement.getResultSet()) {
         cnt = 0;
@@ -2124,7 +2178,7 @@ public class IoTDBGroupByFillIT {
           statement.execute(
               "select max_time(hardware) from "
                   + "root.ln.wf01.wt01 "
-                  + "GROUP BY ([17, 55), 5ms) FILL(int64[linear])");
+                  + "GROUP BY ([17, 55), 5ms) FILL(linear)");
       assertTrue(hasResultSet);
       int cnt;
       try (ResultSet resultSet = statement.getResultSet()) {
@@ -2144,7 +2198,7 @@ public class IoTDBGroupByFillIT {
           statement.execute(
               "select max_time(hardware) from "
                   + "root.ln.wf01.wt01 "
-                  + "GROUP BY ([17, 55), 5ms) FILL(int64[linear]) order by time desc");
+                  + "GROUP BY ([17, 55), 5ms) FILL(linear) order by time desc");
       assertTrue(hasResultSet);
       try (ResultSet resultSet = statement.getResultSet()) {
         cnt = 0;
@@ -2165,7 +2219,7 @@ public class IoTDBGroupByFillIT {
   }
 
   @Test
-  public void linearMaxValueTest() {
+  public void oldTypeLinearMaxValueTest() {
     String[] retArray =
         new String[] {"17,null", "22,28", "27,28", "32,29", "37,29", "42,29", "47,30", "52,null"};
 
@@ -2217,7 +2271,7 @@ public class IoTDBGroupByFillIT {
   }
 
   @Test
-  public void linearMinTimeTest() {
+  public void oldTypeLinearMinTimeTest() {
     String[] retArray =
         new String[] {"17,null", "22,23", "27,28", "32,33", "37,38", "42,43", "47,48", "52,null"};
 
@@ -2269,7 +2323,7 @@ public class IoTDBGroupByFillIT {
   }
 
   @Test
-  public void linearMinValueTest() {
+  public void oldTypeLinearMinValueTest() {
     String[] retArray =
         new String[] {"17,null", "22,23", "27,23", "32,24", "37,25", "42,26", "47,28", "52,null"};
 
@@ -2333,7 +2387,7 @@ public class IoTDBGroupByFillIT {
               "select min_value(temperature) from "
                   + "root.ln.wf01.wt01 "
                   + "WHERE temperature > 25"
-                  + "GROUP BY ([17, 55), 5ms) FILL(int32[linear])");
+                  + "GROUP BY ([17, 55), 5ms) FILL(linear)");
       assertTrue(hasResultSet);
       int cnt;
       try (ResultSet resultSet = statement.getResultSet()) {
@@ -2354,7 +2408,7 @@ public class IoTDBGroupByFillIT {
               "select min_value(temperature) from "
                   + "root.ln.wf01.wt01 "
                   + "WHERE temperature > 25"
-                  + "GROUP BY ([17, 55), 5ms) FILL(int32[linear]) order by time desc");
+                  + "GROUP BY ([17, 55), 5ms) FILL(linear) order by time desc");
       assertTrue(hasResultSet);
       try (ResultSet resultSet = statement.getResultSet()) {
         cnt = 0;
@@ -2388,7 +2442,7 @@ public class IoTDBGroupByFillIT {
           statement.execute(
               "select sum(hardware) from "
                   + "root.ln.wf01.wt01 "
-                  + "GROUP BY ([17, 55), 5ms) FILL(double[linear])");
+                  + "GROUP BY ([17, 55), 5ms) FILL(linear)");
       assertTrue(hasResultSet);
       int cnt;
       try (ResultSet resultSet = statement.getResultSet()) {
@@ -2408,7 +2462,7 @@ public class IoTDBGroupByFillIT {
           statement.execute(
               "select sum(hardware) from "
                   + "root.ln.wf01.wt01 "
-                  + "GROUP BY ([17, 55), 5ms) FILL(double[linear]) order by time desc");
+                  + "GROUP BY ([17, 55), 5ms) FILL(linear) order by time desc");
       assertTrue(hasResultSet);
       try (ResultSet resultSet = statement.getResultSet()) {
         cnt = 0;
@@ -2429,7 +2483,7 @@ public class IoTDBGroupByFillIT {
   }
 
   @Test
-  public void linearSumWithValueFilterTest() {
+  public void oldTypelinearSumWithValueFilterTest() {
     String[] retArray =
         new String[] {
           "17,null",
diff --git a/integration/src/test/java/org/apache/iotdb/db/integration/IoTDBGroupByFillMixPathsIT.java b/integration/src/test/java/org/apache/iotdb/db/integration/IoTDBGroupByFillMixPathsIT.java
index 740cad7..d17dfa8 100644
--- a/integration/src/test/java/org/apache/iotdb/db/integration/IoTDBGroupByFillMixPathsIT.java
+++ b/integration/src/test/java/org/apache/iotdb/db/integration/IoTDBGroupByFillMixPathsIT.java
@@ -19,25 +19,22 @@
 package org.apache.iotdb.db.integration;
 
 import org.apache.iotdb.db.conf.IoTDBDescriptor;
-import org.apache.iotdb.db.constant.TestConstant;
 import org.apache.iotdb.db.utils.EnvironmentUtils;
 import org.apache.iotdb.itbase.category.LocalStandaloneTest;
 import org.apache.iotdb.jdbc.Config;
 
 import org.junit.After;
 import org.junit.Before;
-import org.junit.Test;
 import org.junit.experimental.categories.Category;
 
 import java.sql.Connection;
 import java.sql.DriverManager;
-import java.sql.ResultSet;
 import java.sql.Statement;
 
 import static org.apache.iotdb.db.constant.TestConstant.*;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
+
+// TODO: @CRZbulabula
+// rebuild test after IOTDB-1948 and IOTDB-1949
 
 @Category({LocalStandaloneTest.class})
 public class IoTDBGroupByFillMixPathsIT {
@@ -125,365 +122,367 @@ public class IoTDBGroupByFillMixPathsIT {
     }
   }
 
-  @Test
-  public void singlePathMixTest() {
-    String[] retArray =
-        new String[] {
-          // "7,23.0,23,8"
-          "17,41.66666666666667,23,8",
-          "22,51.0,23,25",
-          "27,88.5,25,25",
-          "32,126.0,27,36",
-          "37,129.0,26,36",
-          "42,132.0,24,36",
-          "47,135.0,22,51",
-          "52,110.0,20,56",
-          "57,null,23,null",
-          "62,71.5,26,null"
-          // "72,33.0,33,72"
-        };
-
-    try (Connection connection =
-            DriverManager.getConnection("jdbc:iotdb://127.0.0.1:6667/", "root", "root");
-        Statement statement = connection.createStatement()) {
-      boolean hasResultSet =
-          statement.execute(
-              "select sum(temperature), last_value(temperature), max_time(temperature) "
-                  + "from root.ln.wf01.wt01 "
-                  + "GROUP BY ([17, 65), 5ms) "
-                  + "FILL(double[linear, 12ms, 12ms], int32[linear, 10ms, 18ms], int64[previousUntilLast, 17ms])");
-      assertTrue(hasResultSet);
-      int cnt;
-      try (ResultSet resultSet = statement.getResultSet()) {
-        cnt = 0;
-        while (resultSet.next()) {
-          String ans =
-              resultSet.getString(TIMESTAMP_STR)
-                  + ","
-                  + resultSet.getString(sum("root.ln.wf01.wt01.temperature"))
-                  + ","
-                  + resultSet.getString(TestConstant.lastValue("root.ln.wf01.wt01.temperature"))
-                  + ","
-                  + resultSet.getString(TestConstant.maxTime("root.ln.wf01.wt01.temperature"));
-          assertEquals(retArray[cnt], ans);
-          cnt++;
-        }
-        assertEquals(retArray.length, cnt);
-      }
-
-      hasResultSet =
-          statement.execute(
-              "select sum(temperature), last_value(temperature), max_time(temperature) "
-                  + "from root.ln.wf01.wt01 "
-                  + "GROUP BY ([17, 65), 5ms) "
-                  + "FILL(double[linear, 12ms, 12ms], int32[linear, 10ms, 18ms], int64[previousUntilLast, 17ms]) "
-                  + "order by time desc");
-      assertTrue(hasResultSet);
-      try (ResultSet resultSet = statement.getResultSet()) {
-        cnt = 0;
-        while (resultSet.next()) {
-          String ans =
-              resultSet.getString(TIMESTAMP_STR)
-                  + ","
-                  + resultSet.getString(sum("root.ln.wf01.wt01.temperature"))
-                  + ","
-                  + resultSet.getString(TestConstant.lastValue("root.ln.wf01.wt01.temperature"))
-                  + ","
-                  + resultSet.getString(TestConstant.maxTime("root.ln.wf01.wt01.temperature"));
-          assertEquals(retArray[retArray.length - cnt - 1], ans);
-          cnt++;
-        }
-        assertEquals(retArray.length, cnt);
-      }
-    } catch (Exception e) {
-      e.printStackTrace();
-      fail(e.getMessage());
-    }
-  }
-
-  @Test
-  public void MultiPathsMixTest() {
-    String[] retArray =
-        new String[] {
-          "17,41.66666666666667,23.0,10,23,23.5,true",
-          "22,51.0,null,10,23,null,true",
-          "27,88.5,35.0,null,23,36.0,true",
-          "32,126.0,43.36,36,22,48.2,false",
-          "37,129.0,37.0,36,22,38.2,true",
-          "42,132.0,null,45,22,null,false",
-          "47,135.0,35.900000000000006,45,22,39.35,true",
-          "52,110.0,null,56,13,null,false",
-          "57,null,34.800000000000004,null,18,40.5,true",
-          "62,71.5,38.800000000000004,null,23,42.6,true"
-        };
-
-    /*  Format result
-                  linear,      linear, preUntil,   linear,       linear,      value
-          7,        23.0,        11.0,       10,       23,         11.0,       true
-         17, 41.67(null),  23.0(null), 10(null), 23(null),   23.5(null), true(null)
-         22,        51.0,        null, 10(null),       23,         null, true(null)
-         27,  88.5(null),        35.0,     null, 23(null),         36.0, true(null)
-         32,       126.0,       43.36,       36,       22,         48.2,      false
-         37, 129.0(null),        37.0, 36(null), 22(null),         38.2, true(null)
-         42, 132.0(null),        null,       45, 22(null),         null,      false
-         47,       135.0,  35.9(null), 45(null),       22,  39.35(null), true(null)
-         52,       110.0,        null,       56,       13,         null,      false
-         57,        null,        34.8,     null, 18(null),         40.5, true(null)
-         62,  71.5(null),  38.8(null),     null, 23(null),   42.6(null), true(null)
-         72,        33.0,        46.8,       74,       33,         46.8,       true
-    */
-
-    try (Connection connection =
-            DriverManager.getConnection("jdbc:iotdb://127.0.0.1:6667/", "root", "root");
-        Statement statement = connection.createStatement()) {
-      boolean hasResultSet =
-          statement.execute(
-              "select sum(temperature), avg(hardware), max_time(status), "
-                  + "min_value(temperature), max_value(hardware), first_value(status) "
-                  + "from root.ln.wf01.wt01 "
-                  + "GROUP BY ([17, 65), 5ms) "
-                  + "FILL(double[linear, 12ms, 12ms], int32[linear, 12ms, 18ms], "
-                  + "int64[previousUntilLast, 17ms], boolean[true])");
-      assertTrue(hasResultSet);
-      int cnt;
-      try (ResultSet resultSet = statement.getResultSet()) {
-        cnt = 0;
-        while (resultSet.next()) {
-          String ans =
-              resultSet.getString(TIMESTAMP_STR)
-                  + ","
-                  + resultSet.getString(sum("root.ln.wf01.wt01.temperature"))
-                  + ","
-                  + resultSet.getString(avg("root.ln.wf01.wt01.hardware"))
-                  + ","
-                  + resultSet.getString(TestConstant.maxTime("root.ln.wf01.wt01.status"))
-                  + ","
-                  + resultSet.getString(TestConstant.minValue("root.ln.wf01.wt01.temperature"))
-                  + ","
-                  + resultSet.getString(TestConstant.maxValue("root.ln.wf01.wt01.hardware"))
-                  + ","
-                  + resultSet.getString(TestConstant.firstValue("root.ln.wf01.wt01.status"));
-          assertEquals(retArray[cnt], ans);
-          cnt++;
-        }
-        assertEquals(retArray.length, cnt);
-      }
-
-      hasResultSet =
-          statement.execute(
-              "select sum(temperature), avg(hardware), max_time(status), "
-                  + "min_value(temperature), max_value(hardware), first_value(status) "
-                  + "from root.ln.wf01.wt01 "
-                  + "GROUP BY ([17, 65), 5ms) "
-                  + "FILL(double[linear, 12ms, 12ms], int32[linear, 12ms, 18ms], "
-                  + "int64[previousUntilLast, 17ms], boolean[true]) "
-                  + "order by time desc");
-      assertTrue(hasResultSet);
-      try (ResultSet resultSet = statement.getResultSet()) {
-        cnt = 0;
-        while (resultSet.next()) {
-          String ans =
-              resultSet.getString(TIMESTAMP_STR)
-                  + ","
-                  + resultSet.getString(sum("root.ln.wf01.wt01.temperature"))
-                  + ","
-                  + resultSet.getString(avg("root.ln.wf01.wt01.hardware"))
-                  + ","
-                  + resultSet.getString(TestConstant.maxTime("root.ln.wf01.wt01.status"))
-                  + ","
-                  + resultSet.getString(TestConstant.minValue("root.ln.wf01.wt01.temperature"))
-                  + ","
-                  + resultSet.getString(TestConstant.maxValue("root.ln.wf01.wt01.hardware"))
-                  + ","
-                  + resultSet.getString(TestConstant.firstValue("root.ln.wf01.wt01.status"));
-          assertEquals(retArray[retArray.length - cnt - 1], ans);
-          cnt++;
-        }
-        assertEquals(retArray.length, cnt);
-      }
-    } catch (Exception e) {
-      e.printStackTrace();
-      fail(e.getMessage());
-    }
-  }
-
-  @Test
-  public void singlePathMixWithValueFilterTest() {
-    String[] retArray =
-        new String[] {
-          // "112,33.5,33.5,114"
-          "117,null,null,114",
-          "122,39.05,39.05,114",
-          "127,null,null,114",
-          "132,44.6,44.6,133",
-          "137,47.93333333333334,47.93333333333334,133",
-          "142,51.266666666666666,51.266666666666666,133",
-          "147,54.6,54.6,148",
-          "152,47.4,47.4,148"
-          // "162,33.0,33.0,166"
-        };
-
-    try (Connection connection =
-            DriverManager.getConnection("jdbc:iotdb://127.0.0.1:6667/", "root", "root");
-        Statement statement = connection.createStatement()) {
-      boolean hasResultSet =
-          statement.execute(
-              "select sum(hardware), last_value(hardware), max_time(hardware) "
-                  + "from root.ln.wf01.wt01 "
-                  + "WHERE temperature >= 25 and status = false "
-                  + "GROUP BY ([117, 155), 5ms) "
-                  + "FILL(double[linear, 12ms, 12ms], int64[previous, 17ms])");
-      assertTrue(hasResultSet);
-      int cnt;
-      try (ResultSet resultSet = statement.getResultSet()) {
-        cnt = 0;
-        while (resultSet.next()) {
-          String ans =
-              resultSet.getString(TIMESTAMP_STR)
-                  + ","
-                  + resultSet.getString(sum("root.ln.wf01.wt01.hardware"))
-                  + ","
-                  + resultSet.getString(TestConstant.lastValue("root.ln.wf01.wt01.hardware"))
-                  + ","
-                  + resultSet.getString(TestConstant.maxTime("root.ln.wf01.wt01.hardware"));
-          assertEquals(retArray[cnt], ans);
-          cnt++;
-        }
-        assertEquals(retArray.length, cnt);
-      }
-
-      hasResultSet =
-          statement.execute(
-              "select sum(hardware), last_value(hardware), max_time(hardware) "
-                  + "from root.ln.wf01.wt01 "
-                  + "WHERE temperature >= 25 and status = false "
-                  + "GROUP BY ([117, 155), 5ms) "
-                  + "FILL(double[linear, 12ms, 12ms], int64[previous, 17ms]) "
-                  + "order by time desc");
-      assertTrue(hasResultSet);
-      try (ResultSet resultSet = statement.getResultSet()) {
-        cnt = 0;
-        while (resultSet.next()) {
-          String ans =
-              resultSet.getString(TIMESTAMP_STR)
-                  + ","
-                  + resultSet.getString(sum("root.ln.wf01.wt01.hardware"))
-                  + ","
-                  + resultSet.getString(TestConstant.lastValue("root.ln.wf01.wt01.hardware"))
-                  + ","
-                  + resultSet.getString(TestConstant.maxTime("root.ln.wf01.wt01.hardware"));
-          assertEquals(retArray[retArray.length - cnt - 1], ans);
-          cnt++;
-        }
-        assertEquals(retArray.length, cnt);
-      }
-    } catch (Exception e) {
-      e.printStackTrace();
-      fail(e.getMessage());
-    }
-  }
-
-  @Test
-  public void MultiPathsMixWithValueFilterTest() {
-    String[] retArray =
-        new String[] {
-          "117,null,null,114,26,null,true",
-          "122,27.0,39.05,114,27,39.05,true",
-          "127,null,null,114,null,null,true",
-          "132,29.0,44.6,133,29,44.6,false",
-          "137,28.666666666666668,47.93333333333334,133,29,47.93333333333334,true",
-          "142,28.333333333333332,51.266666666666666,133,29,51.266666666666666,true",
-          "147,28.0,54.6,148,28,54.6,false",
-          "152,32.0,47.4,null,32,47.4,true"
-        };
-
-    /*  Format result
-                   linear,      linear,  preUntil,   linear,      linear,      value
-          7,         25.0,        33.5,       114,       25,        33.5,      false
-         117,        null,        null, 114(null), 26(null),        null, true(null)
-         122,  27.0(null), 39.05(null), 114(null), 27(null), 39.05(null), true(null)
-         127,        null,        null, 114(null),     null,        null, true(null)
-         132,        29.0,        44.6,       133,       29,        44.6,      false
-         137, 28.67(null), 47.93(null), 133(null), 29(null), 47.93(null), true(null)
-         142, 28.33(null), 51.27(null), 133(null), 29(null), 51.27(null), true(null)
-         147,        28.0,        54.6,       148,       28,        54.6,      false
-         152,  32.0(null),  47.4(null),      null, 32(null),  47.4(null), true(null)
-         162,        40.0,        33.0,      null,       40,        33.0,       null
-    */
-
-    try (Connection connection =
-            DriverManager.getConnection("jdbc:iotdb://127.0.0.1:6667/", "root", "root");
-        Statement statement = connection.createStatement()) {
-      boolean hasResultSet =
-          statement.execute(
-              "select sum(temperature), avg(hardware), max_time(status), "
-                  + "min_value(temperature), max_value(hardware), first_value(status) "
-                  + "from root.ln.wf01.wt01 "
-                  + "WHERE temperature >= 25 and status = false "
-                  + "GROUP BY ([117, 155), 5ms) "
-                  + "FILL(double[linear, 12ms, 12ms], int32[linear, 12ms, 18ms], "
-                  + "int64[previousUntilLast, 17ms], boolean[true])");
-      assertTrue(hasResultSet);
-      int cnt;
-      try (ResultSet resultSet = statement.getResultSet()) {
-        cnt = 0;
-        while (resultSet.next()) {
-          String ans =
-              resultSet.getString(TIMESTAMP_STR)
-                  + ","
-                  + resultSet.getString(sum("root.ln.wf01.wt01.temperature"))
-                  + ","
-                  + resultSet.getString(avg("root.ln.wf01.wt01.hardware"))
-                  + ","
-                  + resultSet.getString(TestConstant.maxTime("root.ln.wf01.wt01.status"))
-                  + ","
-                  + resultSet.getString(TestConstant.minValue("root.ln.wf01.wt01.temperature"))
-                  + ","
-                  + resultSet.getString(TestConstant.maxValue("root.ln.wf01.wt01.hardware"))
-                  + ","
-                  + resultSet.getString(TestConstant.firstValue("root.ln.wf01.wt01.status"));
-          assertEquals(retArray[cnt], ans);
-          cnt++;
-        }
-        assertEquals(retArray.length, cnt);
-      }
-
-      hasResultSet =
-          statement.execute(
-              "select sum(temperature), avg(hardware), max_time(status), "
-                  + "min_value(temperature), max_value(hardware), first_value(status) "
-                  + "from root.ln.wf01.wt01 "
-                  + "WHERE temperature >= 25 and status = false "
-                  + "GROUP BY ([117, 155), 5ms) "
-                  + "FILL(double[linear, 12ms, 12ms], int32[linear, 12ms, 18ms], "
-                  + "int64[previousUntilLast, 17ms], boolean[true]) "
-                  + "order by time desc");
-      assertTrue(hasResultSet);
-      try (ResultSet resultSet = statement.getResultSet()) {
-        cnt = 0;
-        while (resultSet.next()) {
-          String ans =
-              resultSet.getString(TIMESTAMP_STR)
-                  + ","
-                  + resultSet.getString(sum("root.ln.wf01.wt01.temperature"))
-                  + ","
-                  + resultSet.getString(avg("root.ln.wf01.wt01.hardware"))
-                  + ","
-                  + resultSet.getString(TestConstant.maxTime("root.ln.wf01.wt01.status"))
-                  + ","
-                  + resultSet.getString(TestConstant.minValue("root.ln.wf01.wt01.temperature"))
-                  + ","
-                  + resultSet.getString(TestConstant.maxValue("root.ln.wf01.wt01.hardware"))
-                  + ","
-                  + resultSet.getString(TestConstant.firstValue("root.ln.wf01.wt01.status"));
-          assertEquals(retArray[retArray.length - cnt - 1], ans);
-          cnt++;
-        }
-        assertEquals(retArray.length, cnt);
-      }
-    } catch (Exception e) {
-      e.printStackTrace();
-      fail(e.getMessage());
-    }
-  }
+  //  @Test
+  //  public void singlePathMixTest() {
+  //    String[] retArray =
+  //        new String[] {
+  //          // "7,23.0,23,8"
+  //          "17,41.66666666666667,23,8",
+  //          "22,51.0,23,25",
+  //          "27,88.5,25,25",
+  //          "32,126.0,27,36",
+  //          "37,129.0,26,36",
+  //          "42,132.0,24,36",
+  //          "47,135.0,22,51",
+  //          "52,110.0,20,56",
+  //          "57,null,23,null",
+  //          "62,71.5,26,null"
+  //          // "72,33.0,33,72"
+  //        };
+  //
+  //    try (Connection connection =
+  //            DriverManager.getConnection("jdbc:iotdb://127.0.0.1:6667/", "root", "root");
+  //        Statement statement = connection.createStatement()) {
+  //      boolean hasResultSet =
+  //          statement.execute(
+  //              "select sum(temperature), last_value(temperature), max_time(temperature) "
+  //                  + "from root.ln.wf01.wt01 "
+  //                  + "GROUP BY ([17, 65), 5ms) "
+  //                  + "FILL(double[linear, 12ms, 12ms], int32[linear, 10ms, 18ms],
+  // int64[previousUntilLast, 17ms])");
+  //      assertTrue(hasResultSet);
+  //      int cnt;
+  //      try (ResultSet resultSet = statement.getResultSet()) {
+  //        cnt = 0;
+  //        while (resultSet.next()) {
+  //          String ans =
+  //              resultSet.getString(TIMESTAMP_STR)
+  //                  + ","
+  //                  + resultSet.getString(sum("root.ln.wf01.wt01.temperature"))
+  //                  + ","
+  //                  + resultSet.getString(TestConstant.lastValue("root.ln.wf01.wt01.temperature"))
+  //                  + ","
+  //                  + resultSet.getString(TestConstant.maxTime("root.ln.wf01.wt01.temperature"));
+  //          assertEquals(retArray[cnt], ans);
+  //          cnt++;
+  //        }
+  //        assertEquals(retArray.length, cnt);
+  //      }
+  //
+  //      hasResultSet =
+  //          statement.execute(
+  //              "select sum(temperature), last_value(temperature), max_time(temperature) "
+  //                  + "from root.ln.wf01.wt01 "
+  //                  + "GROUP BY ([17, 65), 5ms) "
+  //                  + "FILL(double[linear, 12ms, 12ms], int32[linear, 10ms, 18ms],
+  // int64[previousUntilLast, 17ms]) "
+  //                  + "order by time desc");
+  //      assertTrue(hasResultSet);
+  //      try (ResultSet resultSet = statement.getResultSet()) {
+  //        cnt = 0;
+  //        while (resultSet.next()) {
+  //          String ans =
+  //              resultSet.getString(TIMESTAMP_STR)
+  //                  + ","
+  //                  + resultSet.getString(sum("root.ln.wf01.wt01.temperature"))
+  //                  + ","
+  //                  + resultSet.getString(TestConstant.lastValue("root.ln.wf01.wt01.temperature"))
+  //                  + ","
+  //                  + resultSet.getString(TestConstant.maxTime("root.ln.wf01.wt01.temperature"));
+  //          assertEquals(retArray[retArray.length - cnt - 1], ans);
+  //          cnt++;
+  //        }
+  //        assertEquals(retArray.length, cnt);
+  //      }
+  //    } catch (Exception e) {
+  //      e.printStackTrace();
+  //      fail(e.getMessage());
+  //    }
+  //  }
+  //
+  //  @Test
+  //  public void MultiPathsMixTest() {
+  //    String[] retArray =
+  //        new String[] {
+  //          "17,41.66666666666667,23.0,10,23,23.5,true",
+  //          "22,51.0,null,10,23,null,true",
+  //          "27,88.5,35.0,null,23,36.0,true",
+  //          "32,126.0,43.36,36,22,48.2,false",
+  //          "37,129.0,37.0,36,22,38.2,true",
+  //          "42,132.0,null,45,22,null,false",
+  //          "47,135.0,35.900000000000006,45,22,39.35,true",
+  //          "52,110.0,null,56,13,null,false",
+  //          "57,null,34.800000000000004,null,18,40.5,true",
+  //          "62,71.5,38.800000000000004,null,23,42.6,true"
+  //        };
+  //
+  //    /*  Format result
+  //                  linear,      linear, preUntil,   linear,       linear,      value
+  //          7,        23.0,        11.0,       10,       23,         11.0,       true
+  //         17, 41.67(null),  23.0(null), 10(null), 23(null),   23.5(null), true(null)
+  //         22,        51.0,        null, 10(null),       23,         null, true(null)
+  //         27,  88.5(null),        35.0,     null, 23(null),         36.0, true(null)
+  //         32,       126.0,       43.36,       36,       22,         48.2,      false
+  //         37, 129.0(null),        37.0, 36(null), 22(null),         38.2, true(null)
+  //         42, 132.0(null),        null,       45, 22(null),         null,      false
+  //         47,       135.0,  35.9(null), 45(null),       22,  39.35(null), true(null)
+  //         52,       110.0,        null,       56,       13,         null,      false
+  //         57,        null,        34.8,     null, 18(null),         40.5, true(null)
+  //         62,  71.5(null),  38.8(null),     null, 23(null),   42.6(null), true(null)
+  //         72,        33.0,        46.8,       74,       33,         46.8,       true
+  //    */
+  //
+  //    try (Connection connection =
+  //            DriverManager.getConnection("jdbc:iotdb://127.0.0.1:6667/", "root", "root");
+  //        Statement statement = connection.createStatement()) {
+  //      boolean hasResultSet =
+  //          statement.execute(
+  //              "select sum(temperature), avg(hardware), max_time(status), "
+  //                  + "min_value(temperature), max_value(hardware), first_value(status) "
+  //                  + "from root.ln.wf01.wt01 "
+  //                  + "GROUP BY ([17, 65), 5ms) "
+  //                  + "FILL(double[linear, 12ms, 12ms], int32[linear, 12ms, 18ms], "
+  //                  + "int64[previousUntilLast, 17ms], boolean[true])");
+  //      assertTrue(hasResultSet);
+  //      int cnt;
+  //      try (ResultSet resultSet = statement.getResultSet()) {
+  //        cnt = 0;
+  //        while (resultSet.next()) {
+  //          String ans =
+  //              resultSet.getString(TIMESTAMP_STR)
+  //                  + ","
+  //                  + resultSet.getString(sum("root.ln.wf01.wt01.temperature"))
+  //                  + ","
+  //                  + resultSet.getString(avg("root.ln.wf01.wt01.hardware"))
+  //                  + ","
+  //                  + resultSet.getString(TestConstant.maxTime("root.ln.wf01.wt01.status"))
+  //                  + ","
+  //                  + resultSet.getString(TestConstant.minValue("root.ln.wf01.wt01.temperature"))
+  //                  + ","
+  //                  + resultSet.getString(TestConstant.maxValue("root.ln.wf01.wt01.hardware"))
+  //                  + ","
+  //                  + resultSet.getString(TestConstant.firstValue("root.ln.wf01.wt01.status"));
+  //          assertEquals(retArray[cnt], ans);
+  //          cnt++;
+  //        }
+  //        assertEquals(retArray.length, cnt);
+  //      }
+  //
+  //      hasResultSet =
+  //          statement.execute(
+  //              "select sum(temperature), avg(hardware), max_time(status), "
+  //                  + "min_value(temperature), max_value(hardware), first_value(status) "
+  //                  + "from root.ln.wf01.wt01 "
+  //                  + "GROUP BY ([17, 65), 5ms) "
+  //                  + "FILL(double[linear, 12ms, 12ms], int32[linear, 12ms, 18ms], "
+  //                  + "int64[previousUntilLast, 17ms], boolean[true]) "
+  //                  + "order by time desc");
+  //      assertTrue(hasResultSet);
+  //      try (ResultSet resultSet = statement.getResultSet()) {
+  //        cnt = 0;
+  //        while (resultSet.next()) {
+  //          String ans =
+  //              resultSet.getString(TIMESTAMP_STR)
+  //                  + ","
+  //                  + resultSet.getString(sum("root.ln.wf01.wt01.temperature"))
+  //                  + ","
+  //                  + resultSet.getString(avg("root.ln.wf01.wt01.hardware"))
+  //                  + ","
+  //                  + resultSet.getString(TestConstant.maxTime("root.ln.wf01.wt01.status"))
+  //                  + ","
+  //                  + resultSet.getString(TestConstant.minValue("root.ln.wf01.wt01.temperature"))
+  //                  + ","
+  //                  + resultSet.getString(TestConstant.maxValue("root.ln.wf01.wt01.hardware"))
+  //                  + ","
+  //                  + resultSet.getString(TestConstant.firstValue("root.ln.wf01.wt01.status"));
+  //          assertEquals(retArray[retArray.length - cnt - 1], ans);
+  //          cnt++;
+  //        }
+  //        assertEquals(retArray.length, cnt);
+  //      }
+  //    } catch (Exception e) {
+  //      e.printStackTrace();
+  //      fail(e.getMessage());
+  //    }
+  //  }
+  //
+  //  @Test
+  //  public void singlePathMixWithValueFilterTest() {
+  //    String[] retArray =
+  //        new String[] {
+  //          // "112,33.5,33.5,114"
+  //          "117,null,null,114",
+  //          "122,39.05,39.05,114",
+  //          "127,null,null,114",
+  //          "132,44.6,44.6,133",
+  //          "137,47.93333333333334,47.93333333333334,133",
+  //          "142,51.266666666666666,51.266666666666666,133",
+  //          "147,54.6,54.6,148",
+  //          "152,47.4,47.4,148"
+  //          // "162,33.0,33.0,166"
+  //        };
+  //
+  //    try (Connection connection =
+  //            DriverManager.getConnection("jdbc:iotdb://127.0.0.1:6667/", "root", "root");
+  //        Statement statement = connection.createStatement()) {
+  //      boolean hasResultSet =
+  //          statement.execute(
+  //              "select sum(hardware), last_value(hardware), max_time(hardware) "
+  //                  + "from root.ln.wf01.wt01 "
+  //                  + "WHERE temperature >= 25 and status = false "
+  //                  + "GROUP BY ([117, 155), 5ms) "
+  //                  + "FILL(double[linear, 12ms, 12ms], int64[previous, 17ms])");
+  //      assertTrue(hasResultSet);
+  //      int cnt;
+  //      try (ResultSet resultSet = statement.getResultSet()) {
+  //        cnt = 0;
+  //        while (resultSet.next()) {
+  //          String ans =
+  //              resultSet.getString(TIMESTAMP_STR)
+  //                  + ","
+  //                  + resultSet.getString(sum("root.ln.wf01.wt01.hardware"))
+  //                  + ","
+  //                  + resultSet.getString(TestConstant.lastValue("root.ln.wf01.wt01.hardware"))
+  //                  + ","
+  //                  + resultSet.getString(TestConstant.maxTime("root.ln.wf01.wt01.hardware"));
+  //          assertEquals(retArray[cnt], ans);
+  //          cnt++;
+  //        }
+  //        assertEquals(retArray.length, cnt);
+  //      }
+  //
+  //      hasResultSet =
+  //          statement.execute(
+  //              "select sum(hardware), last_value(hardware), max_time(hardware) "
+  //                  + "from root.ln.wf01.wt01 "
+  //                  + "WHERE temperature >= 25 and status = false "
+  //                  + "GROUP BY ([117, 155), 5ms) "
+  //                  + "FILL(double[linear, 12ms, 12ms], int64[previous, 17ms]) "
+  //                  + "order by time desc");
+  //      assertTrue(hasResultSet);
+  //      try (ResultSet resultSet = statement.getResultSet()) {
+  //        cnt = 0;
+  //        while (resultSet.next()) {
+  //          String ans =
+  //              resultSet.getString(TIMESTAMP_STR)
+  //                  + ","
+  //                  + resultSet.getString(sum("root.ln.wf01.wt01.hardware"))
+  //                  + ","
+  //                  + resultSet.getString(TestConstant.lastValue("root.ln.wf01.wt01.hardware"))
+  //                  + ","
+  //                  + resultSet.getString(TestConstant.maxTime("root.ln.wf01.wt01.hardware"));
+  //          assertEquals(retArray[retArray.length - cnt - 1], ans);
+  //          cnt++;
+  //        }
+  //        assertEquals(retArray.length, cnt);
+  //      }
+  //    } catch (Exception e) {
+  //      e.printStackTrace();
+  //      fail(e.getMessage());
+  //    }
+  //  }
+  //
+  //  @Test
+  //  public void MultiPathsMixWithValueFilterTest() {
+  //    String[] retArray =
+  //        new String[] {
+  //          "117,null,null,114,26,null,true",
+  //          "122,27.0,39.05,114,27,39.05,true",
+  //          "127,null,null,114,null,null,true",
+  //          "132,29.0,44.6,133,29,44.6,false",
+  //          "137,28.666666666666668,47.93333333333334,133,29,47.93333333333334,true",
+  //          "142,28.333333333333332,51.266666666666666,133,29,51.266666666666666,true",
+  //          "147,28.0,54.6,148,28,54.6,false",
+  //          "152,32.0,47.4,null,32,47.4,true"
+  //        };
+  //
+  //    /*  Format result
+  //                   linear,      linear,  preUntil,   linear,      linear,      value
+  //          7,         25.0,        33.5,       114,       25,        33.5,      false
+  //         117,        null,        null, 114(null), 26(null),        null, true(null)
+  //         122,  27.0(null), 39.05(null), 114(null), 27(null), 39.05(null), true(null)
+  //         127,        null,        null, 114(null),     null,        null, true(null)
+  //         132,        29.0,        44.6,       133,       29,        44.6,      false
+  //         137, 28.67(null), 47.93(null), 133(null), 29(null), 47.93(null), true(null)
+  //         142, 28.33(null), 51.27(null), 133(null), 29(null), 51.27(null), true(null)
+  //         147,        28.0,        54.6,       148,       28,        54.6,      false
+  //         152,  32.0(null),  47.4(null),      null, 32(null),  47.4(null), true(null)
+  //         162,        40.0,        33.0,      null,       40,        33.0,       null
+  //    */
+  //
+  //    try (Connection connection =
+  //            DriverManager.getConnection("jdbc:iotdb://127.0.0.1:6667/", "root", "root");
+  //        Statement statement = connection.createStatement()) {
+  //      boolean hasResultSet =
+  //          statement.execute(
+  //              "select sum(temperature), avg(hardware), max_time(status), "
+  //                  + "min_value(temperature), max_value(hardware), first_value(status) "
+  //                  + "from root.ln.wf01.wt01 "
+  //                  + "WHERE temperature >= 25 and status = false "
+  //                  + "GROUP BY ([117, 155), 5ms) "
+  //                  + "FILL(double[linear, 12ms, 12ms], int32[linear, 12ms, 18ms], "
+  //                  + "int64[previousUntilLast, 17ms], boolean[true])");
+  //      assertTrue(hasResultSet);
+  //      int cnt;
+  //      try (ResultSet resultSet = statement.getResultSet()) {
+  //        cnt = 0;
+  //        while (resultSet.next()) {
+  //          String ans =
+  //              resultSet.getString(TIMESTAMP_STR)
+  //                  + ","
+  //                  + resultSet.getString(sum("root.ln.wf01.wt01.temperature"))
+  //                  + ","
+  //                  + resultSet.getString(avg("root.ln.wf01.wt01.hardware"))
+  //                  + ","
+  //                  + resultSet.getString(TestConstant.maxTime("root.ln.wf01.wt01.status"))
+  //                  + ","
+  //                  + resultSet.getString(TestConstant.minValue("root.ln.wf01.wt01.temperature"))
+  //                  + ","
+  //                  + resultSet.getString(TestConstant.maxValue("root.ln.wf01.wt01.hardware"))
+  //                  + ","
+  //                  + resultSet.getString(TestConstant.firstValue("root.ln.wf01.wt01.status"));
+  //          assertEquals(retArray[cnt], ans);
+  //          cnt++;
+  //        }
+  //        assertEquals(retArray.length, cnt);
+  //      }
+  //
+  //      hasResultSet =
+  //          statement.execute(
+  //              "select sum(temperature), avg(hardware), max_time(status), "
+  //                  + "min_value(temperature), max_value(hardware), first_value(status) "
+  //                  + "from root.ln.wf01.wt01 "
+  //                  + "WHERE temperature >= 25 and status = false "
+  //                  + "GROUP BY ([117, 155), 5ms) "
+  //                  + "FILL(double[linear, 12ms, 12ms], int32[linear, 12ms, 18ms], "
+  //                  + "int64[previousUntilLast, 17ms], boolean[true]) "
+  //                  + "order by time desc");
+  //      assertTrue(hasResultSet);
+  //      try (ResultSet resultSet = statement.getResultSet()) {
+  //        cnt = 0;
+  //        while (resultSet.next()) {
+  //          String ans =
+  //              resultSet.getString(TIMESTAMP_STR)
+  //                  + ","
+  //                  + resultSet.getString(sum("root.ln.wf01.wt01.temperature"))
+  //                  + ","
+  //                  + resultSet.getString(avg("root.ln.wf01.wt01.hardware"))
+  //                  + ","
+  //                  + resultSet.getString(TestConstant.maxTime("root.ln.wf01.wt01.status"))
+  //                  + ","
+  //                  + resultSet.getString(TestConstant.minValue("root.ln.wf01.wt01.temperature"))
+  //                  + ","
+  //                  + resultSet.getString(TestConstant.maxValue("root.ln.wf01.wt01.hardware"))
+  //                  + ","
+  //                  + resultSet.getString(TestConstant.firstValue("root.ln.wf01.wt01.status"));
+  //          assertEquals(retArray[retArray.length - cnt - 1], ans);
+  //          cnt++;
+  //        }
+  //        assertEquals(retArray.length, cnt);
+  //      }
+  //    } catch (Exception e) {
+  //      e.printStackTrace();
+  //      fail(e.getMessage());
+  //    }
+  //  }
 }
diff --git a/server/src/main/java/org/apache/iotdb/db/qp/logical/crud/FillClauseComponent.java b/server/src/main/java/org/apache/iotdb/db/qp/logical/crud/FillClauseComponent.java
index ea2f6ca..9ad352d 100644
--- a/server/src/main/java/org/apache/iotdb/db/qp/logical/crud/FillClauseComponent.java
+++ b/server/src/main/java/org/apache/iotdb/db/qp/logical/crud/FillClauseComponent.java
@@ -27,6 +27,7 @@ import java.util.Map;
 public class FillClauseComponent extends SpecialClauseComponent {
 
   private Map<TSDataType, IFill> fillTypes;
+  private IFill singleFill;
 
   public FillClauseComponent() {}
 
@@ -34,7 +35,15 @@ public class FillClauseComponent extends SpecialClauseComponent {
     return fillTypes;
   }
 
+  public IFill getSingleFill() {
+    return singleFill;
+  }
+
   public void setFillTypes(Map<TSDataType, IFill> fillTypes) {
     this.fillTypes = fillTypes;
   }
+
+  public void setSingleFill(IFill singleFill) {
+    this.singleFill = singleFill;
+  }
 }
diff --git a/server/src/main/java/org/apache/iotdb/db/qp/logical/crud/FillQueryOperator.java b/server/src/main/java/org/apache/iotdb/db/qp/logical/crud/FillQueryOperator.java
index 3f05db9..583ab6d 100644
--- a/server/src/main/java/org/apache/iotdb/db/qp/logical/crud/FillQueryOperator.java
+++ b/server/src/main/java/org/apache/iotdb/db/qp/logical/crud/FillQueryOperator.java
@@ -84,6 +84,8 @@ public class FillQueryOperator extends QueryOperator {
     FilterOperator timeFilter = whereComponent.getFilterOperator();
     long time = Long.parseLong(((BasicFunctionOperator) timeFilter).getValue());
     fillQueryPlan.setQueryTime(time);
+    fillQueryPlan.setSingleFill(((FillClauseComponent) specialClauseComponent).getSingleFill());
+    // old type fill logic
     fillQueryPlan.setFillType(((FillClauseComponent) specialClauseComponent).getFillTypes());
     return fillQueryPlan;
   }
diff --git a/server/src/main/java/org/apache/iotdb/db/qp/logical/crud/GroupByFillClauseComponent.java b/server/src/main/java/org/apache/iotdb/db/qp/logical/crud/GroupByFillClauseComponent.java
index 562d9bb..46cf84a 100644
--- a/server/src/main/java/org/apache/iotdb/db/qp/logical/crud/GroupByFillClauseComponent.java
+++ b/server/src/main/java/org/apache/iotdb/db/qp/logical/crud/GroupByFillClauseComponent.java
@@ -27,13 +27,22 @@ import java.util.Map;
 public class GroupByFillClauseComponent extends GroupByClauseComponent {
 
   private Map<TSDataType, IFill> fillTypes;
+  private IFill singleFill;
 
   public GroupByFillClauseComponent() {}
 
+  public IFill getSingleFill() {
+    return singleFill;
+  }
+
   public Map<TSDataType, IFill> getFillTypes() {
     return fillTypes;
   }
 
+  public void setSingleFill(IFill singleFill) {
+    this.singleFill = singleFill;
+  }
+
   public void setFillTypes(Map<TSDataType, IFill> fillTypes) {
     this.fillTypes = fillTypes;
   }
diff --git a/server/src/main/java/org/apache/iotdb/db/qp/logical/crud/GroupByFillQueryOperator.java b/server/src/main/java/org/apache/iotdb/db/qp/logical/crud/GroupByFillQueryOperator.java
index e849b07..485432d 100644
--- a/server/src/main/java/org/apache/iotdb/db/qp/logical/crud/GroupByFillQueryOperator.java
+++ b/server/src/main/java/org/apache/iotdb/db/qp/logical/crud/GroupByFillQueryOperator.java
@@ -52,6 +52,8 @@ public class GroupByFillQueryOperator extends GroupByQueryOperator {
         (GroupByTimeFillPlan) super.initGroupByTimePlan(queryPlan);
     GroupByFillClauseComponent groupByFillClauseComponent =
         (GroupByFillClauseComponent) specialClauseComponent;
+    groupByTimeFillPlan.setSingleFill(groupByFillClauseComponent.getSingleFill());
+    // old type fill logic
     groupByTimeFillPlan.setFillType(groupByFillClauseComponent.getFillTypes());
 
     return groupByTimeFillPlan;
diff --git a/server/src/main/java/org/apache/iotdb/db/qp/physical/crud/FillQueryPlan.java b/server/src/main/java/org/apache/iotdb/db/qp/physical/crud/FillQueryPlan.java
index a952e7b..4f50776 100644
--- a/server/src/main/java/org/apache/iotdb/db/qp/physical/crud/FillQueryPlan.java
+++ b/server/src/main/java/org/apache/iotdb/db/qp/physical/crud/FillQueryPlan.java
@@ -28,6 +28,7 @@ public class FillQueryPlan extends RawDataQueryPlan {
 
   private long queryTime;
   private Map<TSDataType, IFill> fillType;
+  private IFill singleFill;
 
   public FillQueryPlan() {
     super();
@@ -42,10 +43,18 @@ public class FillQueryPlan extends RawDataQueryPlan {
     this.queryTime = queryTime;
   }
 
+  public IFill getSingleFill() {
+    return singleFill;
+  }
+
   public Map<TSDataType, IFill> getFillType() {
     return fillType;
   }
 
+  public void setSingleFill(IFill singleFill) {
+    this.singleFill = singleFill;
+  }
+
   public void setFillType(Map<TSDataType, IFill> fillType) {
     this.fillType = fillType;
   }
diff --git a/server/src/main/java/org/apache/iotdb/db/qp/physical/crud/GroupByTimeFillPlan.java b/server/src/main/java/org/apache/iotdb/db/qp/physical/crud/GroupByTimeFillPlan.java
index c5d741b..a23dc20 100644
--- a/server/src/main/java/org/apache/iotdb/db/qp/physical/crud/GroupByTimeFillPlan.java
+++ b/server/src/main/java/org/apache/iotdb/db/qp/physical/crud/GroupByTimeFillPlan.java
@@ -27,16 +27,25 @@ import java.util.Map;
 public class GroupByTimeFillPlan extends GroupByTimePlan {
 
   private Map<TSDataType, IFill> fillTypes;
+  private IFill singleFill;
 
   public GroupByTimeFillPlan() {
     super();
     setOperatorType(Operator.OperatorType.GROUP_BY_FILL);
   }
 
+  public IFill getSingleFill() {
+    return singleFill;
+  }
+
   public Map<TSDataType, IFill> getFillType() {
     return fillTypes;
   }
 
+  public void setSingleFill(IFill singleFill) {
+    this.singleFill = singleFill;
+  }
+
   public void setFillType(Map<TSDataType, IFill> fillTypes) {
     this.fillTypes = fillTypes;
   }
diff --git a/server/src/main/java/org/apache/iotdb/db/qp/sql/IoTDBSqlVisitor.java b/server/src/main/java/org/apache/iotdb/db/qp/sql/IoTDBSqlVisitor.java
index 2b069c4..2f891d3 100644
--- a/server/src/main/java/org/apache/iotdb/db/qp/sql/IoTDBSqlVisitor.java
+++ b/server/src/main/java/org/apache/iotdb/db/qp/sql/IoTDBSqlVisitor.java
@@ -1306,16 +1306,40 @@ public class IoTDBSqlVisitor extends IoTDBSqlParserBaseVisitor<Operator> {
 
     parseTimeInterval(ctx.timeInterval(), groupByFillClauseComponent);
 
-    List<IoTDBSqlParser.TypeClauseContext> list = ctx.typeClause();
-    Map<TSDataType, IFill> fillTypes = new EnumMap<>(TSDataType.class);
-    for (IoTDBSqlParser.TypeClauseContext typeClause : list) {
-      if (typeClause.ALL() != null) {
-        parseAllTypeClause(typeClause, fillTypes);
-      } else {
-        parsePrimitiveTypeClause(typeClause, fillTypes);
+    if (ctx.fillClause().oldTypeClause().size() > 0) {
+      // old type fill logic
+      List<IoTDBSqlParser.OldTypeClauseContext> list = ctx.fillClause().oldTypeClause();
+      Map<TSDataType, IFill> fillTypes = new EnumMap<>(TSDataType.class);
+      for (IoTDBSqlParser.OldTypeClauseContext typeClause : list) {
+        if (typeClause.ALL() != null) {
+          parseAllTypeClause(typeClause, fillTypes);
+        } else {
+          parsePrimitiveTypeClause(typeClause, fillTypes);
+        }
+      }
+
+      int usePrevious = 0;
+      int useLinear = 0;
+      int useValue = 0;
+      for (IFill iFill : fillTypes.values()) {
+        if (iFill instanceof PreviousFill) {
+          usePrevious = 1;
+        }
+        if (iFill instanceof LinearFill) {
+          useLinear = 1;
+        }
+        if (iFill instanceof ValueFill) {
+          useValue = 1;
+        }
       }
+      if (usePrevious + useLinear + useValue > 1) {
+        throw new SQLParserException("The old type logic could only use one type of fill");
+      }
+
+      groupByFillClauseComponent.setFillTypes(fillTypes);
+    } else {
+      groupByFillClauseComponent.setSingleFill(getSingleIFill(ctx.fillClause()));
     }
-    groupByFillClauseComponent.setFillTypes(fillTypes);
     queryOp.setSpecialClauseComponent(groupByFillClauseComponent);
   }
 
@@ -1332,20 +1356,27 @@ public class IoTDBSqlVisitor extends IoTDBSqlParserBaseVisitor<Operator> {
 
   public void parseFillClause(IoTDBSqlParser.FillClauseContext ctx) {
     FillClauseComponent fillClauseComponent = new FillClauseComponent();
-    List<IoTDBSqlParser.TypeClauseContext> list = ctx.typeClause();
-    Map<TSDataType, IFill> fillTypes = new EnumMap<>(TSDataType.class);
-    for (IoTDBSqlParser.TypeClauseContext typeClause : list) {
-      if (typeClause.ALL() != null) {
-        if (typeClause.linearClause() != null) {
-          throw new SQLParserException("fill all doesn't support linear fill");
+
+    if (ctx.oldTypeClause().size() > 0) {
+      // old type fill logic
+      List<IoTDBSqlParser.OldTypeClauseContext> list = ctx.oldTypeClause();
+      Map<TSDataType, IFill> fillTypes = new EnumMap<>(TSDataType.class);
+      for (IoTDBSqlParser.OldTypeClauseContext typeClause : list) {
+        if (typeClause.ALL() != null) {
+          if (typeClause.linearClause() != null) {
+            throw new SQLParserException("fill all doesn't support linear fill");
+          }
+          parseAllTypeClause(typeClause, fillTypes);
+          break;
+        } else {
+          parsePrimitiveTypeClause(typeClause, fillTypes);
         }
-        parseAllTypeClause(typeClause, fillTypes);
-        break;
-      } else {
-        parsePrimitiveTypeClause(typeClause, fillTypes);
       }
+      fillClauseComponent.setFillTypes(fillTypes);
+    } else {
+      // new single fill logic
+      fillClauseComponent.setSingleFill(getSingleIFill(ctx));
     }
-    fillClauseComponent.setFillTypes(fillTypes);
     queryOp.setSpecialClauseComponent(fillClauseComponent);
   }
 
@@ -1388,8 +1419,43 @@ public class IoTDBSqlVisitor extends IoTDBSqlParserBaseVisitor<Operator> {
     queryOp.setSpecialClauseComponent(specialClauseComponent);
   }
 
+  private IFill getSingleIFill(IoTDBSqlParser.FillClauseContext ctx) {
+    int defaultFillInterval = IoTDBDescriptor.getInstance().getConfig().getDefaultFillInterval();
+    if (ctx.linearClause() != null) { // linear
+      if (ctx.linearClause().DURATION_LITERAL(0) != null) {
+        String beforeStr = ctx.linearClause().DURATION_LITERAL(0).getText();
+        String afterStr = ctx.linearClause().DURATION_LITERAL(1).getText();
+        return new LinearFill(beforeStr, afterStr);
+      } else {
+        return new LinearFill(defaultFillInterval, defaultFillInterval);
+      }
+    } else if (ctx.previousClause() != null) { // previous
+      if (ctx.previousClause().DURATION_LITERAL() != null) {
+        String preRangeStr = ctx.previousClause().DURATION_LITERAL().getText();
+        return new PreviousFill(preRangeStr);
+      } else {
+        return new PreviousFill(defaultFillInterval);
+      }
+    } else if (ctx.specificValueClause() != null) { // value
+      if (ctx.specificValueClause().constant() != null) {
+        return new ValueFill(ctx.specificValueClause().constant().getText());
+      } else {
+        throw new SQLParserException("fill value cannot be null");
+      }
+    } else if (ctx.previousUntilLastClause() != null) { // previous until last
+      if (ctx.previousUntilLastClause().DURATION_LITERAL() != null) {
+        String preRangeStr = ctx.previousUntilLastClause().DURATION_LITERAL().getText();
+        return new PreviousFill(preRangeStr, true);
+      } else {
+        return new PreviousFill(defaultFillInterval, true);
+      }
+    } else {
+      throw new SQLParserException("unknown single fill type");
+    }
+  }
+
   private void parseAllTypeClause(
-      IoTDBSqlParser.TypeClauseContext ctx, Map<TSDataType, IFill> fillTypes) {
+      IoTDBSqlParser.OldTypeClauseContext ctx, Map<TSDataType, IFill> fillTypes) {
     IFill fill;
     int defaultFillInterval = IoTDBDescriptor.getInstance().getConfig().getDefaultFillInterval();
 
@@ -1433,7 +1499,7 @@ public class IoTDBSqlVisitor extends IoTDBSqlParserBaseVisitor<Operator> {
   }
 
   private void parsePrimitiveTypeClause(
-      IoTDBSqlParser.TypeClauseContext ctx, Map<TSDataType, IFill> fillTypes) {
+      IoTDBSqlParser.OldTypeClauseContext ctx, Map<TSDataType, IFill> fillTypes) {
     TSDataType dataType = parseType(ctx.dataType.getText());
     if (dataType == TSDataType.VECTOR) {
       throw new SQLParserException(String.format("type %s cannot use fill function", dataType));
diff --git a/server/src/main/java/org/apache/iotdb/db/query/dataset/groupby/GroupByFillEngineDataSet.java b/server/src/main/java/org/apache/iotdb/db/query/dataset/groupby/GroupByFillEngineDataSet.java
index e3684a4..27a4caa 100644
--- a/server/src/main/java/org/apache/iotdb/db/query/dataset/groupby/GroupByFillEngineDataSet.java
+++ b/server/src/main/java/org/apache/iotdb/db/query/dataset/groupby/GroupByFillEngineDataSet.java
@@ -47,6 +47,7 @@ import java.util.Objects;
 public abstract class GroupByFillEngineDataSet extends GroupByEngineDataSet {
 
   protected Map<TSDataType, IFill> fillTypes;
+  protected IFill singleFill;
   protected final List<PartialPath> deduplicatedPaths;
   protected final List<String> aggregations;
   protected final Map<PartialPath, List<Integer>> resultIndexes = new HashMap<>();
@@ -85,6 +86,7 @@ public abstract class GroupByFillEngineDataSet extends GroupByEngineDataSet {
     super(context, groupByTimeFillPlan);
     this.aggregations = groupByTimeFillPlan.getDeduplicatedAggregations();
     this.fillTypes = groupByTimeFillPlan.getFillType();
+    this.singleFill = groupByTimeFillPlan.getSingleFill();
 
     this.deduplicatedPaths = new ArrayList<>();
     for (int i = 0; i < paths.size(); i++) {
@@ -170,10 +172,17 @@ public abstract class GroupByFillEngineDataSet extends GroupByEngineDataSet {
         continue;
       }
 
-      IFill fill = fillTypes.get(resultDataType[resultIndex]);
+      IFill fill;
+      if (fillTypes != null) {
+        // old type fill logic
+        fill = fillTypes.get(resultDataType[resultIndex]);
+      } else {
+        fill = singleFill;
+      }
       if (fill == null) {
         continue;
       }
+
       if (fill instanceof PreviousFill && isExtraPrevious) {
         if (fill.getQueryStartTime() <= extraStartTime) {
           return true;
@@ -252,7 +261,13 @@ public abstract class GroupByFillEngineDataSet extends GroupByEngineDataSet {
       return;
     }
 
-    IFill fill = fillTypes.get(resultDataType[resultId]);
+    IFill fill;
+    if (fillTypes != null) {
+      // old type fill logic
+      fill = fillTypes.get(resultDataType[resultId]);
+    } else {
+      fill = singleFill;
+    }
     if (fill == null) {
       record.addField(null);
       return;
@@ -298,6 +313,9 @@ public abstract class GroupByFillEngineDataSet extends GroupByEngineDataSet {
     } else if (fill instanceof ValueFill) {
       try {
         TimeValuePair filledPair = fill.getFillResult();
+        if (filledPair == null) {
+          filledPair = ((ValueFill) fill).getSpecifiedFillResult(resultDataType[resultId]);
+        }
         record.addField(filledPair.getValue().getValue(), resultDataType[resultId]);
       } catch (QueryProcessException | StorageEngineException e) {
         throw new IOException(e);
diff --git a/server/src/main/java/org/apache/iotdb/db/query/dataset/groupby/GroupByFillWithValueFilterDataSet.java b/server/src/main/java/org/apache/iotdb/db/query/dataset/groupby/GroupByFillWithValueFilterDataSet.java
index 4ed61cc..f42d2cc 100644
--- a/server/src/main/java/org/apache/iotdb/db/query/dataset/groupby/GroupByFillWithValueFilterDataSet.java
+++ b/server/src/main/java/org/apache/iotdb/db/query/dataset/groupby/GroupByFillWithValueFilterDataSet.java
@@ -177,15 +177,28 @@ public class GroupByFillWithValueFilterDataSet extends GroupByFillEngineDataSet
       throws StorageEngineException, QueryProcessException {
     long minQueryStartTime = Long.MAX_VALUE;
     long maxQueryEndTime = Long.MIN_VALUE;
-    for (Map.Entry<TSDataType, IFill> IFillEntry : fillTypes.entrySet()) {
-      IFill fill = IFillEntry.getValue();
+    if (fillTypes != null) {
+      // old type fill logic
+      for (Map.Entry<TSDataType, IFill> IFillEntry : fillTypes.entrySet()) {
+        IFill fill = IFillEntry.getValue();
+        if (fill instanceof PreviousFill) {
+          fill.convertRange(startTime, endTime);
+          minQueryStartTime = Math.min(minQueryStartTime, fill.getQueryStartTime());
+        } else if (fill instanceof LinearFill) {
+          fill.convertRange(startTime, endTime);
+          minQueryStartTime = Math.min(minQueryStartTime, fill.getQueryStartTime());
+          maxQueryEndTime = Math.max(maxQueryEndTime, fill.getQueryEndTime());
+        }
+      }
+    } else {
+      IFill fill = singleFill;
       if (fill instanceof PreviousFill) {
         fill.convertRange(startTime, endTime);
-        minQueryStartTime = Math.min(minQueryStartTime, fill.getQueryStartTime());
+        minQueryStartTime = fill.getQueryStartTime();
       } else if (fill instanceof LinearFill) {
         fill.convertRange(startTime, endTime);
-        minQueryStartTime = Math.min(minQueryStartTime, fill.getQueryStartTime());
-        maxQueryEndTime = Math.max(maxQueryEndTime, fill.getQueryEndTime());
+        minQueryStartTime = fill.getQueryStartTime();
+        maxQueryEndTime = fill.getQueryEndTime();
       }
     }
 
diff --git a/server/src/main/java/org/apache/iotdb/db/query/dataset/groupby/GroupByFillWithoutValueFilterDataSet.java b/server/src/main/java/org/apache/iotdb/db/query/dataset/groupby/GroupByFillWithoutValueFilterDataSet.java
index aa608ef..c4151a5 100644
--- a/server/src/main/java/org/apache/iotdb/db/query/dataset/groupby/GroupByFillWithoutValueFilterDataSet.java
+++ b/server/src/main/java/org/apache/iotdb/db/query/dataset/groupby/GroupByFillWithoutValueFilterDataSet.java
@@ -142,16 +142,28 @@ public class GroupByFillWithoutValueFilterDataSet extends GroupByFillEngineDataS
       throws StorageEngineException, QueryProcessException {
     long minQueryStartTime = Long.MAX_VALUE;
     long maxQueryEndTime = Long.MIN_VALUE;
-    this.fillTypes = groupByTimeFillPlan.getFillType();
-    for (Map.Entry<TSDataType, IFill> IFillEntry : fillTypes.entrySet()) {
-      IFill fill = IFillEntry.getValue();
+    if (fillTypes != null) {
+      // old type fill logic
+      for (Map.Entry<TSDataType, IFill> IFillEntry : fillTypes.entrySet()) {
+        IFill fill = IFillEntry.getValue();
+        if (fill instanceof PreviousFill) {
+          fill.convertRange(startTime, endTime);
+          minQueryStartTime = Math.min(minQueryStartTime, fill.getQueryStartTime());
+        } else if (fill instanceof LinearFill) {
+          fill.convertRange(startTime, endTime);
+          minQueryStartTime = Math.min(minQueryStartTime, fill.getQueryStartTime());
+          maxQueryEndTime = Math.max(maxQueryEndTime, fill.getQueryEndTime());
+        }
+      }
+    } else {
+      IFill fill = singleFill;
       if (fill instanceof PreviousFill) {
         fill.convertRange(startTime, endTime);
-        minQueryStartTime = Math.min(minQueryStartTime, fill.getQueryStartTime());
+        minQueryStartTime = fill.getQueryStartTime();
       } else if (fill instanceof LinearFill) {
         fill.convertRange(startTime, endTime);
-        minQueryStartTime = Math.min(minQueryStartTime, fill.getQueryStartTime());
-        maxQueryEndTime = Math.max(maxQueryEndTime, fill.getQueryEndTime());
+        minQueryStartTime = fill.getQueryStartTime();
+        maxQueryEndTime = fill.getQueryEndTime();
       }
     }
 
diff --git a/server/src/main/java/org/apache/iotdb/db/query/executor/FillQueryExecutor.java b/server/src/main/java/org/apache/iotdb/db/query/executor/FillQueryExecutor.java
index a8ed113..d4331ea 100644
--- a/server/src/main/java/org/apache/iotdb/db/query/executor/FillQueryExecutor.java
+++ b/server/src/main/java/org/apache/iotdb/db/query/executor/FillQueryExecutor.java
@@ -32,6 +32,7 @@ import org.apache.iotdb.db.query.control.QueryResourceManager;
 import org.apache.iotdb.db.query.dataset.SingleDataSet;
 import org.apache.iotdb.db.query.executor.fill.IFill;
 import org.apache.iotdb.db.query.executor.fill.PreviousFill;
+import org.apache.iotdb.db.query.executor.fill.ValueFill;
 import org.apache.iotdb.db.query.reader.series.ManagedSeriesReader;
 import org.apache.iotdb.db.query.reader.series.SeriesRawDataBatchReader;
 import org.apache.iotdb.tsfile.file.metadata.enums.TSDataType;
@@ -56,11 +57,13 @@ public class FillQueryExecutor {
   protected List<PartialPath> selectedSeries;
   protected List<TSDataType> dataTypes;
   protected Map<TSDataType, IFill> typeIFillMap;
+  protected IFill singleFill;
   protected long queryTime;
 
   public FillQueryExecutor(FillQueryPlan fillQueryPlan) {
     this.plan = fillQueryPlan;
     this.selectedSeries = plan.getDeduplicatedPaths();
+    this.singleFill = plan.getSingleFill();
     this.typeIFillMap = plan.getFillType();
     this.dataTypes = plan.getDeduplicatedDataTypes();
     this.queryTime = plan.getQueryTime();
@@ -90,7 +93,10 @@ public class FillQueryExecutor {
         }
 
         IFill fill;
-        if (!typeIFillMap.containsKey(dataType)) {
+        if (singleFill != null) {
+          fill = singleFill.copy();
+        } else if (!typeIFillMap.containsKey(dataType)) {
+          // old type fill logic
           switch (dataType) {
             case INT32:
             case INT64:
@@ -104,6 +110,7 @@ public class FillQueryExecutor {
               throw new UnsupportedDataTypeException("unsupported data type " + dataType);
           }
         } else {
+          // old type fill logic
           fill = typeIFillMap.get(dataType).copy();
         }
         fill =
@@ -115,7 +122,16 @@ public class FillQueryExecutor {
                 plan.getAllMeasurementsInDevice(path.getDevice()),
                 context);
 
-        TimeValuePair timeValuePair = fill.getFillResult();
+        TimeValuePair timeValuePair;
+        try {
+          timeValuePair = fill.getFillResult();
+          if (timeValuePair == null && fill instanceof ValueFill) {
+            timeValuePair = ((ValueFill) fill).getSpecifiedFillResult(dataType);
+          }
+        } catch (QueryProcessException | NumberFormatException ignored) {
+          record.addField(null);
+          continue;
+        }
         if (timeValuePair == null || timeValuePair.getValue() == null) {
           record.addField(null);
         } else {
diff --git a/server/src/main/java/org/apache/iotdb/db/query/executor/fill/ValueFill.java b/server/src/main/java/org/apache/iotdb/db/query/executor/fill/ValueFill.java
index 8f56494..51949d7 100644
--- a/server/src/main/java/org/apache/iotdb/db/query/executor/fill/ValueFill.java
+++ b/server/src/main/java/org/apache/iotdb/db/query/executor/fill/ValueFill.java
@@ -18,6 +18,7 @@
  */
 package org.apache.iotdb.db.query.executor.fill;
 
+import org.apache.iotdb.db.exception.query.QueryProcessException;
 import org.apache.iotdb.db.metadata.path.PartialPath;
 import org.apache.iotdb.db.query.context.QueryContext;
 import org.apache.iotdb.tsfile.exception.write.UnSupportedDataTypeException;
@@ -34,6 +35,12 @@ public class ValueFill extends IFill implements Cloneable {
 
   private TsPrimitiveType tsPrimitiveType;
 
+  private String singleStringValue;
+
+  public ValueFill(String singleStringValue) {
+    this.singleStringValue = singleStringValue;
+  }
+
   public ValueFill(String value, TSDataType dataType) {
     this.value = value;
     this.dataType = dataType;
@@ -67,14 +74,49 @@ public class ValueFill extends IFill implements Cloneable {
 
   @Override
   public TimeValuePair getFillResult() {
+    if (tsPrimitiveType != null) {
+      switch (dataType) {
+        case BOOLEAN:
+        case INT32:
+        case INT64:
+        case FLOAT:
+        case DOUBLE:
+        case TEXT:
+          return new TimeValuePair(queryStartTime, tsPrimitiveType);
+        default:
+          throw new UnSupportedDataTypeException("Unsupported data type:" + dataType);
+      }
+    } else {
+      return null;
+    }
+  }
+
+  public TimeValuePair getSpecifiedFillResult(TSDataType dataType) throws QueryProcessException {
     switch (dataType) {
       case BOOLEAN:
+        // Fill only if the fill value is true or false
+        if (singleStringValue.equals("true")) {
+          return new TimeValuePair(queryStartTime, new TsPrimitiveType.TsBoolean(true));
+        } else if (singleStringValue.equals("false")) {
+          return new TimeValuePair(queryStartTime, new TsPrimitiveType.TsBoolean(false));
+        } else {
+          return null;
+        }
       case INT32:
+        return new TimeValuePair(
+            queryStartTime, new TsPrimitiveType.TsInt(Integer.parseInt(singleStringValue)));
       case INT64:
+        return new TimeValuePair(
+            queryStartTime, new TsPrimitiveType.TsLong(Long.parseLong(singleStringValue)));
       case FLOAT:
+        return new TimeValuePair(
+            queryStartTime, new TsPrimitiveType.TsFloat(Float.parseFloat(singleStringValue)));
       case DOUBLE:
+        return new TimeValuePair(
+            queryStartTime, new TsPrimitiveType.TsDouble(Double.parseDouble(singleStringValue)));
       case TEXT:
-        return new TimeValuePair(queryStartTime, tsPrimitiveType);
+        return new TimeValuePair(
+            queryStartTime, new TsPrimitiveType.TsBinary(Binary.valueOf(singleStringValue)));
       default:
         throw new UnSupportedDataTypeException("Unsupported data type:" + dataType);
     }