You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by hu...@apache.org on 2022/11/21 04:07:48 UTC

[iotdb] branch master updated: [IOTDB-4841] Upgrade user guide (query part) (#7879)

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

hui 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 0cf7e521e9 [IOTDB-4841] Upgrade user guide (query part) (#7879)
0cf7e521e9 is described below

commit 0cf7e521e925d9bb8aeb525fbe479217a3af6543
Author: liuminghui233 <36...@users.noreply.github.com>
AuthorDate: Mon Nov 21 12:07:43 2022 +0800

    [IOTDB-4841] Upgrade user guide (query part) (#7879)
---
 .../org/apache/iotdb/db/qp/sql/IoTDBSqlParser.g4   |    7 +-
 docs/UserGuide/Process-Data/Select-Into.md         |   22 +-
 docs/UserGuide/Query-Data/Fill-Null-Value.md       |  116 +-
 docs/UserGuide/Query-Data/Last-Query.md            |   16 +-
 docs/UserGuide/Query-Data/Overview.md              |   16 +-
 docs/UserGuide/Query-Data/Pagination.md            |   37 +-
 docs/UserGuide/Query-Data/Query-Filter.md          |    7 +-
 docs/UserGuide/Query-Data/Result-Format.md         |   31 +-
 docs/UserGuide/Query-Data/Select-Expression.md     |   19 -
 docs/UserGuide/Query-Data/Tracing-Tool.md          |   48 -
 docs/UserGuide/Query-Data/Without-Null.md          |  172 ---
 docs/UserGuide/Reference/Syntax-Conventions.md     |    6 +-
 docs/zh/UserGuide/Monitor-Alert/Alerting.md        |    2 +-
 .../UserGuide/Operators-Functions/Aggregation.md   |   41 +
 .../Anomaly-Detection.md                           |   32 +-
 .../zh/UserGuide/Operators-Functions/Comparison.md |  309 ++++++
 docs/zh/UserGuide/Operators-Functions/Constant.md  |   57 +
 .../Operators-Functions/Continuous-Interval.md     |   75 ++
 .../zh/UserGuide/Operators-Functions/Conversion.md |  131 +++
 .../Data-Matching.md                               |   32 +-
 .../Data-Profiling.md                              |   32 +-
 .../Data-Quality.md                                |   32 +-
 .../Data-Repairing.md                              |   32 +-
 .../Frequency-Domain.md                            |   32 +-
 docs/zh/UserGuide/Operators-Functions/Lambda.md    |   83 ++
 docs/zh/UserGuide/Operators-Functions/Logical.md   |   63 ++
 .../UserGuide/Operators-Functions/Mathematical.md  |  116 ++
 docs/zh/UserGuide/Operators-Functions/Overview.md  |  239 ++++
 docs/zh/UserGuide/Operators-Functions/Sample.md    |  408 +++++++
 docs/zh/UserGuide/Operators-Functions/Selection.md |   51 +
 .../Series-Discovery.md                            |   32 +-
 .../String.md}                                     |  104 +-
 .../Time-Series.md}                                |   36 +-
 .../User-Defined-Function.md}                      |    4 +-
 .../Operators-Functions/Variation-Trend.md         |   54 +
 docs/zh/UserGuide/Query-Data/Align-By.md           |   61 +
 .../Continuous-Query.md                            |    0
 .../Query-Data/{Fill-Null-Value.md => Fill.md}     |  134 ++-
 .../Query-Data/{Aggregate-Query.md => Group-By.md} |  346 ++----
 docs/zh/UserGuide/Query-Data/Having-Condition.md   |  115 ++
 docs/zh/UserGuide/Query-Data/Last-Query.md         |   24 +-
 .../{UDF-Library/M4.md => Query-Data/Order-By.md}  |    6 +-
 docs/zh/UserGuide/Query-Data/Overview.md           |  118 +-
 docs/zh/UserGuide/Query-Data/Pagination.md         |  118 +-
 .../Query-Data/Performance-Tracing-Tool.md         |   51 -
 docs/zh/UserGuide/Query-Data/Result-Format.md      |   89 --
 docs/zh/UserGuide/Query-Data/Select-Expression.md  | 1173 ++------------------
 .../{Process-Data => Query-Data}/Select-Into.md    |   24 +-
 docs/zh/UserGuide/Query-Data/Tracing-Tool.md       |   48 -
 .../{Query-Filter.md => Where-Condition.md}        |   21 +-
 docs/zh/UserGuide/Query-Data/Without-Null.md       |  172 ---
 docs/zh/UserGuide/Reference/Syntax-Conventions.md  |    6 +-
 .../Triggers.md => Trigger/Trigger.md}             |    0
 docs/zh/UserGuide/UDF-Library/Quick-Start.md       |   40 -
 .../config/metadata/ShowFunctionsTask.java         |   15 +-
 .../iotdb/db/mpp/plan/parser/ASTVisitor.java       |    2 +-
 .../apache/iotdb/db/qp/sql/IoTDBSqlVisitor.java    |    4 +-
 site/src/main/.vuepress/config.js                  |   84 +-
 58 files changed, 2576 insertions(+), 2569 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 0146d26e72..154af7b35d 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
@@ -410,7 +410,10 @@ tagWhereClause
 
 // Select Statement
 selectStatement
-    : TRACING? selectClause intoClause? fromClause whereClause? specialClause?
+    : selectClause
+        intoClause?
+        fromClause
+        whereClause? specialClause?
     ;
 
 intoClause
@@ -913,7 +916,7 @@ expression
     | leftExpression=expression (STAR | DIV | MOD) rightExpression=expression
     | leftExpression=expression (PLUS | MINUS) rightExpression=expression
     | leftExpression=expression (OPERATOR_GT | OPERATOR_GTE | OPERATOR_LT | OPERATOR_LTE | OPERATOR_SEQ | OPERATOR_DEQ | OPERATOR_NEQ) rightExpression=expression
-    | unaryBeforeRegularOrLikeExpression=expression (REGEXP | LIKE) STRING_LITERAL
+    | unaryBeforeRegularOrLikeExpression=expression OPERATOR_NOT? (REGEXP | LIKE) STRING_LITERAL
     | firstExpression=expression OPERATOR_NOT? OPERATOR_BETWEEN secondExpression=expression OPERATOR_AND thirdExpression=expression
     | unaryBeforeIsNullExpression=expression OPERATOR_IS OPERATOR_NOT? NULL_LITERAL
     | unaryBeforeInExpression=expression OPERATOR_NOT? (OPERATOR_IN | OPERATOR_CONTAINS) LR_BRACKET constant (COMMA constant)* RR_BRACKET
diff --git a/docs/UserGuide/Process-Data/Select-Into.md b/docs/UserGuide/Process-Data/Select-Into.md
index dd82e90023..4b1a28fcc9 100644
--- a/docs/UserGuide/Process-Data/Select-Into.md
+++ b/docs/UserGuide/Process-Data/Select-Into.md
@@ -26,7 +26,7 @@ The `SELECT INTO` statement copies data from query result set into target time s
 The application scenarios are as follows:
 - **Implement IoTDB internal ETL**: ETL the original data and write a new time series.
 - **Query result storage**: Persistently store the query results, which acts like a materialized view.
-- **Non-aligned time series to aligned time series**:  Rewrite non-aligned time series into aligned time series.
+- **Non-aligned time series to aligned time series**:  Rewrite non-aligned time series into another aligned time series.
 
 ## SQL Syntax
 
@@ -130,8 +130,6 @@ It costs 0.625s
 ```
 This statement also writes the query results of the four time series under the `root.sg` database to the four specified time series under the `root.sg_copy` database. However, in ALIGN BY DEVICE, the number of `intoItem` must be the same as the number of queried devices, and each queried device corresponds to one `intoItem`.
 
-It is easy to see that in the case of ALIGN BY DEVICE query, columns under the same device can only be written to the same target device.
-
 > When aligning the query by device, the result set displayed by `CLI` has one more column, the `source device` column indicating the queried device.
 
 - **Example 4** (aligned by device)
@@ -156,13 +154,11 @@ In particular, We can use variable placeholders to describe the correspondence b
 - Suffix duplication character `::`: Copy the suffix (or measurement) of the query device, indicating that from this layer to the last layer (or measurement) of the device, the node name (or measurement) of the target device corresponds to the queried device The node name (or measurement) is the same.
 - Single-level node matcher `${i}`: Indicates that the current level node name of the target sequence is the same as the i-th level node name of the query sequence. For example, for the path `root.sg1.d1.s1`, `${1}` means `sg1`, `${2}` means `d1`, and `${3}` means `s1`.
 
-Note: The variable placeholder **can only describe the correspondence between time series**, and cannot be used for functions, expressions, etc.
-
 When using variable placeholders, there must be no ambiguity in the correspondence between `intoItem` and the columns of the query result set. The specific cases are classified as follows:
 
 #### ALIGN BY TIME (default)
 
-> Note: If the query includes aggregation and expression calculation, the columns in the query result cannot correspond to a time series, so neither the target device nor the measurement can use variable placeholders.
+> Note: The variable placeholder **can only describe the correspondence between time series**. If the query includes aggregation and expression calculation, the columns in the query result cannot correspond to a time series, so neither the target device nor the measurement can use variable placeholders.
 
 ##### (1) The target device does not use variable placeholders & the target measurement list uses variable placeholders
 
@@ -176,13 +172,13 @@ When using variable placeholders, there must be no ambiguity in the corresponden
 
 ```sql
 select s1, s2
-into root.sg_copy.d1(::), rot.sg_copy.d2(s1), root.sg_copy.d1(${3}), root.sg_copy.d2(::),
+into root.sg_copy.d1(::), root.sg_copy.d2(s1), root.sg_copy.d1(${3}), root.sg_copy.d2(::)
 from root.sg.d1, root.sg.d2;
 ````
 This statement is equivalent to:
 ```sql
 select s1, s2
-into root.sg_copy.d1(s1), rot.sg_copy.d2(s1), root.sg_copy.d1(s2), root.sg_copy.d2(s2),
+into root.sg_copy.d1(s1), root.sg_copy.d2(s1), root.sg_copy.d1(s2), root.sg_copy.d2(s2)
 from root.sg.d1, root.sg.d2;
 ````
 As you can see, the statement is not very simplified in this case.
@@ -213,7 +209,7 @@ Write the query results of all time series under `root.sg` to `root.sg_bk`, the
 
 #### ALIGN BY DEVICE
 
-> Note: If the query includes aggregation and expression calculation, the columns in the query result cannot correspond to a specific physical quantity, so the target measurement cannot use variable placeholders.
+> Note: The variable placeholder **can only describe the correspondence between time series**. If the query includes aggregation and expression calculation, the columns in the query result cannot correspond to a specific physical quantity, so the target measurement cannot use variable placeholders.
 
 ##### (1) The target device does not use variable placeholders & the target measurement list uses variable placeholders
 
@@ -259,6 +255,12 @@ Write the query result of each time series in `root.sg` to the same device, and
 
 We can use the `ALIGNED` keyword to specify the target device for writing to be aligned, and each `intoItem` can be set independently.
 
+**Example:**
+```sql
+select s1, s2 into root.sg_copy.d1(t1, t2), aligned root.sg_copy.d2(t1, t2) from root.sg.d1, root.sg.d2 align by device;
+```
+This statement specifies that `root.sg_copy.d1` is an unaligned device and `root.sg_copy.d2` is an aligned device.
+
 ### Unsupported query clauses
 
 - `SLIMIT`, `SOFFSET`: The query columns are uncertain, so they are not supported.
@@ -306,7 +308,7 @@ It costs 0.115s
 ```
 
 ### Non-aligned time series to aligned time series
-Rewrite non-aligned time series into aligned time series.
+Rewrite non-aligned time series into another aligned time series.
 
 **Note:** It is recommended to use the `LIMIT & OFFSET` clause or the `WHERE` clause (time filter) to batch data to prevent excessive data volume in a single operation.
 
diff --git a/docs/UserGuide/Query-Data/Fill-Null-Value.md b/docs/UserGuide/Query-Data/Fill-Null-Value.md
index 088501ee73..32e619edc7 100644
--- a/docs/UserGuide/Query-Data/Fill-Null-Value.md
+++ b/docs/UserGuide/Query-Data/Fill-Null-Value.md
@@ -21,15 +21,33 @@
 
 # Fill Null Value
 
+## Introduction
+
 When executing some queries, there may be no data for some columns in some rows, and data in these locations will be null, but this kind of null value is not conducive to data visualization and analysis, and the null value needs to be filled.
 
-Fill null value allows the user to fill any query result with null values according to a specific method, such as taking the previous value that is not null, or linear interpolation. The query result after filling the null value can better reflect the data distribution, which is beneficial for users to perform data analysis.
+In IoTDB, users can use the FILL clause to specify the fill mode when data is missing. Fill null value allows the user to fill any query result with null values according to a specific method, such as taking the previous value that is not null, or linear interpolation. The query result after filling the null value can better reflect the data distribution, which is beneficial for users to perform data analysis.
+
+## Syntax Definition
 
-In IoTDB, users can use the FILL clause to specify the fill mode when data is missing. If the queried point's value is not null, the fill function will not work.
+**The following is the syntax definition of the `FILL` clause:**
+
+```sql
+FILL '(' PREVIOUS | LINEAR | constant ')'
+```
+
+**Note:** 
+- We can specify only one fill method in the `FILL` clause, and this method applies to all columns of the result set.
+- Null value fill is not compatible with version 0.13 and previous syntax (`FILL((<data_type>[<fill_method>(, <before_range>, <after_range>)?])+)`) is not supported anymore.
 
 ## Fill Methods
 
-IoTDB supports previous, linear, and value fill methods. Following table lists the data types and supported fill methods.
+**IoTDB supports the following three fill methods:**
+
+- `PREVIOUS`: Fill with the previous non-null value of the column.
+- `LINEAR`: Fill the column with a linear interpolation of the previous non-null value and the next non-null value of the column.
+- Constant: Fill with the specified constant.
+
+**Following table lists the data types and supported fill methods.**
 
 | Data Type | Supported Fill Methods  |
 | :-------- |:------------------------|
@@ -39,25 +57,18 @@ IoTDB supports previous, linear, and value fill methods. Following table lists t
 | float     | previous, linear, value |
 | double    | previous, linear, value |
 | text      | previous, value         |
-| </center> |                         |
-
-> Note: Only one Fill method can be specified in a Fill statement. Null value fill is not compatible with version 0.13 and previous syntax (fill((<data_type>[<fill_method>(, <before_range>, <after_range>)?])+)) is not supported anymore.
 
+**Note:**  For columns whose data type does not support specifying the fill method, we neither fill it nor throw exception, just keep it as it is.
 
-### Previous Fill
+**For examples:**
 
-When the value is null, the value of the previous timestamp is used to fill the blank. The formalized previous method is as follows:
+If we don't use any fill methods:
 
 ```sql
-fill(previous)
+select temperature, status from root.sgcc.wf03.wt01 where time >= 2017-11-01T16:37:00.000 and time <= 2017-11-01T16:40:00.000;
 ```
 
-Here we give an example of filling null values using the previous method. The SQL statement is as follows:
-
-```sql
-select temperature, status from root.sgcc.wf03.wt01 where time >= 2017-11-01T16:37:00.000 and time <= 2017-11-01T16:40:00.000
-```
-if we don't use any fill methods, the original result will be like:
+the original result will be like:
 
 ```
 +-----------------------------+-------------------------------+--------------------------+
@@ -74,12 +85,19 @@ if we don't use any fill methods, the original result will be like:
 Total line number = 4
 ```
 
-if we use previous fill, sql will be like:
+### `PREVIOUS` Fill
+
+**For null values in the query result set, fill with the previous non-null value of the column.**
+
+**Note:** If the first value of this column is null, we will keep first value as null and won't fill it until we meet first non-null value
+
+For example, with `PREVIOUS` fill, the SQL is as follows:
+
 ```sql
-select temperature from root.sgcc.wf03.wt01 where time >= 2017-11-01T16:37:00.000 and time <= 2017-11-01T16:40:00.000 fill(previous)
+select temperature, status from root.sgcc.wf03.wt01 where time >= 2017-11-01T16:37:00.000 and time <= 2017-11-01T16:40:00.000 fill(previous);
 ```
 
-previous filled result will be like:
+result will be like:
 
 ```
 +-----------------------------+-------------------------------+--------------------------+
@@ -96,23 +114,23 @@ previous filled result will be like:
 Total line number = 4
 ```
 
-> Note: If the first value of this column is null, we will keep first value as null and won't fill it until we meet first non-null value
+### `LINEAR` Fill
 
-### Linear Fill
+**For null values in the query result set, fill the column with a linear interpolation of the previous non-null value and the next non-null value of the column.**
 
-When the value in 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
-fill(linear)
-```
+**Note:**
+- If all the values before current value are null or all the values after current value are null, we will keep current value as null and won't fill it.
+- If the column's data type is boolean/text, we neither fill it nor throw exception, just keep it as it is.
 
 Here we give an example of filling null values using the linear method. The SQL statement is as follows:
 
+For example, with `LINEAR` fill, the SQL is as follows:
+
 ```sql
-select temperature from root.sgcc.wf03.wt01 where time >= 2017-11-01T16:37:00.000 and time <= 2017-11-01T16:40:00.000 fill(linear)
+select temperature, status from root.sgcc.wf03.wt01 where time >= 2017-11-01T16:37:00.000 and time <= 2017-11-01T16:40:00.000 fill(linear);
 ```
 
-linear filled result will be like:
+result will be like:
 
 ```
 +-----------------------------+-------------------------------+--------------------------+
@@ -129,25 +147,28 @@ linear filled result will be like:
 Total line number = 4
 ```
 
+### Constant Fill
 
-> Note: If all the values before current value are null or all the values after current value are null, we will keep current value as null and won't fill it.
-> Note: If the column's data type is boolean/text, we neither fill it nor throw exception, just keep it as it is.
+**For null values in the query result set, fill with the specified constant.**
 
-### Value Fill
+**Note:** 
+- When using the ValueFill, IoTDB neither fill the query result if the data type is different from the input constant nor throw exception, just keep it as it is.
 
-When the value in the queried timestamp is null, given fill value is used to fill the blank. The formalized value method is as follows:
+   | Constant Value Data Type | Support Data Type                 |
+   |:-------------------------|:----------------------------------|
+   | `BOOLEAN` | `BOOLEAN` `TEXT` |
+   | `INT64` | `INT32` `INT64` `FLOAT` `DOUBLE` `TEXT` |
+   | `DOUBLE` | `FLOAT` `DOUBLE` `TEXT` |
+   | `TEXT` | `TEXT` |
+- If constant value is larger than Integer.MAX_VALUE, IoTDB neither fill the query result if the data type is int32 nor throw exception, just keep it as it is.
 
-```sql
-fill(constant)
-```
-
-Here we give an example of filling null values using the value method. The SQL statement is as follows:
+For example, with `FLOAT` constant fill, the SQL is as follows:
 
 ```sql
-select temperature from root.sgcc.wf03.wt01 where time = 2017-11-01T16:37:50.000 fill(2.0)
+select temperature, status from root.sgcc.wf03.wt01 where time >= 2017-11-01T16:37:00.000 and time <= 2017-11-01T16:40:00.000 fill(2.0);
 ```
 
-float constant filled result will be like:
+result will be like:
 
 ```
 +-----------------------------+-------------------------------+--------------------------+
@@ -164,11 +185,13 @@ float constant filled result will be like:
 Total line number = 4
 ```
 
+For example, with `BOOLEAN` constant fill, the SQL is as follows:
+
 ```sql
-select temperature from root.sgcc.wf03.wt01 where time = 2017-11-01T16:37:50.000 fill(true)
+select temperature, status from root.sgcc.wf03.wt01 where time >= 2017-11-01T16:37:00.000 and time <= 2017-11-01T16:40:00.000 fill(true);
 ```
 
-boolean constant filled result will be like:
+result will be like:
 
 ```
 +-----------------------------+-------------------------------+--------------------------+
@@ -184,16 +207,3 @@ boolean constant filled result will be like:
 +-----------------------------+-------------------------------+--------------------------+
 Total line number = 4
 ```
-
-> Note: When using the ValueFill, IoTDB neither fill the query result if the data type is different from the input constant nor throw exception, just keep it as it is.
-> Note: If constant value is larger than Integer.MAX_VALUE, IoTDB neither fill the query result if the data type is int32 nor throw exception, just keep it as it is.
-
-#### Constant Fill Type Consistency
-
-| Constant Value Data Type | Support Data Type                 |
-|:-------------------------|:----------------------------------|
-| boolean                  | boolean, text                     |
-| int64                    | int32, int64, float, double, text |
-| double                   | float, double, text               |
-| text                     | text                              |
-| </center>                |                                   |
\ No newline at end of file
diff --git a/docs/UserGuide/Query-Data/Last-Query.md b/docs/UserGuide/Query-Data/Last-Query.md
index 80134b4087..d3c433c5e4 100644
--- a/docs/UserGuide/Query-Data/Last-Query.md
+++ b/docs/UserGuide/Query-Data/Last-Query.md
@@ -33,15 +33,17 @@ select last <Path> [COMMA <Path>]* from < PrefixPath > [COMMA < PrefixPath >]* <
 
 which means: Query and return the last data points of timeseries prefixPath.path.
 
-Only time filter is supported in \<WhereClause\>. Any other filters given in the \<WhereClause\> will give an exception. When the cached most recent data point does not satisfy the criterion specified by the filter, IoTDB will have to get the result from the external storage, which may cause a decrease in performance.
+- Only time filter is supported in \<WhereClause\>. Any other filters given in the \<WhereClause\> will give an exception. When the cached most recent data point does not satisfy the criterion specified by the filter, IoTDB will have to get the result from the external storage, which may cause a decrease in performance.
 
-The result will be returned in a four column table format.
+- The result will be returned in a four column table format.
 
-```
-| Time | timeseries | value | dataType |
-```
+    ```
+    | Time | timeseries | value | dataType |
+    ```
+    
+    **Note:** The `value` colum will always return the value as `string` and thus also has `TSDataType.TEXT`. Therefore, the column `dataType` is returned also which contains the _real_ type how the value should be interpreted.
 
-**Note:** The `value` colum will always return the value as `string` and thus also has `TSDataType.TEXT`. Therefore, the column `dataType` is returned also which contains the _real_ type how the value should be interpreted.
+- We can use `ORDER BY TIMESERIES (DESC | ASC)` to specify that the result set is sorted in descending/ascending order by timeseries name.
 
 **Example 1:** get the last point of root.ln.wf01.wt01.status:
 
@@ -70,8 +72,6 @@ Total line number = 2
 It costs 0.002s
 ```
 
-## Order By timeseries
-
 **Example 3:** get the last points of all sensor in root.ln.wf01.wt01, and order the result by the timeseries column desc
 
 ```
diff --git a/docs/UserGuide/Query-Data/Overview.md b/docs/UserGuide/Query-Data/Overview.md
index 28b8ad2002..ab751b8ec2 100644
--- a/docs/UserGuide/Query-Data/Overview.md
+++ b/docs/UserGuide/Query-Data/Overview.md
@@ -26,25 +26,25 @@
 In IoTDB, `SELECT` statement is used to retrieve data from one or more selected time series. Here is the syntax definition of `SELECT` statement:
 
 ```sql
-[TRACING] SELECT
-    [LAST] [TOP k] resultColumn [, resultColumn] ...
+SELECT [LAST] resultColumn [, resultColumn] ...
+    [INTO intoItem [, intoItem] ...]
     FROM prefixPath [, prefixPath] ...
-    WHERE whereCondition
+    [WHERE whereCondition]
     [GROUP BY ([startTime, endTime), interval, slidingStep)]
     [GROUP BY LEVEL = levelNum [, levelNum] ...]
-    [FILL ({PREVIOUS, beforeRange | LINEAR, beforeRange, afterRange | constant})]
+    [FILL ({PREVIOUS | LINEAR | constant})]
+    [HAVING havingCondition]
+    [ORDER BY TIME {ASC | DESC}]
     [LIMIT rowLimit] [OFFSET rowOffset]
     [SLIMIT seriesLimit] [SOFFSET seriesOffset]
-    [WITHOUT NULL {ANY | ALL} [resultColumn [, resultColumn] ...]]
-    [ORDER BY TIME {ASC | DESC}]
-    [{ALIGN BY DEVICE | DISABLE ALIGN}]
+    [ALIGN BY DEVICE]
 ```
 
 The most commonly used clauses of `SELECT` statements are these:
 
 - Each `resultColumn` indicates a column that you want to retrieve, which may be a suffix of time series paths, an aggregate function and so on. There must be at least one `resultColumn`.  For more details for `resultColumn`, please refer to [Select Expression](./Select-Expression.md) .
 - `fromClause` contains the prefix of one or more time-series paths to query.
-- `whereCondition` (Optional) specify the filter criterion named ` queryfilter`. `queryfilter` is a logical expression that returns the data points which calculation result is TRUE. If you do not specify `whereCondition`, return all data points in the time series. For more details, please refer to [Query Filter](./Query-Filter.md).
+- `whereCondition` is a logical expression that returns the data points which calculation result is TRUE. If you do not specify `whereCondition`, return all data points in the time series. For more details, please refer to [Query Filter](./Query-Filter.md).
 - The query results are sorted in ascending order by timestamp. You can specify the results to be sorted in descending order by timestamp through `ORDER BY TIME DESC` clause.
 - When there is a large amount of query result data, you can use `LIMIT/SLIMIT` and `OFFSET/SOFFSET` to paginate the result set, see [Query Result Pagination](./Pagination.md) for details.
 - The query result set is aligned according to the timestamp by default, that is, the time series is used as the column, and the timestamp of each row of data is the same. For other result set alignments, see [Query Result Alignment](./Result-Format.md).
diff --git a/docs/UserGuide/Query-Data/Pagination.md b/docs/UserGuide/Query-Data/Pagination.md
index 3992f1f8a7..c993888464 100644
--- a/docs/UserGuide/Query-Data/Pagination.md
+++ b/docs/UserGuide/Query-Data/Pagination.md
@@ -142,18 +142,6 @@ Total line number = 4
 It costs 0.016s
 ```
 
-It is worth noting that because the current FILL clause can only fill in the missing value of timeseries at a certain time point, that is to say, the execution result of FILL clause is exactly one line, so LIMIT and OFFSET are not expected to be used in combination with FILL clause, otherwise errors will be prompted. For example, executing the following SQL statement:
-
-```sql
-select temperature from root.sgcc.wf03.wt01 where time = 2017-11-01T16:37:50.000 fill(previous, 1m) limit 10
-```
-
-The SQL statement will not be executed and the corresponding error prompt is given as follows:
-
-```
-Msg: 401: line 1:107 mismatched input 'limit' expecting {<EOF>, ';'}
-```
-
 ## Column Control over Query Results
 
 By using SLIMIT and SOFFSET clauses, users can control the query results in a column-related manner. We will demonstrate how to use SLIMIT and SOFFSET clauses through the following examples.
@@ -240,29 +228,6 @@ Total line number = 7
 It costs 0.000s
 ```
 
-* Example 4: SLIMIT clause combined with FILL clause
-
-The SQL statement is:
-
-```sql
-select * from root.sgcc.wf03.wt01 where time = 2017-11-01T16:35:00 fill(previous, 1m) slimit 1 soffset 1
-```
-which means:
-
-The selected device is ln group wf01 plant wt01 device; the selected timeseries is the second column under this device, i.e., the temperature.
-
-The result is shown below:
-
-```
-+-----------------------------+--------------------------+
-|                         Time|root.sgcc.wf03.wt01.status|
-+-----------------------------+--------------------------+
-|2017-11-01T16:35:00.000+08:00|                      true|
-+-----------------------------+--------------------------+
-Total line number = 1
-It costs 0.007s
-```
-
 ## Row and Column Control over Query Results
 
 In addition to row or column control over query results, IoTDB allows users to control both rows and columns of query results. Here is a complete example with both LIMIT clauses and SLIMIT clauses.
@@ -331,7 +296,7 @@ select status,temperature from root.ln.wf01.wt01 where time > 2017-11-01T00:05:0
 The SQL statement will not be executed and the corresponding error prompt is given as follows:
 
 ```
-Msg: 303: check metadata error: Out of range. LIMIT <N>: N should be Int32.
+Msg: 416: Out of range. LIMIT <N>: N should be Int32.
 ```
 
 If the parameter N/SN of LIMIT/SLIMIT clause is not a positive intege, the system prompts errors. For example, executing the following SQL statement:
diff --git a/docs/UserGuide/Query-Data/Query-Filter.md b/docs/UserGuide/Query-Data/Query-Filter.md
index 91ef5722bf..9811148c16 100644
--- a/docs/UserGuide/Query-Data/Query-Filter.md
+++ b/docs/UserGuide/Query-Data/Query-Filter.md
@@ -95,16 +95,13 @@ An example is as follows:
     select code from root.sg1.d1 where code not in ('200', '300', '400', '500');
     ````
 
-## Null Filter
-Use null filters to filter data whose data value is null or not.
-
-1. Select data with values is null:
+6. Select data with values is null:
 
     ```sql
     select code from root.sg1.d1 where temperature is null;
     ````
 
-2. Select data with values is not null:
+7. Select data with values is not null:
 
     ```sql
     select code from root.sg1.d1 where temperature is not null;
diff --git a/docs/UserGuide/Query-Data/Result-Format.md b/docs/UserGuide/Query-Data/Result-Format.md
index 31645d9292..6373594aca 100644
--- a/docs/UserGuide/Query-Data/Result-Format.md
+++ b/docs/UserGuide/Query-Data/Result-Format.md
@@ -21,11 +21,11 @@
 
 # Query Result Alignment
 
-In addition, IoTDB supports two other results set format: 'align by device' and 'disable align'.
+In addition, IoTDB supports another result set format: `ALIGN BY DEVICE`.
 
 ## align by device
 
-The 'align by device' indicates that the deviceId is considered as a column. Therefore, there are totally limited columns in the dataset. 
+The `ALIGN BY DEVICE` indicates that the deviceId is considered as a column. Therefore, there are totally limited columns in the dataset. 
 
 > NOTE:
 > 
@@ -36,7 +36,7 @@ The 'align by device' indicates that the deviceId is considered as a column. The
 The SQL statement is:
 
 ```sql
-select * from root.ln.** where time <= 2017-11-01T00:01:00 align by device
+select * from root.ln.** where time <= 2017-11-01T00:01:00 align by device;
 ```
 
 The result shows below:
@@ -54,29 +54,4 @@ The result shows below:
 +-----------------------------+-----------------+-----------+------+--------+
 Total line number = 6
 It costs 0.012s
-```
-
-### disable align
-
-The 'disable align' indicates that there are 2 columns for each time series in the result set. Disable Align Clause can only be used at the end of a query statement. Disable Align Clause cannot be used with Aggregation, Fill Statements, Group By or Group By Device Statements, but can with Limit Statements. The display principle of the result table is that only when the column (or row) has existing data will the column (or row) be shown, with nonexistent cells being empty.
-
-The SQL statement is:
-
-```sql
-select * from root.ln.** where time <= 2017-11-01T00:01:00 disable align
-```
-
-The result shows below:
-
-```
-+-----------------------------+--------------------------+-----------------------------+------------------------+-----------------------------+-----------------------------+-----------------------------+------------------------+
-|                         Time|root.ln.wf02.wt02.hardware|                         Time|root.ln.wf02.wt02.status|                         Time|root.ln.wf01.wt01.temperature|                         Time|root.ln.wf01.wt01.status|
-+-----------------------------+--------------------------+-----------------------------+------------------------+-----------------------------+-----------------------------+-----------------------------+------------------------+
-|1970-01-01T08:00:00.001+08:00|                        v1|1970-01-01T08:00:00.001+08:00|                    true|2017-11-01T00:00:00.000+08:00|                        25.96|2017-11-01T00:00:00.000+08:00|                    true|
-|1970-01-01T08:00:00.002+08:00|                        v2|1970-01-01T08:00:00.002+08:00|                   false|2017-11-01T00:01:00.000+08:00|                        24.36|2017-11-01T00:01:00.000+08:00|                    true|
-|2017-11-01T00:00:00.000+08:00|                        v2|2017-11-01T00:00:00.000+08:00|                    true|                         null|                         null|                         null|                    null|
-|2017-11-01T00:01:00.000+08:00|                        v2|2017-11-01T00:01:00.000+08:00|                    true|                         null|                         null|                         null|                    null|
-+-----------------------------+--------------------------+-----------------------------+------------------------+-----------------------------+-----------------------------+-----------------------------+------------------------+
-Total line number = 4
-It costs 0.018s
 ```
\ No newline at end of file
diff --git a/docs/UserGuide/Query-Data/Select-Expression.md b/docs/UserGuide/Query-Data/Select-Expression.md
index 0a02f59624..2f32013928 100644
--- a/docs/UserGuide/Query-Data/Select-Expression.md
+++ b/docs/UserGuide/Query-Data/Select-Expression.md
@@ -63,9 +63,6 @@ From this syntax definition, `selectExpr` can contain:
 
 ## Arithmetic Query
 
-
-> Please note that there is no difference between Aligned Timeseries and NonAligned Timeseries in the current version, both support Arithmetic Expression. 
-
 ### Operators
 
 #### Unary Arithmetic Operators
@@ -230,8 +227,6 @@ All time series generating functions can accept * as input.
 
 IoTDB supports hybrid queries of time series generating function queries and raw data queries.
 
-> Please note that Aligned Timeseries has not been supported in queries with hybrid functions yet. An error message is expected if you use hybrid functions with Aligned Timeseries selected in a query statement.
-
 ### Mathematical Functions
 
 Currently, IoTDB supports the following mathematical functions. The behavior of these mathematical functions is consistent with the behavior of these functions in the Java Math standard library.
@@ -1300,20 +1295,6 @@ It costs 0.012s
 - Only when the left operand and the right operand under a certain timestamp are not `null`, the nested expressions will have an output value. Otherwise this row will not be included in the result. But for nested expressions with `GROUP BY` clause, it is better to show the result of all time intervals. Please refer to Input3 and corresponding Result3 in Example.
 - If one operand in the nested expressions can be translated into multiple time series (For example, `*`), the result of each time series will be included in the result (Cartesian product). Please refer to Input2 and corresponding Result2 in Example.
 
-##### Note
-
-> Automated fill (`FILL`) and grouped by level (`GROUP BY LEVEL`) are not supported in an aggregation query with expression nested. They may be supported in future versions.
->
-> The aggregation expression must be the lowest level input of one expression tree. Any kind expressions except timeseries are not valid as aggregation function parameters。
->
-> In a word, the following queries are not valid.
->
-> ```sql
-> SELECT avg(s1+1) FROM root.sg.d1; -- The aggregation function has expression parameters.
-> SELECT avg(s1) + avg(s2) FROM root.sg.* GROUP BY LEVEL=1; -- Grouped by level
-> SELECT avg(s1) + avg(s2) FROM root.sg.d1 GROUP BY([0, 10000), 1s) FILL(previous); -- Automated fill
-> ```
-
 ## Use Alias
 
 Since the unique data model of IoTDB, lots of additional information like device will be carried before each sensor. Sometimes, we want to query just one specific device, then these prefix information show frequently will be redundant in this situation, influencing the analysis of result set. At this time, we can use `AS` function provided by IoTDB, assign an alias to time series selected in query.  
diff --git a/docs/UserGuide/Query-Data/Tracing-Tool.md b/docs/UserGuide/Query-Data/Tracing-Tool.md
deleted file mode 100644
index a6529413a6..0000000000
--- a/docs/UserGuide/Query-Data/Tracing-Tool.md
+++ /dev/null
@@ -1,48 +0,0 @@
-<!--
-
-    Licensed to the Apache Software Foundation (ASF) under one
-    or more contributor license agreements.  See the NOTICE file
-    distributed with this work for additional information
-    regarding copyright ownership.  The ASF licenses this file
-    to you under the Apache License, Version 2.0 (the
-    "License"); you may not use this file except in compliance
-    with the License.  You may obtain a copy of the License at
-    
-        http://www.apache.org/licenses/LICENSE-2.0
-    
-    Unless required by applicable law or agreed to in writing,
-    software distributed under the License is distributed on an
-    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-    KIND, either express or implied.  See the License for the
-    specific language governing permissions and limitations
-    under the License.
-
--->
-
-# Performance Tracing Tool
-
-IoTDB supports the use of the `TRACING` clause to enable performance tracing of executed query statements. Users can use the performance tracing tool to analyze potential performance problems in some statements.
-
-The current performance analysis includes the following contents:
-1. The elapsed time of each stage of the execution process.
-2. Statistics related to performance analysis, it includes the number of time series queried, the number of Tsfile files accessed, the total number of chunks to be scanned, and the average number of data points contained in the chunk, the total number of pages read, and the number of overlapped pages.
-
-For example, execute `tracing select * from root`, will display the following contents:
-
-```
-Tracing Activties:
-+------------------------------------------------------+------------+
-|                                              Activity|Elapsed Time|
-+------------------------------------------------------+------------+
-|Start to execute statement: tracing select * from root|           0|
-|                            Parse SQL to physical plan|           4|
-|                              Create and cache dataset|          16|
-|                              * Num of series paths: 3|            |
-|                       * Num of sequence files read: 2|            |
-|                     * Num of unsequence files read: 1|            |
-|        * Num of sequence chunks: 6, avg points: 100.0|            |
-|      * Num of unsequence chunks: 3, avg points: 100.0|            |
-|         * Num of Pages: 9, overlapped pages: 0 (0.0%)|            |
-|                                      Request complete|          20|
-+------------------------------------------------------+------------+
-```
\ No newline at end of file
diff --git a/docs/UserGuide/Query-Data/Without-Null.md b/docs/UserGuide/Query-Data/Without-Null.md
deleted file mode 100644
index 6d5c3c2d0b..0000000000
--- a/docs/UserGuide/Query-Data/Without-Null.md
+++ /dev/null
@@ -1,172 +0,0 @@
-<!--
-
-    Licensed to the Apache Software Foundation (ASF) under one
-    or more contributor license agreements.  See the NOTICE file
-    distributed with this work for additional information
-    regarding copyright ownership.  The ASF licenses this file
-    to you under the Apache License, Version 2.0 (the
-    "License"); you may not use this file except in compliance
-    with the License.  You may obtain a copy of the License at
-    
-        http://www.apache.org/licenses/LICENSE-2.0
-    
-    Unless required by applicable law or agreed to in writing,
-    software distributed under the License is distributed on an
-    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-    KIND, either express or implied.  See the License for the
-    specific language governing permissions and limitations
-    under the License.
-
--->
-
-# Null Value Filter
-
-In practical application, users may want to filter some rows with null values in the query result set. In IoTDB, the `WITHOUT NULL` clause can be used to filter null values in the result set. There are two filtering strategies: `WITHOUT NULL ANY`和`WITHOUT NULL ALL`. In addition, the `WITHOUT NULL` clause supports specifying the corresponding columns for filtering.
-
-> WITHOUT NULL ANY: if one of the columns in the specified column set is null, the conditions are met for filtering.
-> 
-> WITHOUT NULL ALL: if all columns in the specified column set are null, the conditions are met for filtering.
-
-## Don't specify columns
-
-> By default, it is effective for all columns in the result set. That is the specified column set includes all columns in the result set.
-
-1. In the following query, if any column of one row in the result set is null, the row will be filtered out. That is the result set obtained does not contain any null values.
-
-```sql
-select * from root.ln.** where time <= 2017-11-01T00:01:00 WITHOUT NULL ANY
-```
-
-2. In the following query, if all columns of one row in the result set are null, the row will be filtered out.
-
-```sql
-select * from root.ln.** where group by ([1,10), 2ms) WITHOUT NULL ALL
-```
-
-## Specify columns
-
-> take effect only for the specified column set
-
-Use the `WITHOUT NULL` clause to filter the null value of the specified column in the result set. The following are some examples and descriptions:
-
-> Note that if the specified column does not exist in the current metadata, it will be filtered directly, which is consistent with the output result of the current query.
-> If the specified column exists but does not match the column name output from the result set, an error will be reported: `The without null columns don't match the columns queried.If has alias, please use the alias.`
-
-For examples:
-
-1. In `without null` specified column set, `root.test.sg1.s1` column exists in the current metadata,`root.test.sg1.usag` column does not exist in the current metadata. The function of the `without null` clause in the following query is equivalent to without null all(s1).
-
-```sql
-select * from root.test.sg1 without null all (s1, usag)
-```
-
-2. In `without null` specified column set, `root.test.sg1.s2` column exists in the current metadata, but doesn't exist in the result set of the query. So it will report an error: `The without null columns don't match the columns queried.If has alias, please use the alias.`
-
-```sql
-select s1 + s2, s1 - s2, s1 * s2, s1 / s2, s1 % s2 from root.test.sg1 without null all (s1+s2, s2)
-```
-
-### Raw data query
-
-1. If the column `root.ln.sg1.s1` of one row in the result set of the query is null, the row will be filtered out.
-
-```sql
-select * from root.ln.sg1 WITHOUT NULL ANY(s1)
-```
-
-2. If at least one column in `root.ln.sg1.s1` and `root.ln.sg1.s2` of one row is null in the result set of the query, the row will be filtered out.
-
-```sql
-select * from root.ln.sg1 WITHOUT NULL ANY(s1, s2)
-```
-
-3. If both `root.ln.sg1.s1` and `root.ln.sg1.s2` columns of one row are null in the result set of the query, the row will be filtered out.
-
-```sql
-select * from root.ln.sg1 WITHOUT NULL ALL(s1, s2)
-```
-
-### With expression query
-
-specified columns can be expression
-
-1. If both `s2+s4` and `s2` columns of one row are null in the result set of the query, the row will be filtered out.
-
-```sql
-select s2, - s2, s4, + s4, s2 + s4, s2 - s4, s2 * s4, s2 / s4, s2 % s4 from root.test.sg1 without null all (s2+s4, s2)
-```
-
-2. If at least one column in `s2+s4` and `s2` of one row is null in the result set of the query, the row will be filtered out.
-
-```sql
-select s2, - s2, s4, + s4, s2 + s4, s2 - s4, s2 * s4, s2 / s4, s2 % s4 from root.test.sg1 without null any (s2+s4, s2)
-```
-
-
-### With function query
-
-```sql
-select s1, sin(s2) + cos(s2), cos(sin(s2 + s4) + s2) from root.test.sg1 without null all (sin(s2) + cos(s2), cos(sin(s2 + s4) + s2))
-```
-
-### Align by device query
-
-```sql
-select last_value(*) from root.test.sg1 group by([1,10), 2ms) without null all(last_value(s2), last_value(s3)) align by device
-```
-
-Examples of results are as follows:
-
-```
-IoTDB> select last_value(*) from root.sg1.* group by([1,10), 2ms) without null all(last_value(s2), last_value(s3)) align by device
-+-----------------------------+-----------+--------------+--------------+--------------+
-|                         Time|     Device|last_value(s1)|last_value(s2)|last_value(s3)|
-+-----------------------------+-----------+--------------+--------------+--------------+
-|1970-01-01T08:00:00.001+08:00|root.sg1.d1|           1.0|           2.0|          null|
-|1970-01-01T08:00:00.003+08:00|root.sg1.d1|           3.0|           4.0|          null|
-|1970-01-01T08:00:00.001+08:00|root.sg1.d2|           1.0|           1.0|           1.0|
-+-----------------------------+-----------+--------------+--------------+--------------+
-Total line number = 3
-It costs 0.007s
-```
-
-The specified column name corresponds to the column name of the output result. At present, the `without null` clause doesn't support specifying a column of a device. If you do, an error will be reported: `The without null columns don't match the columns queried.If has alias, please use the alias.` For example, in the following query example, it is not supported to filter the row with column `last_value(root.sg1.d1.s3)` that is null.
-
-```sql
-select last_value(*) from root.test.sg1 group by([1,10), 2ms) without null all(last_value(`root.sg1.d1.s3`)) align by device
-```
-
-### Aggregation query
-
-```sql
-select avg(s4), sum(s2) from root.test.sg1 group by ([1,10), 2ms) without null all(sum(s2))
-```
-
-```sql
-select avg(s4), sum(s2), count(s3) from root.test.sg1 group by ([1,10), 2ms) without null all(avg(s4), sum(s2))
-```
-
-### Specify full path columns
-
-Assuming that the output results of the following query are listed as `root.test.sg1.s2`, `root.test.sg1.s3`, `root.test.sg2.s2` and `root.test.sg2.s3`, you can specify the corresponding columns with full pathname for filtering, such as the following example:
-
-1. If both `root.test.sg1.s2` and `root.test.sg2.s3` columns of one row are null in the result set of the query, the row will be filtered out.
-
-```sql
-select s2, s3 from root.test.** without null all(root.test.sg1.s2, root.test.sg2.s3)
-```
-
-2. If `root.test.sg1.s2`, `root.test.sg1.s3` and `root.test.sg2.s3` columns of one row are null in the result set of the query, the row will be filtered out.
-
-```sql
-select s2, s3 from root.test.** without null all(root.test.sg1.s2, s3)
-```
-
-### Aligned Timeseries Query
-
-1. You can specify the `without null` column name as the aligned timeseries column name.
-
-```sql
-CREATE ALIGNED TIMESERIES root.test.sg3(s5 INT32, s6 BOOLEAN, s7 DOUBLE, s8 INT32)
-select sg1.s1, sg1.s2, sg2.s3, sg3.* from root.test without null all (sg3.s5, sg3.s6, sg2.s3)
-```
\ No newline at end of file
diff --git a/docs/UserGuide/Reference/Syntax-Conventions.md b/docs/UserGuide/Reference/Syntax-Conventions.md
index d57e10939a..bc370b9c64 100644
--- a/docs/UserGuide/Reference/Syntax-Conventions.md
+++ b/docs/UserGuide/Reference/Syntax-Conventions.md
@@ -26,11 +26,7 @@ This section describes how to write literal values in IoTDB. These include strin
 
 ### String Literals
 
-> We refer to MySQL's definition of string:A string is a sequence of bytes or characters, enclosed within either single quote (`'`) or double quote (`"`) characters.
-
-Definition of string in MySQL could be found here:[MySQL :: MySQL 8.0 Reference Manual :: 9.1.1 String Literals](https://dev.mysql.com/doc/refman/8.0/en/string-literals.html)
-
-So in IoTDB, **A string is a sequence of bytes or characters, enclosed within either single quote (`'`) or double quote (`"`) characters.** Examples:
+in IoTDB, **A string is a sequence of bytes or characters, enclosed within either single quote (`'`) or double quote (`"`) characters.** Examples:
 
 ```js
 'a string'
diff --git a/docs/zh/UserGuide/Monitor-Alert/Alerting.md b/docs/zh/UserGuide/Monitor-Alert/Alerting.md
index b75faeb9b1..7ac10eb7e2 100644
--- a/docs/zh/UserGuide/Monitor-Alert/Alerting.md
+++ b/docs/zh/UserGuide/Monitor-Alert/Alerting.md
@@ -39,7 +39,7 @@ IoTDB 告警功能预计支持两种模式:
     * 适合需要将原始数据降采样并持久化的场景。
     * 由于定时查询几乎不影响原始时间序列的写入,适合对原始数据写入性能敏感的场景。
 
-随着 [Trigger](../Process-Data/Triggers.md) 模块的引入,可以实现写入触发模式的告警。
+随着 [Trigger](../Trigger/Triggers.md) 模块的引入,可以实现写入触发模式的告警。
 
 ## 部署 AlertManager 
 
diff --git a/docs/zh/UserGuide/Operators-Functions/Aggregation.md b/docs/zh/UserGuide/Operators-Functions/Aggregation.md
new file mode 100644
index 0000000000..1cca558015
--- /dev/null
+++ b/docs/zh/UserGuide/Operators-Functions/Aggregation.md
@@ -0,0 +1,41 @@
+<!--
+
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+    
+        http://www.apache.org/licenses/LICENSE-2.0
+    
+    Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.
+
+-->
+
+# 聚合函数
+
+聚合函数是多对一函数。它们对一组值进行聚合计算,得到单个聚合结果。
+
+除了 `COUNT()` 之外,其他所有聚合函数都忽略空值,并在没有输入行或所有值为空时返回空值。 例如,`SUM()` 返回 null 而不是零,而 `AVG()` 在计数中不包括 null 值。
+
+IoTDB 支持的聚合函数如下:
+
+| 函数名      | 功能描述                                                     | 允许的输入类型           | 输出类型       |
+| ----------- | ------------------------------------------------------------ | ------------------------ | -------------- |
+| SUM         | 求和。                                                       | INT32 INT64 FLOAT DOUBLE | DOUBLE         |
+| COUNT       | 计算数据点数。                                               | 所有类型                 | INT            |
+| AVG         | 求平均值。                                                   | INT32 INT64 FLOAT DOUBLE | DOUBLE         |
+| EXTREME     | 求具有最大绝对值的值。如果正值和负值的最大绝对值相等,则返回正值。 | INT32 INT64 FLOAT DOUBLE | 与输入类型一致 |
+| MAX_VALUE   | 求最大值。                                                   | INT32 INT64 FLOAT DOUBLE | 与输入类型一致 |
+| MIN_VALUE   | 求最小值。                                                   | INT32 INT64 FLOAT DOUBLE | 与输入类型一致 |
+| FIRST_VALUE | 求时间戳最小的值。                                           | 所有类型                 | 与输入类型一致 |
+| LAST_VALUE  | 求时间戳最大的值。                                           | 所有类型                 | 与输入类型一致 |
+| MAX_TIME    | 求最大时间戳。                                               | 所有类型                 | Timestamp      |
+| MIN_TIME    | 求最小时间戳。                                               | 所有类型                 | Timestamp      |
\ No newline at end of file
diff --git a/docs/zh/UserGuide/UDF-Library/Anomaly-Detection.md b/docs/zh/UserGuide/Operators-Functions/Anomaly-Detection.md
similarity index 95%
rename from docs/zh/UserGuide/UDF-Library/Anomaly-Detection.md
rename to docs/zh/UserGuide/Operators-Functions/Anomaly-Detection.md
index 2b120fb1fb..ff56f06098 100644
--- a/docs/zh/UserGuide/UDF-Library/Anomaly-Detection.md
+++ b/docs/zh/UserGuide/Operators-Functions/Anomaly-Detection.md
@@ -1,21 +1,21 @@
 <!--
 
-​    Licensed to the Apache Software Foundation (ASF) under one
-​    or more contributor license agreements.  See the NOTICE file
-​    distributed with this work for additional information
-​    regarding copyright ownership.  The ASF licenses this file
-​    to you under the Apache License, Version 2.0 (the
-​    "License"); you may not use this file except in compliance
-​    with the License.  You may obtain a copy of the License at
-​    
-​        http://www.apache.org/licenses/LICENSE-2.0
-​    
-​    Unless required by applicable law or agreed to in writing,
-​    software distributed under the License is distributed on an
-​    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-​    KIND, either express or implied.  See the License for the
-​    specific language governing permissions and limitations
-​    under the License.
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+    
+        http://www.apache.org/licenses/LICENSE-2.0
+    
+    Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.
 
 -->
 
diff --git a/docs/zh/UserGuide/Operators-Functions/Comparison.md b/docs/zh/UserGuide/Operators-Functions/Comparison.md
new file mode 100644
index 0000000000..71ac9309f8
--- /dev/null
+++ b/docs/zh/UserGuide/Operators-Functions/Comparison.md
@@ -0,0 +1,309 @@
+<!--
+
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+    
+        http://www.apache.org/licenses/LICENSE-2.0
+    
+    Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.
+
+-->
+
+# 比较运算符和函数
+
+## 基本比较运算符
+
+- 输入数据类型: `INT32`, `INT64`, `FLOAT`, `DOUBLE`。
+- 注意:会将所有数据转换为`DOUBLE`类型后进行比较。`==`和`!=`可以直接比较两个`BOOLEAN`。
+- 返回类型:`BOOLEAN`。
+
+|运算符                       |含义|
+|----------------------------|-----------|
+|`>`                         |大于|
+|`>=`                        |大于等于|
+|`<`                         |小于|
+|`<=`                        |小于等于|
+|`==`                        |等于|
+|`!=` / `<>`                 |不等于|
+
+**示例:**
+
+```sql
+select a, b, a > 10, a <= b, !(a <= b), a > 10 && a > b from root.test;
+```
+
+运行结果
+```
+IoTDB> select a, b, a > 10, a <= b, !(a <= b), a > 10 && a > b from root.test;
++-----------------------------+-----------+-----------+----------------+--------------------------+---------------------------+------------------------------------------------+
+|                         Time|root.test.a|root.test.b|root.test.a > 10|root.test.a <= root.test.b|!root.test.a <= root.test.b|(root.test.a > 10) & (root.test.a > root.test.b)|
++-----------------------------+-----------+-----------+----------------+--------------------------+---------------------------+------------------------------------------------+
+|1970-01-01T08:00:00.001+08:00|         23|       10.0|            true|                     false|                       true|                                            true|
+|1970-01-01T08:00:00.002+08:00|         33|       21.0|            true|                     false|                       true|                                            true|
+|1970-01-01T08:00:00.004+08:00|         13|       15.0|            true|                      true|                      false|                                           false|
+|1970-01-01T08:00:00.005+08:00|         26|        0.0|            true|                     false|                       true|                                            true|
+|1970-01-01T08:00:00.008+08:00|          1|       22.0|           false|                      true|                      false|                                           false|
+|1970-01-01T08:00:00.010+08:00|         23|       12.0|            true|                     false|                       true|                                            true|
++-----------------------------+-----------+-----------+----------------+--------------------------+---------------------------+------------------------------------------------+
+```
+
+## `BETWEEN ... AND ...` 运算符
+
+|运算符                       |含义|
+|----------------------------|-----------|
+|`BETWEEN ... AND ...`       |在指定范围内|
+|`NOT BETWEEN ... AND ...`   |不在指定范围内|
+
+**示例:** 选择区间 [36.5,40] 内或之外的数据:
+
+```sql
+select temperature from root.sg1.d1 where temperature between 36.5 and 40;
+```
+
+```sql
+select temperature from root.sg1.d1 where temperature not between 36.5 and 40;
+```
+
+## 模糊匹配运算符
+
+对于 TEXT 类型的数据,支持使用 `Like` 和 `Regexp` 运算符对数据进行模糊匹配
+
+|运算符                       |含义|
+|----------------------------|-----------|
+|`LIKE`                      |匹配简单模式|
+|`NOT LIKE`                  |无法匹配简单模式|
+|`REGEXP`                    |匹配正则表达式|
+|`NOT REGEXP`                |无法匹配正则表达式|
+
+输入数据类型:`TEXT`
+
+返回类型:`BOOLEAN`
+
+### 使用 `Like` 进行模糊匹配
+
+**匹配规则:**
+
+- `%` 表示任意0个或多个字符。
+- `_` 表示任意单个字符。
+
+**示例 1:** 查询 `root.sg.d1` 下 `value` 含有`'cc'`的数据。
+
+```shell
+IoTDB> select * from root.sg.d1 where value like '%cc%'
++-----------------------------+----------------+
+|                         Time|root.sg.d1.value|
++-----------------------------+----------------+
+|2017-11-01T00:00:00.000+08:00|        aabbccdd| 
+|2017-11-01T00:00:01.000+08:00|              cc|
++-----------------------------+----------------+
+Total line number = 2
+It costs 0.002s
+```
+
+**示例 2:** 查询 `root.sg.d1` 下 `value` 中间为 `'b'`、前后为任意单个字符的数据。
+
+```shell
+IoTDB> select * from root.sg.device where value like '_b_'
++-----------------------------+----------------+
+|                         Time|root.sg.d1.value|
++-----------------------------+----------------+
+|2017-11-01T00:00:02.000+08:00|             abc| 
++-----------------------------+----------------+
+Total line number = 1
+It costs 0.002s
+```
+
+### 使用 `Regexp` 进行模糊匹配
+
+需要传入的过滤条件为 **Java 标准库风格的正则表达式**。
+
+**常见的正则匹配举例:**
+
+```
+长度为3-20的所有字符:^.{3,20}$
+大写英文字符:^[A-Z]+$
+数字和英文字符:^[A-Za-z0-9]+$
+以a开头的:^a.*
+```
+
+**示例 1:** 查询 root.sg.d1 下 value 值为26个英文字符组成的字符串。
+
+```shell
+IoTDB> select * from root.sg.d1 where value regexp '^[A-Za-z]+$'
++-----------------------------+----------------+
+|                         Time|root.sg.d1.value|
++-----------------------------+----------------+
+|2017-11-01T00:00:00.000+08:00|        aabbccdd| 
+|2017-11-01T00:00:01.000+08:00|              cc|
++-----------------------------+----------------+
+Total line number = 2
+It costs 0.002s
+```
+
+**示例 2:** 查询 root.sg.d1 下 value 值为26个小写英文字符组成的字符串且时间大于100的。
+
+```shell
+IoTDB> select * from root.sg.d1 where value regexp '^[a-z]+$' and time > 100
++-----------------------------+----------------+
+|                         Time|root.sg.d1.value|
++-----------------------------+----------------+
+|2017-11-01T00:00:00.000+08:00|        aabbccdd| 
+|2017-11-01T00:00:01.000+08:00|              cc|
++-----------------------------+----------------+
+Total line number = 2
+It costs 0.002s
+```
+
+**示例 3:**
+
+```sql
+select b, b like '1%', b regexp '[0-2]' from root.test;
+```
+
+运行结果
+```
++-----------------------------+-----------+-------------------------+--------------------------+
+|                         Time|root.test.b|root.test.b LIKE '^1.*?$'|root.test.b REGEXP '[0-2]'|
++-----------------------------+-----------+-------------------------+--------------------------+
+|1970-01-01T08:00:00.001+08:00| 111test111|                     true|                      true|
+|1970-01-01T08:00:00.003+08:00| 333test333|                    false|                     false|
++-----------------------------+-----------+-------------------------+--------------------------+
+```
+
+## `IS NULL` 运算符
+
+|运算符                       |含义|
+|----------------------------|-----------|
+|`IS NULL`                   |是空值|
+|`IS NOT NULL`               |不是空值|
+
+**示例 1:** 选择值为空的数据:
+
+```sql
+select code from root.sg1.d1 where temperature is null;
+```
+
+**示例 2:** 选择值为非空的数据:
+
+```sql
+select code from root.sg1.d1 where temperature is not null;
+```
+
+## `IN` 运算符
+
+|运算符                       |含义|
+|----------------------------|-----------|
+|`IN` / `CONTAINS`           |是指定列表中的值|
+|`NOT IN` / `NOT CONTAINS`   |不是指定列表中的值|
+
+输入数据类型:`All Types`
+
+返回类型 `BOOLEAN`
+
+**注意:请确保集合中的值可以被转为输入数据的类型。**
+> 例如:
+>
+>`s1 in (1, 2, 3, 'test')`,`s1`的数据类型是`INT32`
+>
+> 我们将会抛出异常,因为`'test'`不能被转为`INT32`类型
+
+**示例 1:** 选择值在特定范围内的数据:
+
+```sql
+select code from root.sg1.d1 where code in ('200', '300', '400', '500');
+```
+
+**示例 2:** 选择值在特定范围外的数据:
+
+```sql
+select code from root.sg1.d1 where code not in ('200', '300', '400', '500');
+```
+
+**示例 3:**
+
+```sql
+select a, a in (1, 2) from root.test;
+```
+
+输出2:
+```
++-----------------------------+-----------+--------------------+
+|                         Time|root.test.a|root.test.a IN (1,2)|
++-----------------------------+-----------+--------------------+
+|1970-01-01T08:00:00.001+08:00|          1|                true|
+|1970-01-01T08:00:00.003+08:00|          3|               false|
++-----------------------------+-----------+--------------------+
+```
+
+## 条件函数 
+
+条件函数针对每个数据点进行条件判断,返回布尔值。
+
+| 函数名      | 可接收的输入序列类型                     | 必要的属性参数                               | 输出序列类型     | 功能类型                                             |
+|----------|--------------------------------|---------------------------------------|------------|--------------------------------------------------|
+| ON_OFF   | INT32 / INT64 / FLOAT / DOUBLE | `threshold`:DOUBLE类型                  | BOOLEAN 类型 | 返回`ts_value >= threshold`的bool值                  |
+| IN_RANGE | INT32 / INT64 / FLOAT / DOUBLE | `lower`:DOUBLE类型<br/>`upper`:DOUBLE类型 | BOOLEAN类型  | 返回`ts_value >= lower && ts_value <= upper`的bool值 |                                                    |
+
+测试数据:
+
+```
+IoTDB> select ts from root.test;
++-----------------------------+------------+
+|                         Time|root.test.ts|
++-----------------------------+------------+
+|1970-01-01T08:00:00.001+08:00|           1|
+|1970-01-01T08:00:00.002+08:00|           2|
+|1970-01-01T08:00:00.003+08:00|           3|
+|1970-01-01T08:00:00.004+08:00|           4|
++-----------------------------+------------+
+```
+
+**示例 1:**
+
+SQL语句:
+```sql
+select ts, on_off(ts, 'threshold'='2') from root.test;
+```
+
+输出:
+```
+IoTDB> select ts, on_off(ts, 'threshold'='2') from root.test;
++-----------------------------+------------+-------------------------------------+
+|                         Time|root.test.ts|on_off(root.test.ts, "threshold"="2")|
++-----------------------------+------------+-------------------------------------+
+|1970-01-01T08:00:00.001+08:00|           1|                                false|
+|1970-01-01T08:00:00.002+08:00|           2|                                 true|
+|1970-01-01T08:00:00.003+08:00|           3|                                 true|
+|1970-01-01T08:00:00.004+08:00|           4|                                 true|
++-----------------------------+------------+-------------------------------------+
+```
+
+**示例 2:**
+
+Sql语句:
+```sql
+select ts, in_range(ts, 'lower'='2', 'upper'='3.1') from root.test;
+```
+
+输出:
+```
+IoTDB> select ts, in_range(ts, 'lower'='2', 'upper'='3.1') from root.test;
++-----------------------------+------------+--------------------------------------------------+
+|                         Time|root.test.ts|in_range(root.test.ts, "lower"="2", "upper"="3.1")|
++-----------------------------+------------+--------------------------------------------------+
+|1970-01-01T08:00:00.001+08:00|           1|                                             false|
+|1970-01-01T08:00:00.002+08:00|           2|                                              true|
+|1970-01-01T08:00:00.003+08:00|           3|                                              true|
+|1970-01-01T08:00:00.004+08:00|           4|                                             false|
++-----------------------------+------------+--------------------------------------------------+
+```
\ No newline at end of file
diff --git a/docs/zh/UserGuide/Operators-Functions/Constant.md b/docs/zh/UserGuide/Operators-Functions/Constant.md
new file mode 100644
index 0000000000..6825bd32b2
--- /dev/null
+++ b/docs/zh/UserGuide/Operators-Functions/Constant.md
@@ -0,0 +1,57 @@
+<!--
+
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+    
+        http://www.apache.org/licenses/LICENSE-2.0
+    
+    Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.
+
+-->
+
+# 常序列生成函数
+
+常序列生成函数用于生成所有数据点的值都相同的时间序列。
+
+常序列生成函数接受一个或者多个时间序列输入,其输出的数据点的时间戳集合是这些输入序列时间戳集合的并集。
+
+目前 IoTDB 支持如下常序列生成函数:
+
+| 函数名 | 必要的属性参数                                               | 输出序列类型               | 功能描述                                                     |
+| ------ | ------------------------------------------------------------ | -------------------------- | ------------------------------------------------------------ |
+| CONST  | `value`: 输出的数据点的值 <br />`type`: 输出的数据点的类型,只能是 INT32 / INT64 / FLOAT / DOUBLE / BOOLEAN / TEXT | 由输入属性参数 `type` 决定 | 根据输入属性 `value` 和 `type` 输出用户指定的常序列。        |
+| PI     | 无                                                           | DOUBLE                     | 常序列的值:`π` 的 `double` 值,圆的周长与其直径的比值,即圆周率,等于 *Java标准库* 中的`Math.PI`。 |
+| E      | 无                                                           | DOUBLE                     | 常序列的值:`e` 的 `double` 值,自然对数的底,它等于 *Java 标准库*  中的 `Math.E`。 |
+
+例如:
+
+```   sql
+select s1, s2, const(s1, 'value'='1024', 'type'='INT64'), pi(s2), e(s1, s2) from root.sg1.d1; 
+```
+
+结果:
+
+```
+select s1, s2, const(s1, 'value'='1024', 'type'='INT64'), pi(s2), e(s1, s2) from root.sg1.d1; 
++-----------------------------+--------------+--------------+-----------------------------------------------------+------------------+---------------------------------+
+|                         Time|root.sg1.d1.s1|root.sg1.d1.s2|const(root.sg1.d1.s1, "value"="1024", "type"="INT64")|pi(root.sg1.d1.s2)|e(root.sg1.d1.s1, root.sg1.d1.s2)|
++-----------------------------+--------------+--------------+-----------------------------------------------------+------------------+---------------------------------+
+|1970-01-01T08:00:00.000+08:00|           0.0|           0.0|                                                 1024| 3.141592653589793|                2.718281828459045|
+|1970-01-01T08:00:00.001+08:00|           1.0|          null|                                                 1024|              null|                2.718281828459045|
+|1970-01-01T08:00:00.002+08:00|           2.0|          null|                                                 1024|              null|                2.718281828459045|
+|1970-01-01T08:00:00.003+08:00|          null|           3.0|                                                 null| 3.141592653589793|                2.718281828459045|
+|1970-01-01T08:00:00.004+08:00|          null|           4.0|                                                 null| 3.141592653589793|                2.718281828459045|
++-----------------------------+--------------+--------------+-----------------------------------------------------+------------------+---------------------------------+
+Total line number = 5
+It costs 0.005s
+```
diff --git a/docs/zh/UserGuide/Operators-Functions/Continuous-Interval.md b/docs/zh/UserGuide/Operators-Functions/Continuous-Interval.md
new file mode 100644
index 0000000000..29cd01b8c5
--- /dev/null
+++ b/docs/zh/UserGuide/Operators-Functions/Continuous-Interval.md
@@ -0,0 +1,75 @@
+<!--
+
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+    
+        http://www.apache.org/licenses/LICENSE-2.0
+    
+    Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.
+
+-->
+
+# 区间查询函数
+
+## 连续满足区间函数
+
+连续满足条件区间函数用来查询所有满足指定条件的连续区间。
+
+按返回值可分为两类:
+1. 返回满足条件连续区间的起始时间戳和时间跨度(时间跨度为0表示此处只有起始时间这一个数据点满足条件)
+2. 返回满足条件连续区间的起始时间戳和后面连续满足条件的点的个数(个数为1表示此处只有起始时间这一个数据点满足条件)
+
+| 函数名               | 输入序列类型                               | 属性参数                                           | 输出序列类型 | 功能描述                                                             |
+|-------------------|--------------------------------------|------------------------------------------------|-------|------------------------------------------------------------------|
+| ZERO_DURATION     | INT32/ INT64/ FLOAT/ DOUBLE/ BOOLEAN | `min`:可选,默认值0</br>`max`:可选,默认值`Long.MAX_VALUE` | Long  | 返回时间序列连续为0(false)的开始时间与持续时间,持续时间t(单位ms)满足`t >= min && t <= max`  |
+| NON_ZERO_DURATION | INT32/ INT64/ FLOAT/ DOUBLE/ BOOLEAN | `min`:可选,默认值0</br>`max`:可选,默认值`Long.MAX_VALUE` | Long  | 返回时间序列连续不为0(false)的开始时间与持续时间,持续时间t(单位ms)满足`t >= min && t <= max` |               |
+| ZERO_COUNT        | INT32/ INT64/ FLOAT/ DOUBLE/ BOOLEAN | `min`:可选,默认值1</br>`max`:可选,默认值`Long.MAX_VALUE` | Long  | 返回时间序列连续为0(false)的开始时间与其后数据点的个数,数据点个数n满足`n >= min && n <= max`   |               |
+| NON_ZERO_COUNT    | INT32/ INT64/ FLOAT/ DOUBLE/ BOOLEAN | `min`:可选,默认值1</br>`max`:可选,默认值`Long.MAX_VALUE` | Long  | 返回时间序列连续不为0(false)的开始时间与其后数据点的个数,数据点个数n满足`n >= min && n <= max`  |               |
+
+测试数据:
+```
+IoTDB> select s1,s2,s3,s4,s5 from root.sg.d2;
++-----------------------------+-------------+-------------+-------------+-------------+-------------+
+|                         Time|root.sg.d2.s1|root.sg.d2.s2|root.sg.d2.s3|root.sg.d2.s4|root.sg.d2.s5|
++-----------------------------+-------------+-------------+-------------+-------------+-------------+
+|1970-01-01T08:00:00.000+08:00|            0|            0|          0.0|          0.0|        false|
+|1970-01-01T08:00:00.001+08:00|            1|            1|          1.0|          1.0|         true|
+|1970-01-01T08:00:00.002+08:00|            1|            1|          1.0|          1.0|         true|
+|1970-01-01T08:00:00.003+08:00|            0|            0|          0.0|          0.0|        false|
+|1970-01-01T08:00:00.004+08:00|            1|            1|          1.0|          1.0|         true|
+|1970-01-01T08:00:00.005+08:00|            0|            0|          0.0|          0.0|        false|
+|1970-01-01T08:00:00.006+08:00|            0|            0|          0.0|          0.0|        false|
+|1970-01-01T08:00:00.007+08:00|            1|            1|          1.0|          1.0|         true|
++-----------------------------+-------------+-------------+-------------+-------------+-------------+
+```
+
+sql:
+```sql
+select s1, zero_count(s1), non_zero_count(s2), zero_duration(s3), non_zero_duration(s4) from root.sg.d2;
+```
+
+结果:
+```
++-----------------------------+-------------+-------------------------+-----------------------------+----------------------------+--------------------------------+
+|                         Time|root.sg.d2.s1|zero_count(root.sg.d2.s1)|non_zero_count(root.sg.d2.s2)|zero_duration(root.sg.d2.s3)|non_zero_duration(root.sg.d2.s4)|
++-----------------------------+-------------+-------------------------+-----------------------------+----------------------------+--------------------------------+
+|1970-01-01T08:00:00.000+08:00|            0|                        1|                         null|                           0|                            null|
+|1970-01-01T08:00:00.001+08:00|            1|                     null|                            2|                        null|                               1|
+|1970-01-01T08:00:00.002+08:00|            1|                     null|                         null|                        null|                            null|
+|1970-01-01T08:00:00.003+08:00|            0|                        1|                         null|                           0|                            null|
+|1970-01-01T08:00:00.004+08:00|            1|                     null|                            1|                        null|                               0|
+|1970-01-01T08:00:00.005+08:00|            0|                        2|                         null|                           1|                            null|
+|1970-01-01T08:00:00.006+08:00|            0|                     null|                         null|                        null|                            null|
+|1970-01-01T08:00:00.007+08:00|            1|                     null|                            1|                        null|                               0|
++-----------------------------+-------------+-------------------------+-----------------------------+----------------------------+--------------------------------+
+```
diff --git a/docs/zh/UserGuide/Operators-Functions/Conversion.md b/docs/zh/UserGuide/Operators-Functions/Conversion.md
new file mode 100644
index 0000000000..5efa14c0bd
--- /dev/null
+++ b/docs/zh/UserGuide/Operators-Functions/Conversion.md
@@ -0,0 +1,131 @@
+<!--
+
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+    
+        http://www.apache.org/licenses/LICENSE-2.0
+    
+    Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.
+
+-->
+
+# 数据类型转换
+
+## CAST
+
+### 函数简介
+
+当前IoTDB支持6种数据类型,其中包括INT32、INT64、FLOAT、DOUBLE、BOOLEAN以及TEXT。当我们对数据进行查询或者计算时可能需要进行数据类型的转换, 比如说将TEXT转换为INT32,或者提高数据精度,比如说将FLOAT转换为DOUBLE。所以,IoTDB支持使用cast函数对数据类型进行转换。
+
+| 函数名 | 必要的属性参数                                               | 输出序列类型             | 功能类型                           |
+| ------ | ------------------------------------------------------------ | ------------------------ | ---------------------------------- |
+| CAST   | `type`:输出的数据点的类型,只能是 INT32 / INT64 / FLOAT / DOUBLE / BOOLEAN / TEXT | 由输入属性参数`type`决定 | 将数据转换为`type`参数指定的类型。 |
+
+### 类型转换说明
+
+1.当INT32、INT64类型的值不为0时,FLOAT与DOUBLE类型的值不为0.0时,TEXT类型不为空字符串或者"false"时,转换为BOOLEAN类型时值为true,否则为false。
+
+```
+IoTDB> show timeseries root.sg.d1.*;
++-------------+-----+-------------+--------+--------+-----------+----+----------+
+|   timeseries|alias|     database|dataType|encoding|compression|tags|attributes|
++-------------+-----+-------------+--------+--------+-----------+----+----------+
+|root.sg.d1.s3| null|      root.sg|   FLOAT|     RLE|     SNAPPY|null|      null|
+|root.sg.d1.s4| null|      root.sg|  DOUBLE|     RLE|     SNAPPY|null|      null|
+|root.sg.d1.s5| null|      root.sg|    TEXT|   PLAIN|     SNAPPY|null|      null|
+|root.sg.d1.s6| null|      root.sg| BOOLEAN|     RLE|     SNAPPY|null|      null|
+|root.sg.d1.s1| null|      root.sg|   INT32|     RLE|     SNAPPY|null|      null|
+|root.sg.d1.s2| null|      root.sg|   INT64|     RLE|     SNAPPY|null|      null|
++-------------+-----+-------------+--------+--------+-----------+----+----------+
+Total line number = 6
+It costs 0.006s
+IoTDB> select * from root.sg.d1;
++-----------------------------+-------------+-------------+-------------+-------------+-------------+-------------+
+|                         Time|root.sg.d1.s3|root.sg.d1.s4|root.sg.d1.s5|root.sg.d1.s6|root.sg.d1.s1|root.sg.d1.s2|
++-----------------------------+-------------+-------------+-------------+-------------+-------------+-------------+
+|1970-01-01T08:00:00.001+08:00|          1.1|          1.1|         test|        false|            1|            1|
+|1970-01-01T08:00:00.002+08:00|         -2.2|         -2.2|        false|         true|           -2|           -2|
+|1970-01-01T08:00:00.003+08:00|          0.0|          0.0|         true|         true|            0|            0|
++-----------------------------+-------------+-------------+-------------+-------------+-------------+-------------+
+Total line number = 3
+It costs 0.009s
+IoTDB> select cast(s1, 'type'='BOOLEAN'), cast(s2, 'type'='BOOLEAN'), cast(s3, 'type'='BOOLEAN'), cast(s4, 'type'='BOOLEAN'), cast(s5, 'type'='BOOLEAN') from root.sg.d1;
++-----------------------------+-------------------------------------+-------------------------------------+-------------------------------------+-------------------------------------+-------------------------------------+
+|                         Time|cast(root.sg.d1.s1, "type"="BOOLEAN")|cast(root.sg.d1.s2, "type"="BOOLEAN")|cast(root.sg.d1.s3, "type"="BOOLEAN")|cast(root.sg.d1.s4, "type"="BOOLEAN")|cast(root.sg.d1.s5, "type"="BOOLEAN")|
++-----------------------------+-------------------------------------+-------------------------------------+-------------------------------------+-------------------------------------+-------------------------------------+
+|1970-01-01T08:00:00.001+08:00|                                 true|                                 true|                                 true|                                 true|                                 true|
+|1970-01-01T08:00:00.002+08:00|                                 true|                                 true|                                 true|                                 true|                                false|
+|1970-01-01T08:00:00.003+08:00|                                false|                                false|                                false|                                false|                                 true|
++-----------------------------+-------------------------------------+-------------------------------------+-------------------------------------+-------------------------------------+-------------------------------------+
+Total line number = 3
+It costs 0.012s
+```
+
+2.当BOOLEAN类型的值为true时,转换为INT32与INT64类型的值为1,转换为FLOAT或者DOUBLE类型时值为1.0,转换为TEXT类型时值为"true"。当BOOLEAN类型的值为false时,转换为INT32与INT64类型的值为0,转换为FLOAT或者DOUBLE类型时值为0.0,转换为TEXT类型时值为"false"。
+
+```
+IoTDB> select cast(s6, 'type'='INT32'), cast(s6, 'type'='INT64'), cast(s6, 'type'='FLOAT'), cast(s6, 'type'='DOUBLE'), cast(s6, 'type'='TEXT') from root.sg.d1;
++-----------------------------+-----------------------------------+-----------------------------------+-----------------------------------+------------------------------------+----------------------------------+
+|                         Time|cast(root.sg.d1.s6, "type"="INT32")|cast(root.sg.d1.s6, "type"="INT64")|cast(root.sg.d1.s6, "type"="FLOAT")|cast(root.sg.d1.s6, "type"="DOUBLE")|cast(root.sg.d1.s6, "type"="TEXT")|
++-----------------------------+-----------------------------------+-----------------------------------+-----------------------------------+------------------------------------+----------------------------------+
+|1970-01-01T08:00:00.001+08:00|                                  0|                                  0|                                0.0|                                 0.0|                             false|
+|1970-01-01T08:00:00.002+08:00|                                  1|                                  1|                                1.0|                                 1.0|                              true|
+|1970-01-01T08:00:00.003+08:00|                                  1|                                  1|                                1.0|                                 1.0|                              true|
++-----------------------------+-----------------------------------+-----------------------------------+-----------------------------------+------------------------------------+----------------------------------+
+Total line number = 3
+It costs 0.016s
+```
+
+3.当TEXT类型转换为INT32、INT64、FLOAT类型时,会先将TEXT类型的数据转换为DOUBLE类型,然后再转换为对应的类型,此时可能会存在损失精度的问题。如果无法转换的话则直接跳过。
+
+```
+IoTDB> select cast(s5, 'type'='INT32'), cast(s5, 'type'='INT64'), cast(s5, 'type'='FLOAT') from root.sg.d1;
++----+-----------------------------------+-----------------------------------+-----------------------------------+
+|Time|cast(root.sg.d1.s5, "type"="INT32")|cast(root.sg.d1.s5, "type"="INT64")|cast(root.sg.d1.s5, "type"="FLOAT")|
++----+-----------------------------------+-----------------------------------+-----------------------------------+
++----+-----------------------------------+-----------------------------------+-----------------------------------+
+Empty set.
+It costs 0.009s
+```
+
+### 使用示例
+
+测试数据:
+```
+IoTDB> select text from root.test;
++-----------------------------+--------------+
+|                         Time|root.test.text|
++-----------------------------+--------------+
+|1970-01-01T08:00:00.001+08:00|           1.1|
+|1970-01-01T08:00:00.002+08:00|             1|
+|1970-01-01T08:00:00.003+08:00|   hello world|
+|1970-01-01T08:00:00.004+08:00|         false|
++-----------------------------+--------------+
+```
+SQL语句:
+```sql
+select cast(text, 'type'='BOOLEAN'), cast(text, 'type'='INT32'), cast(text, 'type'='INT64'), cast(text, 'type'='FLOAT'), cast(text, 'type'='DOUBLE') from root.test;
+```
+结果:
+```
++-----------------------------+--------------------------------------+------------------------------------+------------------------------------+------------------------------------+-------------------------------------+
+|                         Time|cast(root.test.text, "type"="BOOLEAN")|cast(root.test.text, "type"="INT32")|cast(root.test.text, "type"="INT64")|cast(root.test.text, "type"="FLOAT")|cast(root.test.text, "type"="DOUBLE")|
++-----------------------------+--------------------------------------+------------------------------------+------------------------------------+------------------------------------+-------------------------------------+
+|1970-01-01T08:00:00.001+08:00|                                  true|                                   1|                                   1|                                 1.1|                                  1.1|
+|1970-01-01T08:00:00.002+08:00|                                  true|                                   1|                                   1|                                 1.0|                                  1.0|
+|1970-01-01T08:00:00.003+08:00|                                  true|                                null|                                null|                                null|                                 null|
+|1970-01-01T08:00:00.004+08:00|                                 false|                                null|                                null|                                null|                                 null|
++-----------------------------+--------------------------------------+------------------------------------+------------------------------------+------------------------------------+-------------------------------------+
+Total line number = 4
+It costs 0.078s
+```
diff --git a/docs/zh/UserGuide/UDF-Library/Data-Matching.md b/docs/zh/UserGuide/Operators-Functions/Data-Matching.md
similarity index 93%
rename from docs/zh/UserGuide/UDF-Library/Data-Matching.md
rename to docs/zh/UserGuide/Operators-Functions/Data-Matching.md
index 8e5f3f5b06..124f8ea3d1 100644
--- a/docs/zh/UserGuide/UDF-Library/Data-Matching.md
+++ b/docs/zh/UserGuide/Operators-Functions/Data-Matching.md
@@ -1,21 +1,21 @@
 <!--
 
-​    Licensed to the Apache Software Foundation (ASF) under one
-​    or more contributor license agreements.  See the NOTICE file
-​    distributed with this work for additional information
-​    regarding copyright ownership.  The ASF licenses this file
-​    to you under the Apache License, Version 2.0 (the
-​    "License"); you may not use this file except in compliance
-​    with the License.  You may obtain a copy of the License at
-​    
-​        http://www.apache.org/licenses/LICENSE-2.0
-​    
-​    Unless required by applicable law or agreed to in writing,
-​    software distributed under the License is distributed on an
-​    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-​    KIND, either express or implied.  See the License for the
-​    specific language governing permissions and limitations
-​    under the License.
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+    
+        http://www.apache.org/licenses/LICENSE-2.0
+    
+    Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.
 
 -->
 
diff --git a/docs/zh/UserGuide/UDF-Library/Data-Profiling.md b/docs/zh/UserGuide/Operators-Functions/Data-Profiling.md
similarity index 98%
rename from docs/zh/UserGuide/UDF-Library/Data-Profiling.md
rename to docs/zh/UserGuide/Operators-Functions/Data-Profiling.md
index bc7761be39..0fc5977b8b 100644
--- a/docs/zh/UserGuide/UDF-Library/Data-Profiling.md
+++ b/docs/zh/UserGuide/Operators-Functions/Data-Profiling.md
@@ -1,21 +1,21 @@
 <!--
 
-​    Licensed to the Apache Software Foundation (ASF) under one
-​    or more contributor license agreements.  See the NOTICE file
-​    distributed with this work for additional information
-​    regarding copyright ownership.  The ASF licenses this file
-​    to you under the Apache License, Version 2.0 (the
-​    "License"); you may not use this file except in compliance
-​    with the License.  You may obtain a copy of the License at
-​    
-​        http://www.apache.org/licenses/LICENSE-2.0
-​    
-​    Unless required by applicable law or agreed to in writing,
-​    software distributed under the License is distributed on an
-​    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-​    KIND, either express or implied.  See the License for the
-​    specific language governing permissions and limitations
-​    under the License.
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+    
+        http://www.apache.org/licenses/LICENSE-2.0
+    
+    Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.
 
 -->
 
diff --git a/docs/zh/UserGuide/UDF-Library/Data-Quality.md b/docs/zh/UserGuide/Operators-Functions/Data-Quality.md
similarity index 96%
rename from docs/zh/UserGuide/UDF-Library/Data-Quality.md
rename to docs/zh/UserGuide/Operators-Functions/Data-Quality.md
index 6db92eef2b..66c22108c7 100644
--- a/docs/zh/UserGuide/UDF-Library/Data-Quality.md
+++ b/docs/zh/UserGuide/Operators-Functions/Data-Quality.md
@@ -1,21 +1,21 @@
 <!--
 
-​    Licensed to the Apache Software Foundation (ASF) under one
-​    or more contributor license agreements.  See the NOTICE file
-​    distributed with this work for additional information
-​    regarding copyright ownership.  The ASF licenses this file
-​    to you under the Apache License, Version 2.0 (the
-​    "License"); you may not use this file except in compliance
-​    with the License.  You may obtain a copy of the License at
-​    
-​        http://www.apache.org/licenses/LICENSE-2.0
-​    
-​    Unless required by applicable law or agreed to in writing,
-​    software distributed under the License is distributed on an
-​    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-​    KIND, either express or implied.  See the License for the
-​    specific language governing permissions and limitations
-​    under the License.
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+    
+        http://www.apache.org/licenses/LICENSE-2.0
+    
+    Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.
 
 -->
 
diff --git a/docs/zh/UserGuide/UDF-Library/Data-Repairing.md b/docs/zh/UserGuide/Operators-Functions/Data-Repairing.md
similarity index 95%
rename from docs/zh/UserGuide/UDF-Library/Data-Repairing.md
rename to docs/zh/UserGuide/Operators-Functions/Data-Repairing.md
index c5d92fbfdd..0ddb9a54d2 100644
--- a/docs/zh/UserGuide/UDF-Library/Data-Repairing.md
+++ b/docs/zh/UserGuide/Operators-Functions/Data-Repairing.md
@@ -1,21 +1,21 @@
 <!--
 
-​    Licensed to the Apache Software Foundation (ASF) under one
-​    or more contributor license agreements.  See the NOTICE file
-​    distributed with this work for additional information
-​    regarding copyright ownership.  The ASF licenses this file
-​    to you under the Apache License, Version 2.0 (the
-​    "License"); you may not use this file except in compliance
-​    with the License.  You may obtain a copy of the License at
-​    
-​        http://www.apache.org/licenses/LICENSE-2.0
-​    
-​    Unless required by applicable law or agreed to in writing,
-​    software distributed under the License is distributed on an
-​    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-​    KIND, either express or implied.  See the License for the
-​    specific language governing permissions and limitations
-​    under the License.
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+    
+        http://www.apache.org/licenses/LICENSE-2.0
+    
+    Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.
 
 -->
 
diff --git a/docs/zh/UserGuide/UDF-Library/Frequency-Domain.md b/docs/zh/UserGuide/Operators-Functions/Frequency-Domain.md
similarity index 96%
rename from docs/zh/UserGuide/UDF-Library/Frequency-Domain.md
rename to docs/zh/UserGuide/Operators-Functions/Frequency-Domain.md
index b509378932..50091a0c70 100644
--- a/docs/zh/UserGuide/UDF-Library/Frequency-Domain.md
+++ b/docs/zh/UserGuide/Operators-Functions/Frequency-Domain.md
@@ -1,21 +1,21 @@
 <!--
 
-​    Licensed to the Apache Software Foundation (ASF) under one
-​    or more contributor license agreements.  See the NOTICE file
-​    distributed with this work for additional information
-​    regarding copyright ownership.  The ASF licenses this file
-​    to you under the Apache License, Version 2.0 (the
-​    "License"); you may not use this file except in compliance
-​    with the License.  You may obtain a copy of the License at
-​    
-​        http://www.apache.org/licenses/LICENSE-2.0
-​    
-​    Unless required by applicable law or agreed to in writing,
-​    software distributed under the License is distributed on an
-​    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-​    KIND, either express or implied.  See the License for the
-​    specific language governing permissions and limitations
-​    under the License.
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+    
+        http://www.apache.org/licenses/LICENSE-2.0
+    
+    Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.
 
 -->
 
diff --git a/docs/zh/UserGuide/Operators-Functions/Lambda.md b/docs/zh/UserGuide/Operators-Functions/Lambda.md
new file mode 100644
index 0000000000..af753b755d
--- /dev/null
+++ b/docs/zh/UserGuide/Operators-Functions/Lambda.md
@@ -0,0 +1,83 @@
+<!--
+
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+    
+        http://www.apache.org/licenses/LICENSE-2.0
+    
+    Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.
+
+-->
+
+# Lambda 表达式
+
+## JEXL 自定义函数
+
+### 函数简介
+
+Java Expression Language (JEXL) 是一个表达式语言引擎。我们使用 JEXL 来扩展 UDF,在命令行中,通过简易的 lambda 表达式来实现 UDF。
+
+lambda 表达式中支持的运算符详见链接 [JEXL 中 lambda 表达式支持的运算符](https://commons.apache.org/proper/commons-jexl/apidocs/org/apache/commons/jexl3/package-summary.html#customization) 。
+
+| 函数名      | 可接收的输入序列类型                     | 必要的属性参数                               | 输出序列类型     | 功能类型                                             |
+|----------|--------------------------------|---------------------------------------|------------|--------------------------------------------------|
+| JEXL   | INT32 / INT64 / FLOAT / DOUBLE / TEXT / BOOLEAN | `expr`是一个支持标准的一元或多元参数的lambda表达式,符合`x -> {...}`或`(x, y, z) -> {...}`的格式,例如`x -> {x * 2}`, `(x, y, z) -> {x + y * z}`| INT32 / INT64 / FLOAT / DOUBLE / TEXT / BOOLEAN | 返回将输入的时间序列通过lambda表达式变换的序列             |
+
+### 使用示例
+
+输入序列:
+```
+IoTDB> select * from root.ln.wf01.wt01;
++-----------------------------+---------------------+--------------------+-----------------------------+
+|                         Time|root.ln.wf01.wt01.str|root.ln.wf01.wt01.st|root.ln.wf01.wt01.temperature|
++-----------------------------+---------------------+--------------------+-----------------------------+
+|1970-01-01T08:00:00.000+08:00|                  str|                10.0|                          0.0|
+|1970-01-01T08:00:00.001+08:00|                  str|                20.0|                          1.0|
+|1970-01-01T08:00:00.002+08:00|                  str|                30.0|                          2.0|
+|1970-01-01T08:00:00.003+08:00|                  str|                40.0|                          3.0|
+|1970-01-01T08:00:00.004+08:00|                  str|                50.0|                          4.0|
+|1970-01-01T08:00:00.005+08:00|                  str|                60.0|                          5.0|
+|1970-01-01T08:00:00.006+08:00|                  str|                70.0|                          6.0|
+|1970-01-01T08:00:00.007+08:00|                  str|                80.0|                          7.0|
+|1970-01-01T08:00:00.008+08:00|                  str|                90.0|                          8.0|
+|1970-01-01T08:00:00.009+08:00|                  str|               100.0|                          9.0|
+|1970-01-01T08:00:00.010+08:00|                  str|               110.0|                         10.0|
++-----------------------------+---------------------+--------------------+-----------------------------+
+```
+
+用于查询的SQL语句:
+```sql
+select jexl(temperature, 'expr'='x -> {x + x}') as jexl1, jexl(temperature, 'expr'='x -> {x * 3}') as jexl2, jexl(temperature, 'expr'='x -> {x * x}') as jexl3, jexl(temperature, 'expr'='x -> {multiply(x, 100)}') as jexl4, jexl(temperature, st, 'expr'='(x, y) -> {x + y}') as jexl5, jexl(temperature, st, str, 'expr'='(x, y, z) -> {x + y + z}') as jexl6 from root.ln.wf01.wt01;
+```
+
+输出序列:
+```
++-----------------------------+-----+-----+-----+------+-----+--------+
+|                         Time|jexl1|jexl2|jexl3| jexl4|jexl5|   jexl6|
++-----------------------------+-----+-----+-----+------+-----+--------+
+|1970-01-01T08:00:00.000+08:00|  0.0|  0.0|  0.0|   0.0| 10.0| 10.0str|
+|1970-01-01T08:00:00.001+08:00|  2.0|  3.0|  1.0| 100.0| 21.0| 21.0str|
+|1970-01-01T08:00:00.002+08:00|  4.0|  6.0|  4.0| 200.0| 32.0| 32.0str|
+|1970-01-01T08:00:00.003+08:00|  6.0|  9.0|  9.0| 300.0| 43.0| 43.0str|
+|1970-01-01T08:00:00.004+08:00|  8.0| 12.0| 16.0| 400.0| 54.0| 54.0str|
+|1970-01-01T08:00:00.005+08:00| 10.0| 15.0| 25.0| 500.0| 65.0| 65.0str|
+|1970-01-01T08:00:00.006+08:00| 12.0| 18.0| 36.0| 600.0| 76.0| 76.0str|
+|1970-01-01T08:00:00.007+08:00| 14.0| 21.0| 49.0| 700.0| 87.0| 87.0str|
+|1970-01-01T08:00:00.008+08:00| 16.0| 24.0| 64.0| 800.0| 98.0| 98.0str|
+|1970-01-01T08:00:00.009+08:00| 18.0| 27.0| 81.0| 900.0|109.0|109.0str|
+|1970-01-01T08:00:00.010+08:00| 20.0| 30.0|100.0|1000.0|120.0|120.0str|
++-----------------------------+-----+-----+-----+------+-----+--------+
+Total line number = 11
+It costs 0.118s
+```
+
diff --git a/docs/zh/UserGuide/Operators-Functions/Logical.md b/docs/zh/UserGuide/Operators-Functions/Logical.md
new file mode 100644
index 0000000000..42c6909b99
--- /dev/null
+++ b/docs/zh/UserGuide/Operators-Functions/Logical.md
@@ -0,0 +1,63 @@
+<!--
+
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+    
+        http://www.apache.org/licenses/LICENSE-2.0
+    
+    Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.
+
+-->
+
+# 逻辑运算符
+
+## 一元逻辑运算符
+
+- 支持运算符:`!`
+- 输入数据类型:`BOOLEAN`。
+- 输出数据类型:`BOOLEAN`。
+- 注意:`!`的优先级很高,记得使用括号调整优先级。
+
+## 二元逻辑运算符
+
+- 支持运算符 
+  - AND:`and`,`&`, `&&`
+  - OR:`or`,`|`,`||`
+
+- 输入数据类型:`BOOLEAN`。
+
+- 返回类型 `BOOLEAN`。
+
+- 注意:当某个时间戳下左操作数和右操作数都为`BOOLEAN`类型时,二元逻辑操作才会有输出结果。
+
+**示例:**
+
+```sql
+select a, b, a > 10, a <= b, !(a <= b), a > 10 && a > b from root.test;
+```
+
+运行结果
+```
+IoTDB> select a, b, a > 10, a <= b, !(a <= b), a > 10 && a > b from root.test;
++-----------------------------+-----------+-----------+----------------+--------------------------+---------------------------+------------------------------------------------+
+|                         Time|root.test.a|root.test.b|root.test.a > 10|root.test.a <= root.test.b|!root.test.a <= root.test.b|(root.test.a > 10) & (root.test.a > root.test.b)|
++-----------------------------+-----------+-----------+----------------+--------------------------+---------------------------+------------------------------------------------+
+|1970-01-01T08:00:00.001+08:00|         23|       10.0|            true|                     false|                       true|                                            true|
+|1970-01-01T08:00:00.002+08:00|         33|       21.0|            true|                     false|                       true|                                            true|
+|1970-01-01T08:00:00.004+08:00|         13|       15.0|            true|                      true|                      false|                                           false|
+|1970-01-01T08:00:00.005+08:00|         26|        0.0|            true|                     false|                       true|                                            true|
+|1970-01-01T08:00:00.008+08:00|          1|       22.0|           false|                      true|                      false|                                           false|
+|1970-01-01T08:00:00.010+08:00|         23|       12.0|            true|                     false|                       true|                                            true|
++-----------------------------+-----------+-----------+----------------+--------------------------+---------------------------+------------------------------------------------+
+```
+
diff --git a/docs/zh/UserGuide/Operators-Functions/Mathematical.md b/docs/zh/UserGuide/Operators-Functions/Mathematical.md
new file mode 100644
index 0000000000..263ab4354e
--- /dev/null
+++ b/docs/zh/UserGuide/Operators-Functions/Mathematical.md
@@ -0,0 +1,116 @@
+<!--
+
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+    
+        http://www.apache.org/licenses/LICENSE-2.0
+    
+    Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.
+
+-->
+
+# 算数运算符和函数
+
+## 算数运算符
+
+### 一元算数运算符
+
+支持的运算符:`+`, `-`
+
+输入数据类型要求:`INT32`, `INT64`, `FLOAT`, `DOUBLE`
+
+输出数据类型:与输入数据类型一致
+
+### 二元算数运算符
+
+支持的运算符:`+`, `-`, `*`, `/`,  `%`
+
+输入数据类型要求:`INT32`, `INT64`, `FLOAT`和`DOUBLE`
+
+输出数据类型:`DOUBLE`
+
+注意:当某个时间戳下左操作数和右操作数都不为空(`null`)时,二元运算操作才会有输出结果
+
+### 使用示例
+
+例如:
+
+```sql
+select s1, - s1, s2, + s2, s1 + s2, s1 - s2, s1 * s2, s1 / s2, s1 % s2 from root.sg.d1
+```
+
+结果:
+
+``` 
++-----------------------------+-------------+--------------+-------------+-------------+-----------------------------+-----------------------------+-----------------------------+-----------------------------+-----------------------------+
+|                         Time|root.sg.d1.s1|-root.sg.d1.s1|root.sg.d1.s2|root.sg.d1.s2|root.sg.d1.s1 + root.sg.d1.s2|root.sg.d1.s1 - root.sg.d1.s2|root.sg.d1.s1 * root.sg.d1.s2|root.sg.d1.s1 / root.sg.d1.s2|root.sg.d1.s1 % root.sg.d1.s2|
++-----------------------------+-------------+--------------+-------------+-------------+-----------------------------+-----------------------------+-----------------------------+-----------------------------+-----------------------------+
+|1970-01-01T08:00:00.001+08:00|          1.0|          -1.0|          1.0|          1.0|                          2.0|                          0.0|                          1.0|                          1.0|                          0.0|
+|1970-01-01T08:00:00.002+08:00|          2.0|          -2.0|          2.0|          2.0|                          4.0|                          0.0|                          4.0|                          1.0|                          0.0|
+|1970-01-01T08:00:00.003+08:00|          3.0|          -3.0|          3.0|          3.0|                          6.0|                          0.0|                          9.0|                          1.0|                          0.0|
+|1970-01-01T08:00:00.004+08:00|          4.0|          -4.0|          4.0|          4.0|                          8.0|                          0.0|                         16.0|                          1.0|                          0.0|
+|1970-01-01T08:00:00.005+08:00|          5.0|          -5.0|          5.0|          5.0|                         10.0|                          0.0|                         25.0|                          1.0|                          0.0|
++-----------------------------+-------------+--------------+-------------+-------------+-----------------------------+-----------------------------+-----------------------------+-----------------------------+-----------------------------+
+Total line number = 5
+It costs 0.014s
+```
+
+## 数学函数
+
+目前 IoTDB 支持下列数学函数,这些数学函数的行为与这些函数在 Java Math 标准库中对应实现的行为一致。
+
+| 函数名  | 输入序列类型                   | 输出序列类型             | Java 标准库中的对应实现                                      |
+| ------- | ------------------------------ | ------------------------ | ------------------------------------------------------------ |
+| SIN     | INT32 / INT64 / FLOAT / DOUBLE | DOUBLE                   | Math#sin(double)                                             |
+| COS     | INT32 / INT64 / FLOAT / DOUBLE | DOUBLE                   | Math#cos(double)                                             |
+| TAN     | INT32 / INT64 / FLOAT / DOUBLE | DOUBLE                   | Math#tan(double)                                             |
+| ASIN    | INT32 / INT64 / FLOAT / DOUBLE | DOUBLE                   | Math#asin(double)                                            |
+| ACOS    | INT32 / INT64 / FLOAT / DOUBLE | DOUBLE                   | Math#acos(double)                                            |
+| ATAN    | INT32 / INT64 / FLOAT / DOUBLE | DOUBLE                   | Math#atan(double)                                            |
+| SINH    | INT32 / INT64 / FLOAT / DOUBLE | DOUBLE                   | Math#sinh(double)                                            |
+| COSH    | INT32 / INT64 / FLOAT / DOUBLE | DOUBLE                   | Math#cosh(double)                                            |
+| TANH    | INT32 / INT64 / FLOAT / DOUBLE | DOUBLE                   | Math#tanh(double)                                            |
+| DEGREES | INT32 / INT64 / FLOAT / DOUBLE | DOUBLE                   | Math#toDegrees(double)                                       |
+| RADIANS | INT32 / INT64 / FLOAT / DOUBLE | DOUBLE                   | Math#toRadians(double)                                       |
+| ABS     | INT32 / INT64 / FLOAT / DOUBLE | 与输入序列的实际类型一致 | Math#abs(int) / Math#abs(long) /Math#abs(float) /Math#abs(double) |
+| SIGN    | INT32 / INT64 / FLOAT / DOUBLE | DOUBLE                   | Math#signum(double)                                          |
+| CEIL    | INT32 / INT64 / FLOAT / DOUBLE | DOUBLE                   | Math#ceil(double)                                            |
+| FLOOR   | INT32 / INT64 / FLOAT / DOUBLE | DOUBLE                   | Math#floor(double)                                           |
+| ROUND   | INT32 / INT64 / FLOAT / DOUBLE | DOUBLE                   | Math#rint(double)                                            |
+| EXP     | INT32 / INT64 / FLOAT / DOUBLE | DOUBLE                   | Math#exp(double)                                             |
+| LN      | INT32 / INT64 / FLOAT / DOUBLE | DOUBLE                   | Math#log(double)                                             |
+| LOG10   | INT32 / INT64 / FLOAT / DOUBLE | DOUBLE                   | Math#log10(double)                                           |
+| SQRT    | INT32 / INT64 / FLOAT / DOUBLE | DOUBLE                   | Math#sqrt(double)                                            |
+
+例如:
+
+```   sql
+select s1, sin(s1), cos(s1), tan(s1) from root.sg1.d1 limit 5 offset 1000;
+```
+
+结果:
+
+```
++-----------------------------+-------------------+-------------------+--------------------+-------------------+
+|                         Time|     root.sg1.d1.s1|sin(root.sg1.d1.s1)| cos(root.sg1.d1.s1)|tan(root.sg1.d1.s1)|
++-----------------------------+-------------------+-------------------+--------------------+-------------------+
+|2020-12-10T17:11:49.037+08:00|7360723084922759782| 0.8133527237573284|  0.5817708713544664| 1.3980636773094157|
+|2020-12-10T17:11:49.038+08:00|4377791063319964531|-0.8938962705202537|  0.4482738644511651| -1.994085181866842|
+|2020-12-10T17:11:49.039+08:00|7972485567734642915| 0.9627757585308978|-0.27030138509681073|-3.5618602479083545|
+|2020-12-10T17:11:49.040+08:00|2508858212791964081|-0.6073417341629443| -0.7944406950452296| 0.7644897069734913|
+|2020-12-10T17:11:49.041+08:00|2817297431185141819|-0.8419358900502509| -0.5395775727782725| 1.5603611649667768|
++-----------------------------+-------------------+-------------------+--------------------+-------------------+
+Total line number = 5
+It costs 0.008s
+```
+
diff --git a/docs/zh/UserGuide/Operators-Functions/Overview.md b/docs/zh/UserGuide/Operators-Functions/Overview.md
new file mode 100644
index 0000000000..f5a64ad0da
--- /dev/null
+++ b/docs/zh/UserGuide/Operators-Functions/Overview.md
@@ -0,0 +1,239 @@
+<!--
+
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+    
+        http://www.apache.org/licenses/LICENSE-2.0
+    
+    Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.
+
+-->
+
+# 运算符和函数
+
+本章介绍 IoTDB 支持的运算符和函数。IoTDB 提供了丰富的内置运算符和函数来满足您的计算需求,同时支持通过[用户自定义函数](./User-Defined-Function.md)能力进行扩展。
+
+可以使用 `SHOW FUNCTIONS` 显示所有可用函数的列表,包括内置函数和自定义函数。
+
+关于运算符和函数在 SQL 中的行为,可以查看文档 [选择表达式](../Query-Data/Select-Expression.md)。
+
+## 运算符列表
+
+### 算数运算符
+|运算符                       |含义|
+|----------------------------|-----------|
+|`+`                         |取正(单目)|
+|`-`                         |取负(单目)|
+|`*`                         |乘|
+|`/`                         |除|
+|`%`                         |取余|
+|`+`                         |加|
+|`-`                         |减|
+
+详细说明及示例见文档 [算数运算符和函数](./Mathematical.md)。
+
+### 比较运算符
+|运算符                       |含义|
+|----------------------------|-----------|
+|`>`                         |大于|
+|`>=`                        |大于等于|
+|`<`                         |小于|
+|`<=`                        |小于等于|
+|`==`                        |等于|
+|`!=` / `<>`                 |不等于|
+|`BETWEEN ... AND ...`       |在指定范围内|
+|`NOT BETWEEN ... AND ...`   |不在指定范围内|
+|`LIKE`                      |匹配简单模式|
+|`NOT LIKE`                  |无法匹配简单模式|
+|`REGEXP`                    |匹配正则表达式|
+|`NOT REGEXP`                |无法匹配正则表达式|
+|`IS NULL`                   |是空值|
+|`IS NOT NULL`               |不是空值|
+|`IN` / `CONTAINS`           |是指定列表中的值|
+|`NOT IN` / `NOT CONTAINS`   |不是指定列表中的值|
+
+详细说明及示例见文档 [比较运算符和函数](./Comparison.md)。
+
+### 逻辑运算符
+|运算符                       |含义|
+|----------------------------|-----------|
+|`NOT` / `!`                 |取非(单目)|
+|`AND` / `&` / `&&`          |逻辑与|
+|`OR`/ &#124; / &#124;&#124; |逻辑或|
+<!--- &#124;即管道符 转义不能用在``里, 表格内不允许使用管道符 -->
+
+详细说明及示例见文档 [逻辑运算符](./Logical.md)。
+
+### 运算符优先级
+
+运算符的优先级从高到低如下所示排列,同一行的运算符具有相同的优先级。
+```sql
+!, - (单目), + (单目)
+*, /, DIV, %, MOD
+-, +
+=, ==, <=>, >=, >, <=, <, <>, !=
+LIKE, REGEXP, NOT LIKE, NOT REGEXP
+BETWEEN ... AND ..., NOT BETWEEN ... AND ...
+IS NULL, IS NOT NULL
+IN, CONTAINS, NOT IN, NOT CONTAINS
+AND, &, &&
+OR, |, ||
+```
+
+## 内置函数列表
+
+### 聚合函数
+
+| 函数名      | 功能描述                                                     | 允许的输入类型           | 输出类型       |
+| ----------- | ------------------------------------------------------------ | ------------------------ | -------------- |
+| SUM         | 求和。                                                       | INT32 INT64 FLOAT DOUBLE | DOUBLE         |
+| COUNT       | 计算数据点数。                                               | 所有类型                 | INT            |
+| AVG         | 求平均值。                                                   | INT32 INT64 FLOAT DOUBLE | DOUBLE         |
+| EXTREME     | 求具有最大绝对值的值。如果正值和负值的最大绝对值相等,则返回正值。 | INT32 INT64 FLOAT DOUBLE | 与输入类型一致 |
+| MAX_VALUE   | 求最大值。                                                   | INT32 INT64 FLOAT DOUBLE | 与输入类型一致 |
+| MIN_VALUE   | 求最小值。                                                   | INT32 INT64 FLOAT DOUBLE | 与输入类型一致 |
+| FIRST_VALUE | 求时间戳最小的值。                                           | 所有类型                 | 与输入类型一致 |
+| LAST_VALUE  | 求时间戳最大的值。                                           | 所有类型                 | 与输入类型一致 |
+| MAX_TIME    | 求最大时间戳。                                               | 所有类型                 | Timestamp      |
+| MIN_TIME    | 求最小时间戳。                                               | 所有类型                 | Timestamp      |
+详细说明及示例见文档 [聚合函数](./Aggregation.md)。
+
+### 数学函数 
+
+| 函数名  | 输入序列类型                   | 输出序列类型             | Java 标准库中的对应实现                                      |
+| ------- | ------------------------------ | ------------------------ | ------------------------------------------------------------ |
+| SIN     | INT32 / INT64 / FLOAT / DOUBLE | DOUBLE                   | Math#sin(double)                                             |
+| COS     | INT32 / INT64 / FLOAT / DOUBLE | DOUBLE                   | Math#cos(double)                                             |
+| TAN     | INT32 / INT64 / FLOAT / DOUBLE | DOUBLE                   | Math#tan(double)                                             |
+| ASIN    | INT32 / INT64 / FLOAT / DOUBLE | DOUBLE                   | Math#asin(double)                                            |
+| ACOS    | INT32 / INT64 / FLOAT / DOUBLE | DOUBLE                   | Math#acos(double)                                            |
+| ATAN    | INT32 / INT64 / FLOAT / DOUBLE | DOUBLE                   | Math#atan(double)                                            |
+| SINH    | INT32 / INT64 / FLOAT / DOUBLE | DOUBLE                   | Math#sinh(double)                                            |
+| COSH    | INT32 / INT64 / FLOAT / DOUBLE | DOUBLE                   | Math#cosh(double)                                            |
+| TANH    | INT32 / INT64 / FLOAT / DOUBLE | DOUBLE                   | Math#tanh(double)                                            |
+| DEGREES | INT32 / INT64 / FLOAT / DOUBLE | DOUBLE                   | Math#toDegrees(double)                                       |
+| RADIANS | INT32 / INT64 / FLOAT / DOUBLE | DOUBLE                   | Math#toRadians(double)                                       |
+| ABS     | INT32 / INT64 / FLOAT / DOUBLE | 与输入序列的实际类型一致 | Math#abs(int) / Math#abs(long) /Math#abs(float) /Math#abs(double) |
+| SIGN    | INT32 / INT64 / FLOAT / DOUBLE | DOUBLE                   | Math#signum(double)                                          |
+| CEIL    | INT32 / INT64 / FLOAT / DOUBLE | DOUBLE                   | Math#ceil(double)                                            |
+| FLOOR   | INT32 / INT64 / FLOAT / DOUBLE | DOUBLE                   | Math#floor(double)                                           |
+| ROUND   | INT32 / INT64 / FLOAT / DOUBLE | DOUBLE                   | Math#rint(double)                                            |
+| EXP     | INT32 / INT64 / FLOAT / DOUBLE | DOUBLE                   | Math#exp(double)                                             |
+| LN      | INT32 / INT64 / FLOAT / DOUBLE | DOUBLE                   | Math#log(double)                                             |
+| LOG10   | INT32 / INT64 / FLOAT / DOUBLE | DOUBLE                   | Math#log10(double)                                           |
+| SQRT    | INT32 / INT64 / FLOAT / DOUBLE | DOUBLE                   | Math#sqrt(double)                                            |
+
+
+详细说明及示例见文档 [算数运算符和函数](./Mathematical.md)。
+
+### 比较函数
+
+| 函数名    | 可接收的输入序列类型                | 必要的属性参数                               | 输出序列类型     | 功能类型                                             |
+|----------|--------------------------------|---------------------------------------|------------|--------------------------------------------------|
+| ON_OFF   | INT32 / INT64 / FLOAT / DOUBLE | `threshold`:DOUBLE                  | BOOLEAN | 返回`ts_value >= threshold`的bool值                  |
+| IN_RANGE | INT32 / INT64 / FLOAT / DOUBLE | `lower`:DOUBLE<br/>`upper`:DOUBLE | BOOLEAN | 返回`ts_value >= lower && ts_value <= upper`的bool值 |                                                    |
+
+详细说明及示例见文档 [比较运算符和函数](./Comparison.md)。
+
+### 字符串处理函数
+
+| 函数名          | 输入序列类型 | 必要的属性参数                       | 输出序列类型 | 功能描述                                  |
+| --------------- | ------------ | ------------------------------------ | ------------ | ----------------------------------------- |
+| STRING_CONTAINS | TEXT         | `s`: 待搜寻的字符串                  | BOOLEAN      | 判断字符串中是否存在`s`                   |
+| STRING_MATCHES  | TEXT         | `regex`: Java 标准库风格的正则表达式 | BOOLEAN      | 判断字符串是否能够被正则表达式`regex`匹配 |
+| LENGTH | TEXT | 无 | INT32 | 返回字符串的长度 |
+| STRLOCATE | TEXT | `target`: 需要被定位的子串 <br/> `reverse`: 指定是否需要倒序定位,默认值为`false`, 即从左至右定位 | INT32 | 获取`target`子串第一次出现在输入序列的位置,如果输入序列中不包含`target`则返回 -1 |
+| STARTSWITH | TEXT | `target`: 需要匹配的前缀 | BOOLEAN | 判断字符串是否有指定前缀 |
+| ENDSWITH | TEXT | `target`: 需要匹配的后缀 | BOOLEAN | 判断字符串是否有指定后缀 |
+| CONCAT | TEXT | `targets`: 一系列 K-V, key需要以`target`为前缀且不重复, value是待拼接的字符串。<br/>`series_behind`: 指定拼接时时间序列是否在后面,默认为`false`。 | TEXT | 拼接字符串和`target`字串 |
+| SUBSTR | TEXT | `start`: 指定子串开始下标 <br/>`end`: 指定子串结束下标  | TEXT | 获取下标从`start`到`end - 1`的子串 |
+| UPPER | TEXT | 无 | TEXT | 将字符串转化为大写 |
+| LOWER | TEXT | 无 | TEXT | 将字符串转化为小写 |
+| TRIM | TEXT | 无 | TEXT | 移除字符串前后的空格 |
+| STRCMP | TEXT | 无 | TEXT | 用于比较两个输入序列,如果值相同返回 `0` , 序列1的值小于序列2的值返回一个`负数`,序列1的值大于序列2的值返回一个`正数` |
+| STRREPLACE | TEXT | `target`: 需要替换的字符子串 <br/> `replace`: 替换后的字符串 <br/> `limit`: 替换次数,大于等于 -1 的整数,默认为 -1 表示所有匹配的子串都会被替换 <br/>`offset`: 需要跳过的匹配次数,即前`offset`次匹配到的字符子串并不会被替换,默认为 0 <br/>`reverse`: 是否需要反向计数,默认为 false 即按照从左向右的次序 | TEXT | 将字符串中的子串替换为指定的字符串|
+| REGEXMATCH | TEXT | `regex`: Java 标准库风格的正则表达式 <br/> `group`: 输出的匹配组序号,根据 java.util.regex 规定,第 0 组为整个正则表达式,此后的组按照左括号出现的顺序依次编号 | TEXT | 用于正则表达式匹配文本中的具体内容并返回 |
+| REGEXREPLACE | TEXT | `regex`: Java 标准库风格的正则表达式 <br/> `replace`: 替换后的字符串,支持 Java 正则表达式中的后向引用 <br/> `limit`: 替换次数,大于等于 -1 的整数,默认为 -1 表示所有匹配的子串都会被替换 <br/> `offset`: 需要跳过的匹配次数,即前`offset`次匹配到的字符子串并不会被替换,默认为 0 <br/> `reverse`: 是否需要反向计数,默认为 false 即按照从左向右的次序 | TEXT | 用于将文本中符合正则表达式的匹配结果替换为指定的字符串 |
+| REGEXSPLIT | TEXT | `regex`: Java 标准库风格的正则表达式 <br/> `index`: 输出结果在切分后数组中的序号 | TEXT | 用于使用给定的正则表达式切分文本,并返回指定的项 |
+
+详细说明及示例见文档 [字符串处理函数](./String.md)。
+
+### 数据类型转换函数
+
+| 函数名 | 必要的属性参数                                               | 输出序列类型             | 功能类型                           |
+| ------ | ------------------------------------------------------------ | ------------------------ | ---------------------------------- |
+| CAST   | `type`:输出的数据点的类型,只能是 INT32 / INT64 / FLOAT / DOUBLE / BOOLEAN / TEXT | 由输入属性参数`type`决定 | 将数据转换为`type`参数指定的类型。 |
+
+详细说明及示例见文档 [数据类型转换](./Conversion.md)。
+
+### 常序列生成函数
+
+| 函数名 | 必要的属性参数                                               | 输出序列类型               | 功能描述                                                     |
+| ------ | ------------------------------------------------------------ | -------------------------- | ------------------------------------------------------------ |
+| CONST  | `value`: 输出的数据点的值 <br />`type`: 输出的数据点的类型,只能是 INT32 / INT64 / FLOAT / DOUBLE / BOOLEAN / TEXT | 由输入属性参数 `type` 决定 | 根据输入属性 `value` 和 `type` 输出用户指定的常序列。        |
+| PI     | 无                                                           | DOUBLE                     | 常序列的值:`π` 的 `double` 值,圆的周长与其直径的比值,即圆周率,等于 *Java标准库* 中的`Math.PI`。 |
+| E      | 无                                                           | DOUBLE                     | 常序列的值:`e` 的 `double` 值,自然对数的底,它等于 *Java 标准库*  中的 `Math.E`。 |
+
+详细说明及示例见文档 [常序列生成函数](./Constant.md)。
+
+### 选择函数
+
+| 函数名   | 输入序列类型                          | 必要的属性参数                                    | 输出序列类型             | 功能描述                                                     |
+| -------- | ------------------------------------- | ------------------------------------------------- | ------------------------ | ------------------------------------------------------------ |
+| TOP_K    | INT32 / INT64 / FLOAT / DOUBLE / TEXT | `k`: 最多选择的数据点数,必须大于 0 小于等于 1000 | 与输入序列的实际类型一致 | 返回某时间序列中值最大的`k`个数据点。若多于`k`个数据点的值并列最大,则返回时间戳最小的数据点。 |
+| BOTTOM_K | INT32 / INT64 / FLOAT / DOUBLE / TEXT | `k`: 最多选择的数据点数,必须大于 0 小于等于 1000 | 与输入序列的实际类型一致 | 返回某时间序列中值最小的`k`个数据点。若多于`k`个数据点的值并列最小,则返回时间戳最小的数据点。 |
+
+详细说明及示例见文档 [选择函数](./Selection.md)。
+
+### 区间查询函数
+
+| 函数名               | 输入序列类型                               | 属性参数                                           | 输出序列类型 | 功能描述                                                             |
+|-------------------|--------------------------------------|------------------------------------------------|-------|------------------------------------------------------------------|
+| ZERO_DURATION     | INT32/ INT64/ FLOAT/ DOUBLE/ BOOLEAN | `min`:可选,默认值0</br>`max`:可选,默认值`Long.MAX_VALUE` | Long  | 返回时间序列连续为0(false)的开始时间与持续时间,持续时间t(单位ms)满足`t >= min && t <= max`  |
+| NON_ZERO_DURATION | INT32/ INT64/ FLOAT/ DOUBLE/ BOOLEAN | `min`:可选,默认值0</br>`max`:可选,默认值`Long.MAX_VALUE` | Long  | 返回时间序列连续不为0(false)的开始时间与持续时间,持续时间t(单位ms)满足`t >= min && t <= max` |               |
+| ZERO_COUNT        | INT32/ INT64/ FLOAT/ DOUBLE/ BOOLEAN | `min`:可选,默认值1</br>`max`:可选,默认值`Long.MAX_VALUE` | Long  | 返回时间序列连续为0(false)的开始时间与其后数据点的个数,数据点个数n满足`n >= min && n <= max`   |               |
+| NON_ZERO_COUNT    | INT32/ INT64/ FLOAT/ DOUBLE/ BOOLEAN | `min`:可选,默认值1</br>`max`:可选,默认值`Long.MAX_VALUE` | Long  | 返回时间序列连续不为0(false)的开始时间与其后数据点的个数,数据点个数n满足`n >= min && n <= max`  |               |
+
+详细说明及示例见文档 [区间查询函数](./Continuous-Interval.md)。
+
+### 趋势计算函数
+
+| 函数名                  | 输入序列类型                                    | 输出序列类型             | 功能描述                                                     |
+| ----------------------- | ----------------------------------------------- | ------------------------ | ------------------------------------------------------------ |
+| TIME_DIFFERENCE         | INT32 / INT64 / FLOAT / DOUBLE / BOOLEAN / TEXT | INT64                    | 统计序列中某数据点的时间戳与前一数据点时间戳的差。范围内第一个数据点没有对应的结果输出。 |
+| DIFFERENCE              | INT32 / INT64 / FLOAT / DOUBLE                  | 与输入序列的实际类型一致 | 统计序列中某数据点的值与前一数据点的值的差。范围内第一个数据点没有对应的结果输出。 |
+| NON_NEGATIVE_DIFFERENCE | INT32 / INT64 / FLOAT / DOUBLE                  | 与输入序列的实际类型一致 | 统计序列中某数据点的值与前一数据点的值的差的绝对值。范围内第一个数据点没有对应的结果输出。 |
+| DERIVATIVE              | INT32 / INT64 / FLOAT / DOUBLE                  | DOUBLE                   | 统计序列中某数据点相对于前一数据点的变化率,数量上等同于 DIFFERENCE /  TIME_DIFFERENCE。范围内第一个数据点没有对应的结果输出。 |
+| NON_NEGATIVE_DERIVATIVE | INT32 / INT64 / FLOAT / DOUBLE                  | DOUBLE                   | 统计序列中某数据点相对于前一数据点的变化率的绝对值,数量上等同于 NON_NEGATIVE_DIFFERENCE /  TIME_DIFFERENCE。范围内第一个数据点没有对应的结果输出。 |
+
+详细说明及示例见文档 [趋势计算函数](./Variation-Trend.md)。
+
+### 采样函数
+
+| 函数名      | 可接收的输入序列类型                     | 必要的属性参数                               | 输出序列类型     | 功能类型                                             |
+|----------|--------------------------------|---------------------------------------|------------|--------------------------------------------------|
+| EQUAL_SIZE_BUCKET_RANDOM_SAMPLE   | INT32 / INT64 / FLOAT / DOUBLE | 降采样比例 `proportion`,取值范围为`(0, 1]`,默认为`0.1`  | INT32 / INT64 / FLOAT / DOUBLE | 返回符合采样比例的等分桶随机采样                |
+| EQUAL_SIZE_BUCKET_AGG_SAMPLE   | INT32 / INT64 / FLOAT / DOUBLE | `proportion`取值范围为`(0, 1]`,默认为`0.1`</br>`type`:取值类型有`avg`, `max`, `min`, `sum`, `extreme`, `variance`, 默认为`avg`  | INT32 / INT64 / FLOAT / DOUBLE | 返回符合采样比例的等分桶聚合采样                |
+| EQUAL_SIZE_BUCKET_M4_SAMPLE   | INT32 / INT64 / FLOAT / DOUBLE | `proportion`取值范围为`(0, 1]`,默认为`0.1`| INT32 / INT64 / FLOAT / DOUBLE | 返回符合采样比例的等分桶M4采样                |
+| EQUAL_SIZE_BUCKET_OUTLIER_SAMPLE   | INT32 / INT64 / FLOAT / DOUBLE | `proportion`取值范围为`(0, 1]`,默认为`0.1`</br>`type`取值为`avg`或`stendis`或`cos`或`prenextdis`,默认为`avg`</br>`number`取值应大于0,默认`3`| INT32 / INT64 / FLOAT / DOUBLE | 返回符合采样比例和桶内采样个数的等分桶离群值采样                |
+| M4     | INT32 / INT64 / FLOAT / DOUBLE | 包含固定点数的窗口和滑动时间窗口使用不同的属性参数。包含固定点数的窗口使用属性`windowSize`和`slidingStep`。滑动时间窗口使用属性`timeInterval`、`slidingStep`、`displayWindowBegin`和`displayWindowEnd`。更多细节见下文。 | INT32 / INT64 / FLOAT / DOUBLE | 返回每个窗口内的第一个点(`first`)、最后一个点(`last`)、最小值点(`bottom`)、最大值点(`top`)。在一个窗口内的聚合点输出之前,M4会将它们按照时间戳递增排序并且去重。 |
+
+## 数据质量函数库
+
+对基于时序数据的应用而言,数据质量至关重要。基于用户自定义函数能力,IoTDB 提供了一系列关于数据质量的函数,包括数据画像、数据质量评估与修复等,能够满足工业领域对数据质量的需求。
+
+**该函数库中的函数不是内置函数,使用前要先加载到系统中。** 操作流程如下:
+1. 下载包含全部依赖的 jar 包和注册脚本 [【点击下载】](https://archive.apache.org/dist/iotdb/0.14.0-preview3/apache-iotdb-0.14.0-preview3-library-udf-bin.zip) ;
+2. 将 jar 包复制到 IoTDB 程序目录的 `ext\udf` 目录下;
+3. 启动 IoTDB;
+4. 将注册脚本复制到 IoTDB 的程序目录下(与`sbin`目录同级的根目录下),修改脚本中的参数(如果需要)并运行注册脚本以注册 UDF。
\ No newline at end of file
diff --git a/docs/zh/UserGuide/Operators-Functions/Sample.md b/docs/zh/UserGuide/Operators-Functions/Sample.md
new file mode 100644
index 0000000000..9c18f989f4
--- /dev/null
+++ b/docs/zh/UserGuide/Operators-Functions/Sample.md
@@ -0,0 +1,408 @@
+<!--
+
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+    
+        http://www.apache.org/licenses/LICENSE-2.0
+    
+    Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.
+
+-->
+
+# 采样函数
+
+## 等数量分桶降采样函数
+
+本函数对输入序列进行等数量分桶采样,即根据用户给定的降采样比例和降采样方法将输入序列按固定点数等分为若干桶。在每个桶内通过给定的采样方法进行采样。
+
+### 等数量分桶随机采样
+
+#### 函数简介
+
+对等数量分桶后,桶内进行随机采样。
+
+| 函数名      | 可接收的输入序列类型                     | 必要的属性参数                               | 输出序列类型     | 功能类型                                             |
+|----------|--------------------------------|---------------------------------------|------------|--------------------------------------------------|
+| EQUAL_SIZE_BUCKET_RANDOM_SAMPLE   | INT32 / INT64 / FLOAT / DOUBLE | 降采样比例 `proportion`,取值范围为`(0, 1]`,默认为`0.1`  | INT32 / INT64 / FLOAT / DOUBLE | 返回符合采样比例的等分桶随机采样                |
+
+#### 使用示例
+
+输入序列:`root.ln.wf01.wt01.temperature`从`0.0-99.0`共`100`条数据。
+
+```
+IoTDB> select temperature from root.ln.wf01.wt01;
++-----------------------------+-----------------------------+
+|                         Time|root.ln.wf01.wt01.temperature|
++-----------------------------+-----------------------------+
+|1970-01-01T08:00:00.000+08:00|                          0.0|
+|1970-01-01T08:00:00.001+08:00|                          1.0|
+|1970-01-01T08:00:00.002+08:00|                          2.0|
+|1970-01-01T08:00:00.003+08:00|                          3.0|
+|1970-01-01T08:00:00.004+08:00|                          4.0|
+|1970-01-01T08:00:00.005+08:00|                          5.0|
+|1970-01-01T08:00:00.006+08:00|                          6.0|
+|1970-01-01T08:00:00.007+08:00|                          7.0|
+|1970-01-01T08:00:00.008+08:00|                          8.0|
+|1970-01-01T08:00:00.009+08:00|                          9.0|
+|1970-01-01T08:00:00.010+08:00|                         10.0|
+|1970-01-01T08:00:00.011+08:00|                         11.0|
+|1970-01-01T08:00:00.012+08:00|                         12.0|
+|.............................|.............................|            
+|1970-01-01T08:00:00.089+08:00|                         89.0|
+|1970-01-01T08:00:00.090+08:00|                         90.0|
+|1970-01-01T08:00:00.091+08:00|                         91.0|
+|1970-01-01T08:00:00.092+08:00|                         92.0|
+|1970-01-01T08:00:00.093+08:00|                         93.0|
+|1970-01-01T08:00:00.094+08:00|                         94.0|
+|1970-01-01T08:00:00.095+08:00|                         95.0|
+|1970-01-01T08:00:00.096+08:00|                         96.0|
+|1970-01-01T08:00:00.097+08:00|                         97.0|
+|1970-01-01T08:00:00.098+08:00|                         98.0|
+|1970-01-01T08:00:00.099+08:00|                         99.0|
++-----------------------------+-----------------------------+
+```
+sql:
+```sql
+select equal_size_bucket_random_sample(temperature,'proportion'='0.1') as random_sample from root.ln.wf01.wt01;
+```
+结果:
+```
++-----------------------------+-------------+
+|                         Time|random_sample|
++-----------------------------+-------------+
+|1970-01-01T08:00:00.007+08:00|          7.0|
+|1970-01-01T08:00:00.014+08:00|         14.0|
+|1970-01-01T08:00:00.020+08:00|         20.0|
+|1970-01-01T08:00:00.035+08:00|         35.0|
+|1970-01-01T08:00:00.047+08:00|         47.0|
+|1970-01-01T08:00:00.059+08:00|         59.0|
+|1970-01-01T08:00:00.063+08:00|         63.0|
+|1970-01-01T08:00:00.079+08:00|         79.0|
+|1970-01-01T08:00:00.086+08:00|         86.0|
+|1970-01-01T08:00:00.096+08:00|         96.0|
++-----------------------------+-------------+
+Total line number = 10
+It costs 0.024s
+```
+
+### 等数量分桶聚合采样
+
+#### 函数简介
+
+采用聚合采样法对输入序列进行采样,用户需要另外提供一个聚合函数参数即
+- `type`:聚合类型,取值为`avg`或`max`或`min`或`sum`或`extreme`或`variance`。在缺省情况下,采用`avg`。其中`extreme`表示等分桶中,绝对值最大的值。`variance`表示采样等分桶中的方差。
+
+每个桶采样输出的时间戳为这个桶第一个点的时间戳
+
+
+| 函数名      | 可接收的输入序列类型                     | 必要的属性参数                               | 输出序列类型     | 功能类型                                             |
+|----------|--------------------------------|---------------------------------------|------------|--------------------------------------------------|
+| EQUAL_SIZE_BUCKET_AGG_SAMPLE   | INT32 / INT64 / FLOAT / DOUBLE | `proportion`取值范围为`(0, 1]`,默认为`0.1`</br>`type`:取值类型有`avg`, `max`, `min`, `sum`, `extreme`, `variance`, 默认为`avg`  | INT32 / INT64 / FLOAT / DOUBLE | 返回符合采样比例的等分桶聚合采样                |
+
+#### 使用示例
+
+输入序列:`root.ln.wf01.wt01.temperature`从`0.0-99.0`共`100`条有序数据,同等分桶随机采样的测试数据。
+
+sql:
+```sql
+select equal_size_bucket_agg_sample(temperature, 'type'='avg','proportion'='0.1') as agg_avg, equal_size_bucket_agg_sample(temperature, 'type'='max','proportion'='0.1') as agg_max, equal_size_bucket_agg_sample(temperature,'type'='min','proportion'='0.1') as agg_min, equal_size_bucket_agg_sample(temperature, 'type'='sum','proportion'='0.1') as agg_sum, equal_size_bucket_agg_sample(temperature, 'type'='extreme','proportion'='0.1') as agg_extreme, equal_size_bucket_agg_sample(temperature, ' [...]
+```
+结果:
+```
++-----------------------------+-----------------+-------+-------+-------+-----------+------------+
+|                         Time|          agg_avg|agg_max|agg_min|agg_sum|agg_extreme|agg_variance|
++-----------------------------+-----------------+-------+-------+-------+-----------+------------+
+|1970-01-01T08:00:00.000+08:00|              4.5|    9.0|    0.0|   45.0|        9.0|        8.25|
+|1970-01-01T08:00:00.010+08:00|             14.5|   19.0|   10.0|  145.0|       19.0|        8.25|
+|1970-01-01T08:00:00.020+08:00|             24.5|   29.0|   20.0|  245.0|       29.0|        8.25|
+|1970-01-01T08:00:00.030+08:00|             34.5|   39.0|   30.0|  345.0|       39.0|        8.25|
+|1970-01-01T08:00:00.040+08:00|             44.5|   49.0|   40.0|  445.0|       49.0|        8.25|
+|1970-01-01T08:00:00.050+08:00|             54.5|   59.0|   50.0|  545.0|       59.0|        8.25|
+|1970-01-01T08:00:00.060+08:00|             64.5|   69.0|   60.0|  645.0|       69.0|        8.25|
+|1970-01-01T08:00:00.070+08:00|74.50000000000001|   79.0|   70.0|  745.0|       79.0|        8.25|
+|1970-01-01T08:00:00.080+08:00|             84.5|   89.0|   80.0|  845.0|       89.0|        8.25|
+|1970-01-01T08:00:00.090+08:00|             94.5|   99.0|   90.0|  945.0|       99.0|        8.25|
++-----------------------------+-----------------+-------+-------+-------+-----------+------------+
+Total line number = 10
+It costs 0.044s
+```
+
+### 等数量分桶 M4 采样
+
+#### 函数简介
+
+采用M4采样法对输入序列进行采样。即对于每个桶采样首、尾、最小和最大值。
+
+| 函数名      | 可接收的输入序列类型                     | 必要的属性参数                               | 输出序列类型     | 功能类型                                             |
+|----------|--------------------------------|---------------------------------------|------------|--------------------------------------------------|
+| EQUAL_SIZE_BUCKET_M4_SAMPLE   | INT32 / INT64 / FLOAT / DOUBLE | `proportion`取值范围为`(0, 1]`,默认为`0.1`| INT32 / INT64 / FLOAT / DOUBLE | 返回符合采样比例的等分桶M4采样                |
+
+#### 使用示例
+
+输入序列:`root.ln.wf01.wt01.temperature`从`0.0-99.0`共`100`条有序数据,同等分桶随机采样的测试数据。
+
+sql:
+```sql
+select equal_size_bucket_m4_sample(temperature, 'proportion'='0.1') as M4_sample from root.ln.wf01.wt01;
+```
+结果:
+```
++-----------------------------+---------+
+|                         Time|M4_sample|
++-----------------------------+---------+
+|1970-01-01T08:00:00.000+08:00|      0.0|
+|1970-01-01T08:00:00.001+08:00|      1.0|
+|1970-01-01T08:00:00.038+08:00|     38.0|
+|1970-01-01T08:00:00.039+08:00|     39.0|
+|1970-01-01T08:00:00.040+08:00|     40.0|
+|1970-01-01T08:00:00.041+08:00|     41.0|
+|1970-01-01T08:00:00.078+08:00|     78.0|
+|1970-01-01T08:00:00.079+08:00|     79.0|
+|1970-01-01T08:00:00.080+08:00|     80.0|
+|1970-01-01T08:00:00.081+08:00|     81.0|
+|1970-01-01T08:00:00.098+08:00|     98.0|
+|1970-01-01T08:00:00.099+08:00|     99.0|
++-----------------------------+---------+
+Total line number = 12
+It costs 0.065s
+```
+
+### 等数量分桶离群值采样
+
+#### 函数简介
+
+本函数对输入序列进行等数量分桶离群值采样,即根据用户给定的降采样比例和桶内采样个数将输入序列按固定点数等分为若干桶,在每个桶内通过给定的离群值采样方法进行采样。
+
+| 函数名      | 可接收的输入序列类型                     | 必要的属性参数                               | 输出序列类型     | 功能类型                                             |
+|----------|--------------------------------|---------------------------------------|------------|--------------------------------------------------|
+| EQUAL_SIZE_BUCKET_OUTLIER_SAMPLE   | INT32 / INT64 / FLOAT / DOUBLE | `proportion`取值范围为`(0, 1]`,默认为`0.1`</br>`type`取值为`avg`或`stendis`或`cos`或`prenextdis`,默认为`avg`</br>`number`取值应大于0,默认`3`| INT32 / INT64 / FLOAT / DOUBLE | 返回符合采样比例和桶内采样个数的等分桶离群值采样                |
+
+参数说明
+- `proportion`: 采样比例
+    - `number`: 每个桶内的采样个数,默认`3`
+- `type`: 离群值采样方法,取值为
+    - `avg`: 取桶内数据点的平均值,并根据采样比例,找到距离均值最远的`top number`个
+    - `stendis`: 取桶内每一个数据点距离桶的首末数据点连成直线的垂直距离,并根据采样比例,找到距离最大的`top number`个
+    - `cos`: 设桶内一个数据点为b,b左边的数据点为a,b右边的数据点为c,则取ab与bc向量的夹角的余弦值,值越小,说明形成的角度越大,越可能是异常值。找到cos值最小的`top number`个
+    - `prenextdis`: 设桶内一个数据点为b,b左边的数据点为a,b右边的数据点为c,则取ab与bc的长度之和作为衡量标准,和越大越可能是异常值,找到最大的`top number`个
+
+#### 使用示例
+
+测试数据:`root.ln.wf01.wt01.temperature`从`0.0-99.0`共`100`条数据,其中为了加入离群值,我们使得个位数为5的值自增100。
+```
+IoTDB> select temperature from root.ln.wf01.wt01;
++-----------------------------+-----------------------------+
+|                         Time|root.ln.wf01.wt01.temperature|
++-----------------------------+-----------------------------+
+|1970-01-01T08:00:00.000+08:00|                          0.0|
+|1970-01-01T08:00:00.001+08:00|                          1.0|
+|1970-01-01T08:00:00.002+08:00|                          2.0|
+|1970-01-01T08:00:00.003+08:00|                          3.0|
+|1970-01-01T08:00:00.004+08:00|                          4.0|
+|1970-01-01T08:00:00.005+08:00|                        105.0|
+|1970-01-01T08:00:00.006+08:00|                          6.0|
+|1970-01-01T08:00:00.007+08:00|                          7.0|
+|1970-01-01T08:00:00.008+08:00|                          8.0|
+|1970-01-01T08:00:00.009+08:00|                          9.0|
+|1970-01-01T08:00:00.010+08:00|                         10.0|
+|1970-01-01T08:00:00.011+08:00|                         11.0|
+|1970-01-01T08:00:00.012+08:00|                         12.0|
+|1970-01-01T08:00:00.013+08:00|                         13.0|
+|1970-01-01T08:00:00.014+08:00|                         14.0|
+|1970-01-01T08:00:00.015+08:00|                        115.0|
+|1970-01-01T08:00:00.016+08:00|                         16.0|
+|.............................|.............................|
+|1970-01-01T08:00:00.092+08:00|                         92.0|
+|1970-01-01T08:00:00.093+08:00|                         93.0|
+|1970-01-01T08:00:00.094+08:00|                         94.0|
+|1970-01-01T08:00:00.095+08:00|                        195.0|
+|1970-01-01T08:00:00.096+08:00|                         96.0|
+|1970-01-01T08:00:00.097+08:00|                         97.0|
+|1970-01-01T08:00:00.098+08:00|                         98.0|
+|1970-01-01T08:00:00.099+08:00|                         99.0|
++-----------------------------+-----------------------------+
+```
+sql:
+```sql
+select equal_size_bucket_outlier_sample(temperature, 'proportion'='0.1', 'type'='avg', 'number'='2') as outlier_avg_sample, equal_size_bucket_outlier_sample(temperature, 'proportion'='0.1', 'type'='stendis', 'number'='2') as outlier_stendis_sample, equal_size_bucket_outlier_sample(temperature, 'proportion'='0.1', 'type'='cos', 'number'='2') as outlier_cos_sample, equal_size_bucket_outlier_sample(temperature, 'proportion'='0.1', 'type'='prenextdis', 'number'='2') as outlier_prenextdis_sam [...]
+```
+结果:
+```
++-----------------------------+------------------+----------------------+------------------+-------------------------+
+|                         Time|outlier_avg_sample|outlier_stendis_sample|outlier_cos_sample|outlier_prenextdis_sample|
++-----------------------------+------------------+----------------------+------------------+-------------------------+
+|1970-01-01T08:00:00.005+08:00|             105.0|                 105.0|             105.0|                    105.0|
+|1970-01-01T08:00:00.015+08:00|             115.0|                 115.0|             115.0|                    115.0|
+|1970-01-01T08:00:00.025+08:00|             125.0|                 125.0|             125.0|                    125.0|
+|1970-01-01T08:00:00.035+08:00|             135.0|                 135.0|             135.0|                    135.0|
+|1970-01-01T08:00:00.045+08:00|             145.0|                 145.0|             145.0|                    145.0|
+|1970-01-01T08:00:00.055+08:00|             155.0|                 155.0|             155.0|                    155.0|
+|1970-01-01T08:00:00.065+08:00|             165.0|                 165.0|             165.0|                    165.0|
+|1970-01-01T08:00:00.075+08:00|             175.0|                 175.0|             175.0|                    175.0|
+|1970-01-01T08:00:00.085+08:00|             185.0|                 185.0|             185.0|                    185.0|
+|1970-01-01T08:00:00.095+08:00|             195.0|                 195.0|             195.0|                    195.0|
++-----------------------------+------------------+----------------------+------------------+-------------------------+
+Total line number = 10
+It costs 0.041s
+```
+
+## M4函数
+
+### 函数简介
+
+M4用于在窗口内采样第一个点(`first`)、最后一个点(`last`)、最小值点(`bottom`)、最大值点(`top`):
+
+-   第一个点是拥有这个窗口内最小时间戳的点;
+-   最后一个点是拥有这个窗口内最大时间戳的点;
+-   最小值点是拥有这个窗口内最小值的点(如果有多个这样的点,M4只返回其中一个);
+-   最大值点是拥有这个窗口内最大值的点(如果有多个这样的点,M4只返回其中一个)。
+
+<img src="https://user-images.githubusercontent.com/33376433/198178733-a0919d17-0663-4672-9c4f-1efad6f463c2.png" alt="image" style="zoom:50%;" />
+
+| 函数名 | 可接收的输入序列类型           | 属性参数                                                     | 输出序列类型                   | 功能类型                                                     |
+| ------ | ------------------------------ | ------------------------------------------------------------ | ------------------------------ | ------------------------------------------------------------ |
+| M4     | INT32 / INT64 / FLOAT / DOUBLE | 包含固定点数的窗口和滑动时间窗口使用不同的属性参数。包含固定点数的窗口使用属性`windowSize`和`slidingStep`。滑动时间窗口使用属性`timeInterval`、`slidingStep`、`displayWindowBegin`和`displayWindowEnd`。更多细节见下文。 | INT32 / INT64 / FLOAT / DOUBLE | 返回每个窗口内的第一个点(`first`)、最后一个点(`last`)、最小值点(`bottom`)、最大值点(`top`)。在一个窗口内的聚合点输出之前,M4会将它们按照时间戳递增排序并且去重。 |
+
+### 属性参数
+
+**(1) 包含固定点数的窗口(SlidingSizeWindowAccessStrategy)使用的属性参数:**
+
++ `windowSize`: 一个窗口内的点数。Int数据类型。必需的属性参数。
++ `slidingStep`: 按照设定的点数来滑动窗口。Int数据类型。可选的属性参数;如果没有设置,默认取值和`windowSize`一样。
+
+<img src="https://user-images.githubusercontent.com/33376433/198181449-00d563c8-7bce-4ecd-a031-ec120ca42c3f.png" alt="image" style="zoom: 50%;" />
+
+*(图片来源: https://iotdb.apache.org/UserGuide/Master/Process-Data/UDF-User-Defined-Function.html#udtf-user-defined-timeseries-generating-function)*
+
+**(2) 滑动时间窗口(SlidingTimeWindowAccessStrategy)使用的属性参数:**
+
++ `timeInterval`: 一个窗口的时间长度。Long数据类型。必需的属性参数。
++ `slidingStep`: 按照设定的时长来滑动窗口。Long数据类型。可选的属性参数;如果没有设置,默认取值和`timeInterval`一样。
++ `displayWindowBegin`: 窗口滑动的起始时间戳位置(包含在内)。Long数据类型。可选的属性参数;如果没有设置,默认取值为Long.MIN_VALUE,意为使用输入的时间序列的第一个点的时间戳作为窗口滑动的起始时间戳位置。
++ `displayWindowEnd`: 结束时间限制(不包含在内;本质上和`WHERE time < displayWindowEnd`起的效果是一样的)。Long数据类型。可选的属性参数;如果没有设置,默认取值为Long.MAX_VALUE,意为除了输入的时间序列自身数据读取完毕之外没有增加额外的结束时间过滤条件限制。
+
+<img src="https://user-images.githubusercontent.com/33376433/198183015-93b56644-3330-4acf-ae9e-d718a02b5f4c.png" alt="groupBy window" style="zoom: 67%;" />
+
+*(图片来源: https://iotdb.apache.org/UserGuide/Master/Query-Data/Aggregate-Query.html#downsampling-aggregate-query)*
+
+### 使用示例
+
+输入的时间序列:
+
+```sql
++-----------------------------+------------------+
+|                         Time|root.vehicle.d1.s1|
++-----------------------------+------------------+
+|1970-01-01T08:00:00.001+08:00|               5.0|
+|1970-01-01T08:00:00.002+08:00|              15.0|
+|1970-01-01T08:00:00.005+08:00|              10.0|
+|1970-01-01T08:00:00.008+08:00|               8.0|
+|1970-01-01T08:00:00.010+08:00|              30.0|
+|1970-01-01T08:00:00.020+08:00|              20.0|
+|1970-01-01T08:00:00.025+08:00|               8.0|
+|1970-01-01T08:00:00.027+08:00|              20.0|
+|1970-01-01T08:00:00.030+08:00|              40.0|
+|1970-01-01T08:00:00.033+08:00|               9.0|
+|1970-01-01T08:00:00.035+08:00|              10.0|
+|1970-01-01T08:00:00.040+08:00|              20.0|
+|1970-01-01T08:00:00.045+08:00|              30.0|
+|1970-01-01T08:00:00.052+08:00|               8.0|
+|1970-01-01T08:00:00.054+08:00|              18.0|
++-----------------------------+------------------+
+```
+
+查询语句1:
+
+```sql
+select M4(s1,'timeInterval'='25','displayWindowBegin'='0','displayWindowEnd'='100') from root.vehicle.d1
+```
+
+输出结果1:
+
+```sql
++-----------------------------+-----------------------------------------------------------------------------------------------+
+|                         Time|M4(root.vehicle.d1.s1, "timeInterval"="25", "displayWindowBegin"="0", "displayWindowEnd"="100")|
++-----------------------------+-----------------------------------------------------------------------------------------------+
+|1970-01-01T08:00:00.001+08:00|                                                                                            5.0|
+|1970-01-01T08:00:00.010+08:00|                                                                                           30.0|
+|1970-01-01T08:00:00.020+08:00|                                                                                           20.0|
+|1970-01-01T08:00:00.025+08:00|                                                                                            8.0|
+|1970-01-01T08:00:00.030+08:00|                                                                                           40.0|
+|1970-01-01T08:00:00.045+08:00|                                                                                           30.0|
+|1970-01-01T08:00:00.052+08:00|                                                                                            8.0|
+|1970-01-01T08:00:00.054+08:00|                                                                                           18.0|
++-----------------------------+-----------------------------------------------------------------------------------------------+
+Total line number = 8
+```
+
+查询语句2:
+
+```sql
+select M4(s1,'windowSize'='10') from root.vehicle.d1
+```
+
+输出结果2:
+
+```sql
++-----------------------------+-----------------------------------------+
+|                         Time|M4(root.vehicle.d1.s1, "windowSize"="10")|
++-----------------------------+-----------------------------------------+
+|1970-01-01T08:00:00.001+08:00|                                      5.0|
+|1970-01-01T08:00:00.030+08:00|                                     40.0|
+|1970-01-01T08:00:00.033+08:00|                                      9.0|
+|1970-01-01T08:00:00.035+08:00|                                     10.0|
+|1970-01-01T08:00:00.045+08:00|                                     30.0|
+|1970-01-01T08:00:00.052+08:00|                                      8.0|
+|1970-01-01T08:00:00.054+08:00|                                     18.0|
++-----------------------------+-----------------------------------------+
+Total line number = 7
+```
+
+### 推荐的使用场景
+
+**(1) 使用场景:保留极端点的降采样**
+
+由于M4为每个窗口聚合其第一个点(`first`)、最后一个点(`last`)、最小值点(`bottom`)、最大值点(`top`),因此M4通常保留了极值点,因此比其他下采样方法(如分段聚合近似 (PAA))能更好地保留模式。如果你想对时间序列进行下采样并且希望保留极值点,你可以试试 M4。
+
+**(2) 使用场景:基于数据缩约的大规模时间序列的零误差双色折线图可视化**
+
+参考论文: ["M4: A Visualization-Oriented Time Series Data Aggregation"](http://www.vldb.org/pvldb/vol7/p797-jugel.pdf).
+
+假设屏幕画布的像素宽乘高是`w*h`,假设时间序列root.vehicle.d1.s1要可视化的时间范围是`[tqs,tqe)`(在这个使用场景里面,需要请你自行将tqe自适应调整使得(tqe-tqs)是w的整数倍),那么落在第i个时间跨度`Ii=[tqs+(tqe-tqs)/w*(i-1),tqs+(tqe-tqs)/w*i)` 内的点将会被画在第i个像素列中,i=1,2,...,w。
+
+于是从可视化驱动的角度出发,使用查询语句:`"select M4(s1,'timeInterval'='(tqe-tqs)/w','displayWindowBegin'='tqs','displayWindowEnd'='tqe') from root.vehicle.d1"`,来采集每个时间跨度内的第一个点(`first`)、最后一个点(`last`)、最小值点(`bottom`)、最大值点(`top`)。最终结果点数不会超过`4*w`个,使用这些聚合点画出来的折线图与使用原始数据画出来的图在像素级别上是完全一致的。
+
+### 和其它SQL的功能比较
+
+| SQL                                               | 是否支持M4聚合                                               | 滑动窗口类型                                      | 示例                                                         | 相关文档                                                     |
+| ------------------------------------------------- | ------------------------------------------------------------ | ------------------------------------------------- | ------------------------------------------------------------ | ------------------------------------------------------------ |
+| 1. 带有Group By子句的内置聚合函数                 | 不支持,缺少`BOTTOM_TIME`和`TOP_TIME`,即缺少最小值点和最大值点的时间戳。 | Time Window                                       | `select count(status), max_value(temperature) from root.ln.wf01.wt01 group by ([2017-11-01 00:00:00, 2017-11-07 23:00:00), 3h, 1d)` | https://iotdb.apache.org/UserGuide/Master/Query-Data/Aggregate-Query.html#built-in-aggregate-functions <br />https://iotdb.apache.org/UserGuide/Master/Query-Data/Aggregate-Query.html#downsampling-aggregate-query |
+| 2. EQUAL_SIZE_BUCKET_M4_SAMPLE (内置UDF)          | 支持*                                                        | Size Window. `windowSize = 4*(int)(1/proportion)` | `select equal_size_bucket_m4_sample(temperature, 'proportion'='0.1') as M4_sample from root.ln.wf01.wt01` | https://iotdb.apache.org/UserGuide/Master/Query-Data/Select-Expression.html#time-series-generating-functions |
+| **3. M4 (内置UDF)**                               | 支持*                                                        | Size Window, Time Window                          | (1) Size Window: `select M4(s1,'windowSize'='10') from root.vehicle.d1` <br />(2) Time Window: `select M4(s1,'timeInterval'='25','displayWindowBegin'='0','displayWindowEnd'='100') from root.vehicle.d1` | 本文档                                                       |
+| 4. 扩展带有Group By子句的内置聚合函数来支持M4聚合 | 未实施                                                       | 未实施                                            | 未实施                                                       | 未实施                                                       |
+
+进一步比较`EQUAL_SIZE_BUCKET_M4_SAMPLE`和`M4`:
+
+**(1) 不同的M4聚合函数定义:**
+
+在每个窗口内,`EQUAL_SIZE_BUCKET_M4_SAMPLE`从排除了第一个点和最后一个点之后剩余的点中提取最小值点和最大值点。
+
+而`M4`则是从窗口内所有点中(包括第一个点和最后一个点)提取最小值点和最大值点,这个定义与元数据中保存的`max_value`和`min_value`的语义更加一致。
+
+值得注意的是,在一个窗口内的聚合点输出之前,`EQUAL_SIZE_BUCKET_M4_SAMPLE`和`M4`都会将它们按照时间戳递增排序并且去重。
+
+**(2) 不同的滑动窗口:**
+
+`EQUAL_SIZE_BUCKET_M4_SAMPLE`使用SlidingSizeWindowAccessStrategy,并且通过采样比例(`proportion`)来间接控制窗口点数(`windowSize`),转换公式是`windowSize = 4*(int)(1/proportion)`。
+
+`M4`支持两种滑动窗口:SlidingSizeWindowAccessStrategy和SlidingTimeWindowAccessStrategy,并且`M4`通过相应的参数直接控制窗口的点数或者时长。
\ No newline at end of file
diff --git a/docs/zh/UserGuide/Operators-Functions/Selection.md b/docs/zh/UserGuide/Operators-Functions/Selection.md
new file mode 100644
index 0000000000..314b81bc28
--- /dev/null
+++ b/docs/zh/UserGuide/Operators-Functions/Selection.md
@@ -0,0 +1,51 @@
+<!--
+
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+    
+        http://www.apache.org/licenses/LICENSE-2.0
+    
+    Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.
+
+-->
+
+## 选择函数
+
+目前 IoTDB 支持如下选择函数:
+
+| 函数名   | 输入序列类型                          | 必要的属性参数                                    | 输出序列类型             | 功能描述                                                     |
+| -------- | ------------------------------------- | ------------------------------------------------- | ------------------------ | ------------------------------------------------------------ |
+| TOP_K    | INT32 / INT64 / FLOAT / DOUBLE / TEXT | `k`: 最多选择的数据点数,必须大于 0 小于等于 1000 | 与输入序列的实际类型一致 | 返回某时间序列中值最大的`k`个数据点。若多于`k`个数据点的值并列最大,则返回时间戳最小的数据点。 |
+| BOTTOM_K | INT32 / INT64 / FLOAT / DOUBLE / TEXT | `k`: 最多选择的数据点数,必须大于 0 小于等于 1000 | 与输入序列的实际类型一致 | 返回某时间序列中值最小的`k`个数据点。若多于`k`个数据点的值并列最小,则返回时间戳最小的数据点。 |
+
+例如:
+
+```   sql
+select s1, top_k(s1, 'k'='2'), bottom_k(s1, 'k'='2') from root.sg1.d2 where time > 2020-12-10T20:36:15.530+08:00;
+```
+
+结果:
+
+``` 
++-----------------------------+--------------------+------------------------------+---------------------------------+
+|                         Time|      root.sg1.d2.s1|top_k(root.sg1.d2.s1, "k"="2")|bottom_k(root.sg1.d2.s1, "k"="2")|
++-----------------------------+--------------------+------------------------------+---------------------------------+
+|2020-12-10T20:36:15.531+08:00| 1531604122307244742|           1531604122307244742|                             null|
+|2020-12-10T20:36:15.532+08:00|-7426070874923281101|                          null|                             null|
+|2020-12-10T20:36:15.533+08:00|-7162825364312197604|          -7162825364312197604|                             null|
+|2020-12-10T20:36:15.534+08:00|-8581625725655917595|                          null|             -8581625725655917595|
+|2020-12-10T20:36:15.535+08:00|-7667364751255535391|                          null|             -7667364751255535391|
++-----------------------------+--------------------+------------------------------+---------------------------------+
+Total line number = 5
+It costs 0.006s
+```
diff --git a/docs/zh/UserGuide/UDF-Library/Series-Discovery.md b/docs/zh/UserGuide/Operators-Functions/Series-Discovery.md
similarity index 89%
rename from docs/zh/UserGuide/UDF-Library/Series-Discovery.md
rename to docs/zh/UserGuide/Operators-Functions/Series-Discovery.md
index 045fb952ea..0a1d183992 100644
--- a/docs/zh/UserGuide/UDF-Library/Series-Discovery.md
+++ b/docs/zh/UserGuide/Operators-Functions/Series-Discovery.md
@@ -1,21 +1,21 @@
 <!--
 
-​    Licensed to the Apache Software Foundation (ASF) under one
-​    or more contributor license agreements.  See the NOTICE file
-​    distributed with this work for additional information
-​    regarding copyright ownership.  The ASF licenses this file
-​    to you under the Apache License, Version 2.0 (the
-​    "License"); you may not use this file except in compliance
-​    with the License.  You may obtain a copy of the License at
-​    
-​        http://www.apache.org/licenses/LICENSE-2.0
-​    
-​    Unless required by applicable law or agreed to in writing,
-​    software distributed under the License is distributed on an
-​    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-​    KIND, either express or implied.  See the License for the
-​    specific language governing permissions and limitations
-​    under the License.
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+    
+        http://www.apache.org/licenses/LICENSE-2.0
+    
+    Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.
 
 -->
 
diff --git a/docs/zh/UserGuide/UDF-Library/String-Processing.md b/docs/zh/UserGuide/Operators-Functions/String.md
similarity index 89%
rename from docs/zh/UserGuide/UDF-Library/String-Processing.md
rename to docs/zh/UserGuide/Operators-Functions/String.md
index 4ff0d7c2d6..935acd9411 100644
--- a/docs/zh/UserGuide/UDF-Library/String-Processing.md
+++ b/docs/zh/UserGuide/Operators-Functions/String.md
@@ -1,26 +1,96 @@
 <!--
 
-​    Licensed to the Apache Software Foundation (ASF) under one
-​    or more contributor license agreements.  See the NOTICE file
-​    distributed with this work for additional information
-​    regarding copyright ownership.  The ASF licenses this file
-​    to you under the Apache License, Version 2.0 (the
-​    "License"); you may not use this file except in compliance
-​    with the License.  You may obtain a copy of the License at
-​    
-​        http://www.apache.org/licenses/LICENSE-2.0
-​    
-​    Unless required by applicable law or agreed to in writing,
-​    software distributed under the License is distributed on an
-​    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-​    KIND, either express or implied.  See the License for the
-​    specific language governing permissions and limitations
-​    under the License.
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+    
+        http://www.apache.org/licenses/LICENSE-2.0
+    
+    Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.
 
 -->
 
 # 字符串处理
 
+## STRING_CONTAINS
+
+### 函数简介
+
+本函数判断字符串中是否存在子串 `s`
+
+**函数名:** STRING_CONTAINS
+
+**输入序列:** 仅支持单个输入序列,类型为 TEXT。
+
+**参数:**
++ `s`: 待搜寻的字符串。
+
+**输出序列:** 输出单个序列,类型为 BOOLEAN。
+
+### 使用示例
+
+```   sql
+select s1, string_contains(s1, 's'='warn') from root.sg1.d4;
+```
+
+结果:
+
+``` 
++-----------------------------+--------------+-------------------------------------------+
+|                         Time|root.sg1.d4.s1|string_contains(root.sg1.d4.s1, "s"="warn")|
++-----------------------------+--------------+-------------------------------------------+
+|1970-01-01T08:00:00.001+08:00|    warn:-8721|                                       true|
+|1970-01-01T08:00:00.002+08:00|  error:-37229|                                      false|
+|1970-01-01T08:00:00.003+08:00|     warn:1731|                                       true|
++-----------------------------+--------------+-------------------------------------------+
+Total line number = 3
+It costs 0.007s
+```
+
+## STRING_MATCHES
+
+### 函数简介
+
+本函数判断字符串是否能够被正则表达式`regex`匹配。
+
+**函数名:** STRING_MATCHES
+
+**输入序列:** 仅支持单个输入序列,类型为 TEXT。
+
+**参数:**
++ `regex`: Java 标准库风格的正则表达式。
+
+**输出序列:** 输出单个序列,类型为 BOOLEAN。
+
+### 使用示例
+
+```   sql
+select s1, string_matches(s1, 'regex'='[^\\s]+37229') from root.sg1.d4;
+```
+
+结果:
+
+``` 
++-----------------------------+--------------+------------------------------------------------------+
+|                         Time|root.sg1.d4.s1|string_matches(root.sg1.d4.s1, "regex"="[^\\s]+37229")|
++-----------------------------+--------------+------------------------------------------------------+
+|1970-01-01T08:00:00.001+08:00|    warn:-8721|                                                 false|
+|1970-01-01T08:00:00.002+08:00|  error:-37229|                                                  true|
+|1970-01-01T08:00:00.003+08:00|     warn:1731|                                                 false|
++-----------------------------+--------------+------------------------------------------------------+
+Total line number = 3
+It costs 0.007s
+```
+
 ## Length
 
 ### 函数简介
@@ -783,4 +853,4 @@ select regexsplit(s1, "regex"=",", "index"="3") from root.test.d1
 |2021-01-01T00:00:04.000+08:00|                                                    A|
 |2021-01-01T00:00:05.000+08:00|                                                    B|
 +-----------------------------+-----------------------------------------------------+
-```
\ No newline at end of file
+```
diff --git a/docs/zh/UserGuide/UDF-Library/Series-Processing.md b/docs/zh/UserGuide/Operators-Functions/Time-Series.md
similarity index 83%
rename from docs/zh/UserGuide/UDF-Library/Series-Processing.md
rename to docs/zh/UserGuide/Operators-Functions/Time-Series.md
index c84c21b14b..777fe86122 100644
--- a/docs/zh/UserGuide/UDF-Library/Series-Processing.md
+++ b/docs/zh/UserGuide/Operators-Functions/Time-Series.md
@@ -1,25 +1,25 @@
 <!--
 
-​    Licensed to the Apache Software Foundation (ASF) under one
-​    or more contributor license agreements.  See the NOTICE file
-​    distributed with this work for additional information
-​    regarding copyright ownership.  The ASF licenses this file
-​    to you under the Apache License, Version 2.0 (the
-​    "License"); you may not use this file except in compliance
-​    with the License.  You may obtain a copy of the License at
-​    
-​        http://www.apache.org/licenses/LICENSE-2.0
-​    
-​    Unless required by applicable law or agreed to in writing,
-​    software distributed under the License is distributed on an
-​    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-​    KIND, either express or implied.  See the License for the
-​    specific language governing permissions and limitations
-​    under the License.
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+    
+        http://www.apache.org/licenses/LICENSE-2.0
+    
+    Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.
 
 -->
 
-# 序列处理
+# 时间序列处理
 
 ## CHANGE_POINTS
 
@@ -66,4 +66,4 @@ select change_points(s1), change_points(s2), change_points(s3), change_points(s4
 |1970-01-01T08:00:00.003+08:00|                                     false|                                         1|                                      null|                                       1.0|                                      null|                                      null|
 |1970-01-01T08:00:00.004+08:00|                                      true|                                      null|                                         3|                                      null|                                      null|                                    1test1|
 +-----------------------------+------------------------------------------+------------------------------------------+------------------------------------------+------------------------------------------+------------------------------------------+------------------------------------------+
-```
\ No newline at end of file
+```
diff --git a/docs/zh/UserGuide/Process-Data/UDF-User-Defined-Function.md b/docs/zh/UserGuide/Operators-Functions/User-Defined-Function.md
similarity index 99%
rename from docs/zh/UserGuide/Process-Data/UDF-User-Defined-Function.md
rename to docs/zh/UserGuide/Operators-Functions/User-Defined-Function.md
index 2e38fd0250..c288167306 100644
--- a/docs/zh/UserGuide/Process-Data/UDF-User-Defined-Function.md
+++ b/docs/zh/UserGuide/Operators-Functions/User-Defined-Function.md
@@ -19,7 +19,7 @@
 
 -->
 
-# 用户定义函数 (UDF)
+# 用户自定义函数
 
 UDF(User Defined Function)即用户自定义函数。IoTDB 提供多种内建函数来满足您的计算需求,同时您还可以通过创建自定义函数来满足更多的计算需求。
 
@@ -36,7 +36,7 @@ IoTDB 支持两种类型的 UDF 函数,如下表所示。
 
 ## UDF 依赖
 
-如果您使用 [Maven](http://search.maven.org/),可以从 [Maven 库](http://search.maven.org/) 中搜索下面示例中的依赖。请注意选择和目标 IoTDB 服务器版本相同的依赖版本。
+如果您使用 [Maven](http://search.maven.org/) ,可以从 [Maven 库](http://search.maven.org/) 中搜索下面示例中的依赖。请注意选择和目标 IoTDB 服务器版本相同的依赖版本。
 
 ``` xml
 <dependency>
diff --git a/docs/zh/UserGuide/Operators-Functions/Variation-Trend.md b/docs/zh/UserGuide/Operators-Functions/Variation-Trend.md
new file mode 100644
index 0000000000..04ac9853ac
--- /dev/null
+++ b/docs/zh/UserGuide/Operators-Functions/Variation-Trend.md
@@ -0,0 +1,54 @@
+<!--
+
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+    
+        http://www.apache.org/licenses/LICENSE-2.0
+    
+    Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.
+
+-->
+
+# 趋势计算函数
+
+目前 IoTDB 支持如下趋势计算函数:
+
+| 函数名                  | 输入序列类型                                    | 输出序列类型             | 功能描述                                                     |
+| ----------------------- | ----------------------------------------------- | ------------------------ | ------------------------------------------------------------ |
+| TIME_DIFFERENCE         | INT32 / INT64 / FLOAT / DOUBLE / BOOLEAN / TEXT | INT64                    | 统计序列中某数据点的时间戳与前一数据点时间戳的差。范围内第一个数据点没有对应的结果输出。 |
+| DIFFERENCE              | INT32 / INT64 / FLOAT / DOUBLE                  | 与输入序列的实际类型一致 | 统计序列中某数据点的值与前一数据点的值的差。范围内第一个数据点没有对应的结果输出。 |
+| NON_NEGATIVE_DIFFERENCE | INT32 / INT64 / FLOAT / DOUBLE                  | 与输入序列的实际类型一致 | 统计序列中某数据点的值与前一数据点的值的差的绝对值。范围内第一个数据点没有对应的结果输出。 |
+| DERIVATIVE              | INT32 / INT64 / FLOAT / DOUBLE                  | DOUBLE                   | 统计序列中某数据点相对于前一数据点的变化率,数量上等同于 DIFFERENCE /  TIME_DIFFERENCE。范围内第一个数据点没有对应的结果输出。 |
+| NON_NEGATIVE_DERIVATIVE | INT32 / INT64 / FLOAT / DOUBLE                  | DOUBLE                   | 统计序列中某数据点相对于前一数据点的变化率的绝对值,数量上等同于 NON_NEGATIVE_DIFFERENCE /  TIME_DIFFERENCE。范围内第一个数据点没有对应的结果输出。 |
+
+例如:
+
+```   sql
+select s1, time_difference(s1), difference(s1), non_negative_difference(s1), derivative(s1), non_negative_derivative(s1) from root.sg1.d1 limit 5 offset 1000; 
+```
+
+结果:
+
+``` 
++-----------------------------+-------------------+-------------------------------+--------------------------+---------------------------------------+--------------------------+---------------------------------------+
+|                         Time|     root.sg1.d1.s1|time_difference(root.sg1.d1.s1)|difference(root.sg1.d1.s1)|non_negative_difference(root.sg1.d1.s1)|derivative(root.sg1.d1.s1)|non_negative_derivative(root.sg1.d1.s1)|
++-----------------------------+-------------------+-------------------------------+--------------------------+---------------------------------------+--------------------------+---------------------------------------+
+|2020-12-10T17:11:49.037+08:00|7360723084922759782|                              1|      -8431715764844238876|                    8431715764844238876|    -8.4317157648442388E18|                  8.4317157648442388E18|
+|2020-12-10T17:11:49.038+08:00|4377791063319964531|                              1|      -2982932021602795251|                    2982932021602795251|     -2.982932021602795E18|                   2.982932021602795E18|
+|2020-12-10T17:11:49.039+08:00|7972485567734642915|                              1|       3594694504414678384|                    3594694504414678384|     3.5946945044146785E18|                  3.5946945044146785E18|
+|2020-12-10T17:11:49.040+08:00|2508858212791964081|                              1|      -5463627354942678834|                    5463627354942678834|     -5.463627354942679E18|                   5.463627354942679E18|
+|2020-12-10T17:11:49.041+08:00|2817297431185141819|                              1|        308439218393177738|                     308439218393177738|     3.0843921839317773E17|                  3.0843921839317773E17|
++-----------------------------+-------------------+-------------------------------+--------------------------+---------------------------------------+--------------------------+---------------------------------------+
+Total line number = 5
+It costs 0.014s
+```
diff --git a/docs/zh/UserGuide/Query-Data/Align-By.md b/docs/zh/UserGuide/Query-Data/Align-By.md
new file mode 100644
index 0000000000..d2747c6afe
--- /dev/null
+++ b/docs/zh/UserGuide/Query-Data/Align-By.md
@@ -0,0 +1,61 @@
+<!--
+
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+    
+        http://www.apache.org/licenses/LICENSE-2.0
+    
+    Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.
+
+-->
+
+# 查询对齐模式
+
+在 IoTDB 中,查询结果集**默认按照时间对齐**,包含一列时间列和若干个值列,每一行数据各列的时间戳相同。
+
+除按照时间对齐外,还支持以下对齐模式:
+
+- 按设备对齐 `ALIGN BY DEVICE`
+
+## 按设备对齐
+
+在按设备对齐模式下,设备名会单独作为一列出现,查询结果集包含一列时间列、一列设备列和若干个值列。如果 `SELECT` 子句中选择了 `N` 列,则结果集包含 `N + 2` 列(时间列和设备名字列)。
+
+在默认情况下,结果集按照 `Device` 进行字典序排序,在每个 `Device` 内按照 `Time` 列升序排序。
+
+当查询多个设备时,要求设备之间同名的列数据类型相同。
+
+为便于理解,可以按照关系模型进行对应。设备可以视为关系模型中的表,选择的列可以视为表中的列,`Time + Device` 看做其主键。
+
+**示例:**
+
+```sql
+select * from root.ln.** where time <= 2017-11-01T00:01:00 align by device;
+```
+
+执行如下:
+
+```
++-----------------------------+-----------------+-----------+------+--------+
+|                         Time|           Device|temperature|status|hardware|
++-----------------------------+-----------------+-----------+------+--------+
+|2017-11-01T00:00:00.000+08:00|root.ln.wf01.wt01|      25.96|  true|    null|
+|2017-11-01T00:01:00.000+08:00|root.ln.wf01.wt01|      24.36|  true|    null|
+|1970-01-01T08:00:00.001+08:00|root.ln.wf02.wt02|       null|  true|      v1|
+|1970-01-01T08:00:00.002+08:00|root.ln.wf02.wt02|       null| false|      v2|
+|2017-11-01T00:00:00.000+08:00|root.ln.wf02.wt02|       null|  true|      v2|
+|2017-11-01T00:01:00.000+08:00|root.ln.wf02.wt02|       null|  true|      v2|
++-----------------------------+-----------------+-----------+------+--------+
+Total line number = 6
+It costs 0.012s
+```
diff --git a/docs/zh/UserGuide/Process-Data/Continuous-Query.md b/docs/zh/UserGuide/Query-Data/Continuous-Query.md
similarity index 100%
rename from docs/zh/UserGuide/Process-Data/Continuous-Query.md
rename to docs/zh/UserGuide/Query-Data/Continuous-Query.md
diff --git a/docs/zh/UserGuide/Query-Data/Fill-Null-Value.md b/docs/zh/UserGuide/Query-Data/Fill.md
similarity index 60%
rename from docs/zh/UserGuide/Query-Data/Fill-Null-Value.md
rename to docs/zh/UserGuide/Query-Data/Fill.md
index 6ee476972d..d6b4d35a5e 100644
--- a/docs/zh/UserGuide/Query-Data/Fill-Null-Value.md
+++ b/docs/zh/UserGuide/Query-Data/Fill.md
@@ -19,45 +19,56 @@
 
 -->
 
+# 结果集补空值
 
-# 查询补空值
+## 功能介绍
 
-当执行一些查询时,结果集的某行某列可能没有数据,则此位置结果为空,但这种空值不利于进行数据可视化展示和分析,需要对空值进行填补。
+当执行一些数据查询时,结果集的某行某列可能没有数据,则此位置结果为空,但这种空值不利于进行数据可视化展示和分析,需要对空值进行填充。
 
-查询补空值允许用户按照特定的方法对任何查询的结果填充空值,如取前一个不为空的值,或线性插值。补空值之后的查询结果能更好地反映数据分布,有利于用户进行数据分析。
+在 IoTDB 中,用户可以使用 `FILL` 子句指定数据缺失情况下的填充模式,允许用户按照特定的方法对任何查询的结果集填充空值,如取前一个不为空的值、线性插值等。
 
-在 IoTDB 中,用户可以使用 FILL 子句指定数据缺失的情况下的填充模式。如果查询点不为空,则填充功能将不起作用。
+## 语法定义
 
-## 填充方法
+**`FILL` 子句的语法定义如下:**
 
-IoTDB 目前支持  `previous` , `linear`,  `value` 三种空值填充方式,数据类型和支持的填充方法如下表所示:
+```sql
+FILL '(' PREVIOUS | LINEAR | constant ')'
+```
 
-| 数据类型 | 支持的填充方法                 |
-| :------- |:------------------------|
-| boolean  | previous, value         |
-| int32    | previous, linear, value |
-| int64    | previous, linear, value |
-| float    | previous, linear, value |
-| double   | previous, linear, value |
-| text     | previous, value         |
+**注意:** 
+- 在 `Fill` 语句中只能指定一种填充方法,该方法作用于结果集的全部列。
+- 空值填充不兼容 0.13 版本及以前的语法(即不支持 `FILL((<data_type>[<fill_method>(, <before_range>, <after_range>)?])+)`)
 
-> 注意:在 Fill 语句中只能指定一种填充方法。空值填充不兼容 0.13 版本及以前的语法(即 fill((<data_type>[<fill_method>(, <before_range>, <after_range>)?])+))
+## 填充方式
 
-### Previous 填充
+**IoTDB 目前支持以下三种空值填充方式:**
 
-当查询的时间戳下数据为空时,将使用前一个时间戳的值来填充空白。 语法定义如下:
+- `PREVIOUS` 填充:使用该列前一个非空值进行填充。
+- `LINEAR` 填充:使用该列前一个非空值和下一个非空值的线性插值进行填充。
+- 常量填充:使用指定常量填充。
 
+**各数据类型支持的填充方法如下表所示:**
 
-```sql
-fill(previous)
-```
+| 数据类型 | 支持的填充方法              |
+| :------- |:------------------------|
+| BOOLEAN  | `PREVIOUS`、常量       |
+| INT32    | `PREVIOUS`、`LINEAR`、常量 |
+| INT64    | `PREVIOUS`、`LINEAR`、常量 |
+| FLOAT    | `PREVIOUS`、`LINEAR`、常量 |
+| DOUBLE   | `PREVIOUS`、`LINEAR`、常量 |
+| TEXT     | `PREVIOUS`、常量         |
+
+**注意:** 对于数据类型不支持指定填充方法的列,既不会填充它,也不会报错,只是让那一列保持原样。
 
-在这里,我们举一个使用 Previous 方法填充空值的示例。 SQL 语句如下:
+**下面通过举例进一步说明。**
+
+如果我们不使用任何填充方式:
 
 ```sql
-select temperature, status from root.sgcc.wf03.wt01 where time >= 2017-11-01T16:37:00.000 and time <= 2017-11-01T16:40:00.000
+select temperature, status from root.sgcc.wf03.wt01 where time >= 2017-11-01T16:37:00.000 and time <= 2017-11-01T16:40:00.000;
 ```
-如果我们不使用任何填充方式,原始的查询结果如下:
+
+查询结果如下:
 
 ```
 +-----------------------------+-------------------------------+--------------------------+
@@ -74,12 +85,19 @@ select temperature, status from root.sgcc.wf03.wt01 where time >= 2017-11-01T16:
 Total line number = 4
 ```
 
-如果我们使用previous填充, SQL 语句如下:
+### `PREVIOUS` 填充
+
+**对于查询结果集中的空值,使用该列前一个非空值进行填充。**
+
+**注意:** 如果结果集的某一列第一个值就为空,则不会填充该值,直到遇到该列第一个非空值为止。
+
+例如,使用 `PREVIOUS` 填充,SQL 语句如下:
+
 ```sql
-select temperature from root.sgcc.wf03.wt01 where time >= 2017-11-01T16:37:00.000 and time <= 2017-11-01T16:40:00.000 fill(previous)
+select temperature, status from root.sgcc.wf03.wt01 where time >= 2017-11-01T16:37:00.000 and time <= 2017-11-01T16:40:00.000 fill(previous);
 ```
 
-previous填充后的结果如下:
+`PREVIOUS` 填充后的结果如下:
 
 ```
 +-----------------------------+-------------------------------+--------------------------+
@@ -96,24 +114,21 @@ previous填充后的结果如下:
 Total line number = 4
 ```
 
-> 注意:如果结果集的某一列第一个值就位空,那我们不会填充这一列,直到遇到这一列第一个不为空的值为止。
+### `LINEAR` 填充
 
+**对于查询结果集中的空值,使用该列前一个非空值和下一个非空值的线性插值进行填充。** 
 
-### Linear 填充
+**注意:** 
+- 如果某个值之前的所有值都为空,或者某个值之后的所有值都为空,则不会填充该值。
+- 如果某列的数据类型为boolean/text,我们既不会填充它,也不会报错,只是让那一列保持原样。
 
-当查询的时间戳下数据为空时,将使用前一个和下一个时间戳的值来填充空白。 语法定义如下:
+例如,使用 `LINEAR` 填充,SQL 语句如下:
 
 ```sql
-fill(linear)
+select temperature, status from root.sgcc.wf03.wt01 where time >= 2017-11-01T16:37:00.000 and time <= 2017-11-01T16:40:00.000 fill(linear);
 ```
-
-在这里,我们举一个使用线性方法填充空值的示例。 SQL 语句如下:
-
-```sql
-select temperature from root.sgcc.wf03.wt01 where time >= 2017-11-01T16:37:00.000 and time <= 2017-11-01T16:40:00.000 fill(linear)
-```
-
-线性填充后的结果如下:
+ 
+`LINEAR` 填充后的结果如下:
 
 ```
 +-----------------------------+-------------------------------+--------------------------+
@@ -130,18 +145,28 @@ select temperature from root.sgcc.wf03.wt01 where time >= 2017-11-01T16:37:00.00
 Total line number = 4
 ```
 
-> 注意:如果某个值之前的所有值都为空,或者某个值之后的所有值都为空,我们不会填充该值。
-> 注意:如果某列的数据类型为boolean/text,我们既不会填充它,也不会报错,只是让那一列保持原样。
+### 常量填充
+
+**对于查询结果集中的空值,使用指定常量填充。**
 
-### Value 填充
+**注意:**
+- 如果某列数据类型与常量类型不兼容,既不填充该列,也不报错,将该列保持原样。对于常量兼容的数据类型,如下表所示:
 
-当查询的时间戳下数据为空时,将使用给定的值来填充空白。语法定义如下:
+   | 常量类型 | 能够填充的序列数据类型 |
+   |:------ |:------------------ |
+   | `BOOLEAN` | `BOOLEAN` `TEXT` |
+   | `INT64` | `INT32` `INT64` `FLOAT` `DOUBLE` `TEXT` |
+   | `DOUBLE` | `FLOAT` `DOUBLE` `TEXT` |
+   | `TEXT` | `TEXT` |
+- 当常量值大于 `INT32` 所能表示的最大值时,对于 `INT32` 类型的列,既不填充该列,也不报错,将该列保持原样。
+
+例如,使用 `FLOAT` 类型的常量填充,SQL 语句如下:
 
 ```sql
-select temperature from root.sgcc.wf03.wt01 where time = 2017-11-01T16:37:50.000 fill(2.0)
+select temperature, status from root.sgcc.wf03.wt01 where time >= 2017-11-01T16:37:00.000 and time <= 2017-11-01T16:40:00.000 fill(2.0);
 ```
 
-使用float类型的常量填充后的结果如下:
+`FLOAT` 类型的常量填充后的结果如下:
 
 ```
 +-----------------------------+-------------------------------+--------------------------+
@@ -158,11 +183,13 @@ select temperature from root.sgcc.wf03.wt01 where time = 2017-11-01T16:37:50.000
 Total line number = 4
 ```
 
+再比如,使用 `BOOLEAN` 类型的常量填充,SQL 语句如下:
+
 ```sql
-select temperature from root.sgcc.wf03.wt01 where time = 2017-11-01T16:37:50.000 fill(true)
+select temperature, status from root.sgcc.wf03.wt01 where time >= 2017-11-01T16:37:00.000 and time <= 2017-11-01T16:40:00.000 fill(true);
 ```
 
-使用boolean类型的常量填充后的结果如下:
+`BOOLEAN` 类型的常量填充后的结果如下:
 
 ```
 +-----------------------------+-------------------------------+--------------------------+
@@ -177,17 +204,4 @@ select temperature from root.sgcc.wf03.wt01 where time = 2017-11-01T16:37:50.000
 |2017-11-01T16:40:00.000+08:00|                          23.43|                      true|
 +-----------------------------+-------------------------------+--------------------------+
 Total line number = 4
-```
-
-> 注意:当我们使用常量填充时,如果某列数据类型与常量类型不兼容,我们既不填充该列,也不报错,将该列保持原样。
-> 注意:当常量值大于int32所能表示的最大值时,对于int32类型的列,我们既不填充该列,也不报错,将该列保持原样。
-
-#### 常量类型兼容性
-
-| 常量类型      | 能够填充的数据类型                |
-|:----------|:----------------------------------|
-| boolean   | boolean, text                     |
-| int64     | int32, int64, float, double, text |
-| double    | float, double, text               |
-| text      | text                              |
-| </center> |                                   |
+```
\ No newline at end of file
diff --git a/docs/zh/UserGuide/Query-Data/Aggregate-Query.md b/docs/zh/UserGuide/Query-Data/Group-By.md
similarity index 81%
rename from docs/zh/UserGuide/Query-Data/Aggregate-Query.md
rename to docs/zh/UserGuide/Query-Data/Group-By.md
index 0a2094cb1b..2061098553 100644
--- a/docs/zh/UserGuide/Query-Data/Aggregate-Query.md
+++ b/docs/zh/UserGuide/Query-Data/Group-By.md
@@ -19,155 +19,12 @@
 
 -->
 
-# 聚合查询
-
-> 注意:聚合查询和原始数据查询不能混合使用。下列语句是不支持的:
->
-> ```sql
-> select a, count(a) from root.sg
-> select sin(a), count(a) from root.sg
-> select a, count(a) from root.sg group by ([10,100),10ms)
-> ```
-
-## 内置聚合函数
-
-IoTDB 支持的聚合函数如下:
-
-| 函数名      | 功能描述                                                     | 允许的输入类型           | 输出类型       |
-| ----------- | ------------------------------------------------------------ | ------------------------ | -------------- |
-| SUM         | 求和。                                                       | INT32 INT64 FLOAT DOUBLE | DOUBLE         |
-| COUNT       | 计算数据点数。                                               | 所有类型                 | INT            |
-| AVG         | 求平均值。                                                   | INT32 INT64 FLOAT DOUBLE | DOUBLE         |
-| EXTREME     | 求具有最大绝对值的值。如果正值和负值的最大绝对值相等,则返回正值。 | INT32 INT64 FLOAT DOUBLE | 与输入类型一致 |
-| MAX_VALUE   | 求最大值。                                                   | INT32 INT64 FLOAT DOUBLE | 与输入类型一致 |
-| MIN_VALUE   | 求最小值。                                                   | INT32 INT64 FLOAT DOUBLE | 与输入类型一致 |
-| FIRST_VALUE | 求时间戳最小的值。                                           | 所有类型                 | 与输入类型一致 |
-| LAST_VALUE  | 求时间戳最大的值。                                           | 所有类型                 | 与输入类型一致 |
-| MAX_TIME    | 求最大时间戳。                                               | 所有类型                 | Timestamp      |
-| MIN_TIME    | 求最小时间戳。                                               | 所有类型                 | Timestamp      |
-
-**示例:** 统计总点数
-
-```sql
-select count(status) from root.ln.wf01.wt01;
-```
-结果:
-
-```
-+-------------------------------+
-|count(root.ln.wf01.wt01.status)|
-+-------------------------------+
-|                          10080|
-+-------------------------------+
-Total line number = 1
-It costs 0.016s
-```
-
-## 分层聚合查询
-
-在时间序列层级结构中,分层聚合查询用于**对某一层级下同名的序列进行聚合查询**。 
-
-- 使用 `GROUP BY LEVEL = INT` 来指定需要聚合的层级,并约定 `ROOT` 为第 0 层。若统计 "root.ln" 下所有序列则需指定 level 为 1。
-- 分层聚合查询支持使用所有内置聚合函数。对于 `sum`,`avg`,`min_value`, `max_value`, `extreme` 五种聚合函数,需保证所有聚合的时间序列数据类型相同。其他聚合函数没有此限制。
-
-**示例1:** 不同 database 下均存在名为 status 的序列, 如 "root.ln.wf01.wt01.status", "root.ln.wf02.wt02.status", 以及 "root.sgcc.wf03.wt01.status", 如果需要统计不同 database 下 status 序列的数据点个数,使用以下查询:
-
-```sql
-select count(status) from root.** group by level = 1
-```
-
-运行结果为:
-
-```
-+-------------------------+---------------------------+
-|count(root.ln.*.*.status)|count(root.sgcc.*.*.status)|
-+-------------------------+---------------------------+
-|                    20160|                      10080|
-+-------------------------+---------------------------+
-Total line number = 1
-It costs 0.003s
-```
-
-**示例2:** 统计不同设备下 status 序列的数据点个数,可以规定 level = 3,
-
-```sql
-select count(status) from root.** group by level = 3
-```
-
-运行结果为:
-
-```
-+---------------------------+---------------------------+
-|count(root.*.*.wt01.status)|count(root.*.*.wt02.status)|
-+---------------------------+---------------------------+
-|                      20160|                      10080|
-+---------------------------+---------------------------+
-Total line number = 1
-It costs 0.003s
-```
-
-注意,这时会将 database `ln` 和 `sgcc` 下名为 `wt01` 的设备视为同名设备聚合在一起。
-
-**示例3:** 统计不同 database 下的不同设备中 status 序列的数据点个数,可以使用以下查询:
-
-```sql
-select count(status) from root.** group by level = 1, 3
-```
-
-运行结果为:
-
-```
-+----------------------------+----------------------------+------------------------------+
-|count(root.ln.*.wt01.status)|count(root.ln.*.wt02.status)|count(root.sgcc.*.wt01.status)|
-+----------------------------+----------------------------+------------------------------+
-|                       10080|                       10080|                         10080|
-+----------------------------+----------------------------+------------------------------+
-Total line number = 1
-It costs 0.003s
-```
-
-**示例4:** 查询所有序列下温度传感器 temperature 的最大值,可以使用下列查询语句:
-
-```sql
-select max_value(temperature) from root.** group by level = 0
-```
-
-运行结果:
-
-```
-+---------------------------------+
-|max_value(root.*.*.*.temperature)|
-+---------------------------------+
-|                             26.0|
-+---------------------------------+
-Total line number = 1
-It costs 0.013s
-```
-
-**示例5:** 上面的查询都是针对某一个传感器,特别地,**如果想要查询某一层级下所有传感器拥有的总数据点数,则需要显式规定测点为 `*`**
-
-```sql
-select count(*) from root.ln.** group by level = 2
-```
-
-运行结果:
-
-```
-+----------------------+----------------------+
-|count(root.*.wf01.*.*)|count(root.*.wf02.*.*)|
-+----------------------+----------------------+
-|                 20160|                 20160|
-+----------------------+----------------------+
-Total line number = 1
-It costs 0.013s
-```
+# 分段分组聚合
 
 ## 时间区间分段聚合
 
 分段聚合是一种时序数据典型的查询方式,数据以高频进行采集,需要按照一定的时间间隔进行聚合计算,如计算每天的平均气温,需要将气温的序列按天进行分段,然后计算平均值。
 
-降采样查询是指使用比数据采集的时间频率更低的频率进行的一种查询方式,是分段聚合的一种特例。例如,数据采集的频率是一秒,想按照1分钟对数据进行展示,则需要使用降采样查询。
-
 在 IoTDB 中,聚合查询可以通过 `GROUP BY` 子句指定按照时间区间分段聚合。用户可以指定聚合的时间间隔和滑动步长,相关参数如下:
 
 * 参数 1:时间轴显示时间窗口大小
@@ -396,9 +253,9 @@ Total line number = 7
 It costs 0.004s
 ```
 
-## 时间区间和路径层级混合聚合查询
+### 与分组聚合混合使用
 
-除此之外,还可以通过定义 LEVEL 来统计指定层级下的数据点个数。
+通过定义 LEVEL 来统计指定层级下的数据点个数。
 
 例如:
 
@@ -448,9 +305,108 @@ Total line number = 7
 It costs 0.004s
 ```
 
-## 标签聚合查询
+## 路径层级分组聚合
+
+在时间序列层级结构中,分层聚合查询用于**对某一层级下同名的序列进行聚合查询**。 
+
+- 使用 `GROUP BY LEVEL = INT` 来指定需要聚合的层级,并约定 `ROOT` 为第 0 层。若统计 "root.ln" 下所有序列则需指定 level 为 1。
+- 分层聚合查询支持使用所有内置聚合函数。对于 `sum`,`avg`,`min_value`, `max_value`, `extreme` 五种聚合函数,需保证所有聚合的时间序列数据类型相同。其他聚合函数没有此限制。
 
-IoTDB 还支持通过 `GROUP BY TAGS` 语句根据时间序列中定义的标签的键值做聚合查询。
+**示例1:** 不同 database 下均存在名为 status 的序列, 如 "root.ln.wf01.wt01.status", "root.ln.wf02.wt02.status", 以及 "root.sgcc.wf03.wt01.status", 如果需要统计不同 database 下 status 序列的数据点个数,使用以下查询:
+
+```sql
+select count(status) from root.** group by level = 1
+```
+
+运行结果为:
+
+```
++-------------------------+---------------------------+
+|count(root.ln.*.*.status)|count(root.sgcc.*.*.status)|
++-------------------------+---------------------------+
+|                    20160|                      10080|
++-------------------------+---------------------------+
+Total line number = 1
+It costs 0.003s
+```
+
+**示例2:** 统计不同设备下 status 序列的数据点个数,可以规定 level = 3,
+
+```sql
+select count(status) from root.** group by level = 3
+```
+
+运行结果为:
+
+```
++---------------------------+---------------------------+
+|count(root.*.*.wt01.status)|count(root.*.*.wt02.status)|
++---------------------------+---------------------------+
+|                      20160|                      10080|
++---------------------------+---------------------------+
+Total line number = 1
+It costs 0.003s
+```
+
+注意,这时会将 database `ln` 和 `sgcc` 下名为 `wt01` 的设备视为同名设备聚合在一起。
+
+**示例3:** 统计不同 database 下的不同设备中 status 序列的数据点个数,可以使用以下查询:
+
+```sql
+select count(status) from root.** group by level = 1, 3
+```
+
+运行结果为:
+
+```
++----------------------------+----------------------------+------------------------------+
+|count(root.ln.*.wt01.status)|count(root.ln.*.wt02.status)|count(root.sgcc.*.wt01.status)|
++----------------------------+----------------------------+------------------------------+
+|                       10080|                       10080|                         10080|
++----------------------------+----------------------------+------------------------------+
+Total line number = 1
+It costs 0.003s
+```
+
+**示例4:** 查询所有序列下温度传感器 temperature 的最大值,可以使用下列查询语句:
+
+```sql
+select max_value(temperature) from root.** group by level = 0
+```
+
+运行结果:
+
+```
++---------------------------------+
+|max_value(root.*.*.*.temperature)|
++---------------------------------+
+|                             26.0|
++---------------------------------+
+Total line number = 1
+It costs 0.013s
+```
+
+**示例5:** 上面的查询都是针对某一个传感器,特别地,**如果想要查询某一层级下所有传感器拥有的总数据点数,则需要显式规定测点为 `*`**
+
+```sql
+select count(*) from root.ln.** group by level = 2
+```
+
+运行结果:
+
+```
++----------------------+----------------------+
+|count(root.*.wf01.*.*)|count(root.*.wf02.*.*)|
++----------------------+----------------------+
+|                 20160|                 20160|
++----------------------+----------------------+
+Total line number = 1
+It costs 0.013s
+```
+
+## 标签分组聚合
+
+IoTDB 支持通过 `GROUP BY TAGS` 语句根据时间序列中定义的标签的键值做聚合查询。
 
 我们先在 IoTDB 中写入如下示例数据,稍后会以这些数据为例介绍标签聚合查询。
 
@@ -461,7 +417,7 @@ IoTDB 还支持通过 `GROUP BY TAGS` 语句根据时间序列中定义的标签
 `d8` 和 `d9` 设备目前处于调试阶段,还未被分配到具体的城市和车间,所以其相应的标签值为空值。
 
 ```SQL
-CREATE DATABASE root.factory1;
+create database root.factory1;
 create timeseries root.factory1.d1.temperature with datatype=FLOAT tags(city=Beijing, workshop=w1);
 create timeseries root.factory1.d2.temperature with datatype=FLOAT tags(city=Beijing, workshop=w1);
 create timeseries root.factory1.d3.temperature with datatype=FLOAT tags(city=Beijing, workshop=w2);
@@ -614,95 +570,3 @@ SELECT AVG(temperature) FROM root.factory1.** GROUP BY ([1000, 10000), 5s), TAGS
 > 5. 暂不支持聚合函数内部包含表达式,例如 `count(s+1)`。
 > 6. 不支持值过滤条件聚合,和分层聚合查询行为保持一致。
 
-## 聚合结果过滤
-
-如果想对聚合查询的结果进行过滤,可以在 `GROUP BY` 子句之后使用 `HAVING` 子句
-
-> 注意:
-> 
-> 1.`HAVING`子句中的过滤条件必须由聚合值构成,原始序列不能单独出现。
-> 下列使用方式是不正确的:
-> ```sql
-> select count(s1) from root.** group by ([1,3),1ms) having sum(s1) > s1
-> select count(s1) from root.** group by ([1,3),1ms) having s1 > 1
-> ```
-> 2.对`GROUP BY LEVEL`结果进行过滤时,`SELECT`和`HAVING`中出现的PATH只能有一级。
-> 下列使用方式是不正确的:
-> ```sql
-> select count(s1) from root.** group by ([1,3),1ms), level=1 having sum(d1.s1) > 1
-> select count(d1.s1) from root.** group by ([1,3),1ms), level=1 having sum(s1) > 1
-> ```
-
-以下为几个使用`HAVING`子句对聚合结果进行过滤对例子
-
-聚合结果1:
-
-```
-+-----------------------------+---------------------+---------------------+
-|                         Time|count(root.test.*.s1)|count(root.test.*.s2)|
-+-----------------------------+---------------------+---------------------+
-|1970-01-01T08:00:00.001+08:00|                    4|                    4|
-|1970-01-01T08:00:00.003+08:00|                    1|                    0|
-|1970-01-01T08:00:00.005+08:00|                    2|                    4|
-|1970-01-01T08:00:00.007+08:00|                    3|                    2|
-|1970-01-01T08:00:00.009+08:00|                    4|                    4|
-+-----------------------------+---------------------+---------------------+
-```
-
-聚合结果过滤查询1:
-
-```sql
- select count(s1) from root.** group by ([1,11),2ms), level=1 having count(s2) > 2
-```
-
-过滤结果1:
-
-```
-+-----------------------------+---------------------+
-|                         Time|count(root.test.*.s1)|
-+-----------------------------+---------------------+
-|1970-01-01T08:00:00.001+08:00|                    4|
-|1970-01-01T08:00:00.005+08:00|                    2|
-|1970-01-01T08:00:00.009+08:00|                    4|
-+-----------------------------+---------------------+
-```
-
-聚合结果2:
-
-```
-+-----------------------------+-------------+---------+---------+
-|                         Time|       Device|count(s1)|count(s2)|
-+-----------------------------+-------------+---------+---------+
-|1970-01-01T08:00:00.001+08:00|root.test.sg1|        1|        2|
-|1970-01-01T08:00:00.003+08:00|root.test.sg1|        1|        0|
-|1970-01-01T08:00:00.005+08:00|root.test.sg1|        1|        2|
-|1970-01-01T08:00:00.007+08:00|root.test.sg1|        2|        1|
-|1970-01-01T08:00:00.009+08:00|root.test.sg1|        2|        2|
-|1970-01-01T08:00:00.001+08:00|root.test.sg2|        2|        2|
-|1970-01-01T08:00:00.003+08:00|root.test.sg2|        0|        0|
-|1970-01-01T08:00:00.005+08:00|root.test.sg2|        1|        2|
-|1970-01-01T08:00:00.007+08:00|root.test.sg2|        1|        1|
-|1970-01-01T08:00:00.009+08:00|root.test.sg2|        2|        2|
-+-----------------------------+-------------+---------+---------+
-```
-
-聚合结果过滤查询2:
-
-```sql
- select count(s1), count(s2) from root.** group by ([1,11),2ms) having count(s2) > 1 align by device
-```
-
-过滤结果2:
-
-```
-+-----------------------------+-------------+---------+---------+
-|                         Time|       Device|count(s1)|count(s2)|
-+-----------------------------+-------------+---------+---------+
-|1970-01-01T08:00:00.001+08:00|root.test.sg1|        1|        2|
-|1970-01-01T08:00:00.005+08:00|root.test.sg1|        1|        2|
-|1970-01-01T08:00:00.009+08:00|root.test.sg1|        2|        2|
-|1970-01-01T08:00:00.001+08:00|root.test.sg2|        2|        2|
-|1970-01-01T08:00:00.005+08:00|root.test.sg2|        1|        2|
-|1970-01-01T08:00:00.009+08:00|root.test.sg2|        2|        2|
-+-----------------------------+-------------+---------+---------+
-```
\ No newline at end of file
diff --git a/docs/zh/UserGuide/Query-Data/Having-Condition.md b/docs/zh/UserGuide/Query-Data/Having-Condition.md
new file mode 100644
index 0000000000..9669557969
--- /dev/null
+++ b/docs/zh/UserGuide/Query-Data/Having-Condition.md
@@ -0,0 +1,115 @@
+<!--
+
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+    
+        http://www.apache.org/licenses/LICENSE-2.0
+    
+    Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.
+
+-->
+
+# 聚合结果过滤
+
+如果想对聚合查询的结果进行过滤,可以在 `GROUP BY` 子句之后使用 `HAVING` 子句。
+
+**注意:** 
+
+1. `HAVING`子句中的过滤条件必须由聚合值构成,原始序列不能单独出现。
+
+    下列使用方式是不正确的:
+    ```sql
+    select count(s1) from root.** group by ([1,3),1ms) having sum(s1) > s1
+    select count(s1) from root.** group by ([1,3),1ms) having s1 > 1
+    ```
+   
+2. 对`GROUP BY LEVEL`结果进行过滤时,`SELECT`和`HAVING`中出现的PATH只能有一级。 
+
+   下列使用方式是不正确的:
+    ```sql
+    select count(s1) from root.** group by ([1,3),1ms), level=1 having sum(d1.s1) > 1
+    select count(d1.s1) from root.** group by ([1,3),1ms), level=1 having sum(s1) > 1
+    ```
+
+**SQL 示例:**
+
+- **示例 1:**
+
+    对于以下聚合结果进行过滤:
+
+    ```
+    +-----------------------------+---------------------+---------------------+
+    |                         Time|count(root.test.*.s1)|count(root.test.*.s2)|
+    +-----------------------------+---------------------+---------------------+
+    |1970-01-01T08:00:00.001+08:00|                    4|                    4|
+    |1970-01-01T08:00:00.003+08:00|                    1|                    0|
+    |1970-01-01T08:00:00.005+08:00|                    2|                    4|
+    |1970-01-01T08:00:00.007+08:00|                    3|                    2|
+    |1970-01-01T08:00:00.009+08:00|                    4|                    4|
+    +-----------------------------+---------------------+---------------------+
+    ```
+
+    ```sql
+     select count(s1) from root.** group by ([1,11),2ms), level=1 having count(s2) > 2;
+    ```
+
+    执行结果如下:
+
+    ```
+    +-----------------------------+---------------------+
+    |                         Time|count(root.test.*.s1)|
+    +-----------------------------+---------------------+
+    |1970-01-01T08:00:00.001+08:00|                    4|
+    |1970-01-01T08:00:00.005+08:00|                    2|
+    |1970-01-01T08:00:00.009+08:00|                    4|
+    +-----------------------------+---------------------+
+    ```
+
+- **示例 2:**
+
+  对于以下聚合结果进行过滤:
+    ```
+    +-----------------------------+-------------+---------+---------+
+    |                         Time|       Device|count(s1)|count(s2)|
+    +-----------------------------+-------------+---------+---------+
+    |1970-01-01T08:00:00.001+08:00|root.test.sg1|        1|        2|
+    |1970-01-01T08:00:00.003+08:00|root.test.sg1|        1|        0|
+    |1970-01-01T08:00:00.005+08:00|root.test.sg1|        1|        2|
+    |1970-01-01T08:00:00.007+08:00|root.test.sg1|        2|        1|
+    |1970-01-01T08:00:00.009+08:00|root.test.sg1|        2|        2|
+    |1970-01-01T08:00:00.001+08:00|root.test.sg2|        2|        2|
+    |1970-01-01T08:00:00.003+08:00|root.test.sg2|        0|        0|
+    |1970-01-01T08:00:00.005+08:00|root.test.sg2|        1|        2|
+    |1970-01-01T08:00:00.007+08:00|root.test.sg2|        1|        1|
+    |1970-01-01T08:00:00.009+08:00|root.test.sg2|        2|        2|
+    +-----------------------------+-------------+---------+---------+
+    ```
+
+    ```sql
+     select count(s1), count(s2) from root.** group by ([1,11),2ms) having count(s2) > 1 align by device;
+    ```
+
+    执行结果如下:
+
+    ```
+    +-----------------------------+-------------+---------+---------+
+    |                         Time|       Device|count(s1)|count(s2)|
+    +-----------------------------+-------------+---------+---------+
+    |1970-01-01T08:00:00.001+08:00|root.test.sg1|        1|        2|
+    |1970-01-01T08:00:00.005+08:00|root.test.sg1|        1|        2|
+    |1970-01-01T08:00:00.009+08:00|root.test.sg1|        2|        2|
+    |1970-01-01T08:00:00.001+08:00|root.test.sg2|        2|        2|
+    |1970-01-01T08:00:00.005+08:00|root.test.sg2|        1|        2|
+    |1970-01-01T08:00:00.009+08:00|root.test.sg2|        2|        2|
+    +-----------------------------+-------------+---------+---------+
+    ```
\ No newline at end of file
diff --git a/docs/zh/UserGuide/Query-Data/Last-Query.md b/docs/zh/UserGuide/Query-Data/Last-Query.md
index 2084cc0823..1a39f6529d 100644
--- a/docs/zh/UserGuide/Query-Data/Last-Query.md
+++ b/docs/zh/UserGuide/Query-Data/Last-Query.md
@@ -21,7 +21,9 @@
 
 # 最新点查询
 
-最新点查询是时序数据库 Apache IoTDB 中提供的一种特殊查询。它返回指定时间序列中时间戳最大的数据点,即一条序列的最新状态。在物联网数据分析场景中,此功能尤为重要。为了满足了用户对设备实时监控的需求,Apache IoTDB 对最新点查询进行了**缓存优化**,能够提供毫秒级的返回速度。
+最新点查询是时序数据库 Apache IoTDB 中提供的一种特殊查询。它返回指定时间序列中时间戳最大的数据点,即一条序列的最新状态。
+
+在物联网数据分析场景中,此功能尤为重要。为了满足了用户对设备实时监控的需求,Apache IoTDB 对最新点查询进行了**缓存优化**,能够提供毫秒级的返回速度。
 
 SQL 语法:
 
@@ -29,17 +31,19 @@ SQL 语法:
 select last <Path> [COMMA <Path>]* from < PrefixPath > [COMMA < PrefixPath >]* <whereClause> [ORDER BY TIMESERIES (DESC | ASC)?]
 ```
 
-其含义是:查询时间序列 prefixPath.path 中最近时间戳的数据。
+其含义是: 查询时间序列 prefixPath.path 中最近时间戳的数据。
 
-`whereClause` 中当前只支持时间过滤条件,任何其他过滤条件都将会返回异常。当缓存的最新点不满足过滤条件时,IoTDB 需要从存储中获取结果,此时性能将会有所下降。
+- `whereClause` 中当前只支持时间过滤条件,任何其他过滤条件都将会返回异常。当缓存的最新点不满足过滤条件时,IoTDB 需要从存储中获取结果,此时性能将会有所下降。
 
-结果集为四列的结构:
+- 结果集为四列的结构:
 
-```
-+----+----------+-----+--------+
-|Time|timeseries|value|dataType|
-+----+----------+-----+--------+
-```
+    ```
+    +----+----------+-----+--------+
+    |Time|timeseries|value|dataType|
+    +----+----------+-----+--------+
+    ```
+
+- 可以使用 `ORDER BY TIMESERIES (DESC | ASC)` 指定结果集按照序列名降序/升序排列。
 
 **示例 1:** 查询 root.ln.wf01.wt01.status 的最新数据点
 
@@ -68,8 +72,6 @@ Total line number = 2
 It costs 0.002s
 ```
 
-## 将结果集根据序列名进行排序
-
 **示例 3:** 查询 root.ln.wf01.wt01 下所有序列的最新数据点,并按照序列名降序排列。
 
 ```
diff --git a/docs/zh/UserGuide/UDF-Library/M4.md b/docs/zh/UserGuide/Query-Data/Order-By.md
similarity index 86%
rename from docs/zh/UserGuide/UDF-Library/M4.md
rename to docs/zh/UserGuide/Query-Data/Order-By.md
index 67c9838034..20cdc6b82c 100644
--- a/docs/zh/UserGuide/UDF-Library/M4.md
+++ b/docs/zh/UserGuide/Query-Data/Order-By.md
@@ -19,8 +19,6 @@
 
 -->
 
-# M4
+# 结果集排序
 
-## M4
-
-M4文档已移至[Query Data->Select Expression->Time Series Generating Functions](../Query-Data/Select-Expression.md).
\ No newline at end of file
+TODO @yang caiyin
\ No newline at end of file
diff --git a/docs/zh/UserGuide/Query-Data/Overview.md b/docs/zh/UserGuide/Query-Data/Overview.md
index a2f1e65952..4b226c73b6 100644
--- a/docs/zh/UserGuide/Query-Data/Overview.md
+++ b/docs/zh/UserGuide/Query-Data/Overview.md
@@ -21,37 +21,101 @@
 
 # 概述
 
-## 语法定义
+在 IoTDB 中,使用 `SELECT` 语句从一条或多条时间序列中查询数据。
 
-在 IoTDB 中,使用 `SELECT` 语句从一条或多条时间序列中查询数据。 下面是 `SELECT` 语句的语法定义:
+## 语法定义
 
 ```sql
-[TRACING] SELECT
-    [LAST] [TOP k] resultColumn [, resultColumn] ...
+SELECT [LAST] selectExpr [, selectExpr] ...
+    [INTO intoItem [, intoItem] ...]
     FROM prefixPath [, prefixPath] ...
-    WHERE whereCondition
-    [GROUP BY ([startTime, endTime), interval, slidingStep)]
-    [GROUP BY LEVEL = levelNum [, levelNum] ...]
-    [FILL ({PREVIOUS, beforeRange | LINEAR, beforeRange, afterRange | constant})]
-    [LIMIT rowLimit] [OFFSET rowOffset]
+    [ALIGN BY {TIME | DEVICE}]
+    [WHERE whereCondition]
+    [GROUP BY {
+        ([startTime, endTime), interval, slidingStep) |
+        LEVEL = levelNum [, levelNum] ...
+    }]
+    [HAVING havingCondition]
+    [ORDER BY sortKey {ASC | DESC}]
+    [FILL ({PREVIOUS | LINEAR | constant})]
     [SLIMIT seriesLimit] [SOFFSET seriesOffset]
-    [WITHOUT NULL {ANY | ALL} [resultColumn [, resultColumn] ...]]
-    [ORDER BY TIME {ASC | DESC}]
-    [{ALIGN BY DEVICE | DISABLE ALIGN}]
+    [LIMIT rowLimit] [OFFSET rowOffset]
 ```
 
-常用的子句如下:
+## 语法说明
+
+### `SELECT` 子句
+
+- `SELECT` 子句指定查询的输出,由若干个 `selectExpr` 组成。
+- 每个 `selectExpr` 定义查询结果中的一列或多列,它是一个由时间序列路径后缀、常量、函数和运算符组成的表达式。
+- 支持使用`AS`为查询结果集中的列指定别名。
+- 在 `SELECT` 子句中使用 `LAST` 关键词可以指定查询为最新点查询,详细说明及示例见文档 [最新点查询](./Last-Query.md) 。
+- 详细说明及示例见文档 [选择表达式](./Select-Expression.md) 。
+
+### `INTO` 子句
+
+- `SELECT INTO` 用于将查询结果写入一系列指定的时间序列中。`INTO` 子句指定了查询结果写入的目标时间序列。
+- 详细说明及示例见文档 [SELECT INTO(查询写回)](Select-Into.md) 。
+
+### `FROM` 子句
+
+- `FROM` 子句包含要查询的一个或多个时间序列的路径前缀,支持使用通配符。
+- 在执行查询时,会将 `FROM` 子句中的路径前缀和 `SELECT` 子句中的后缀进行拼接得到完整的查询目标序列。
+
+### `ALIGN BY` 子句
+
+- 查询结果集默认**按时间对齐**,包含一列时间列和若干个值列,每一行数据各列的时间戳相同。
+- 除按时间对齐之外,还支持**按设备对齐**,查询结果集包含一列时间列、一列设备列和若干个值列。
+- 详细说明及示例见文档 [查询对齐模式](./Align-By.md) 。
+
+### `WHERE` 子句
+
+- `WHERE` 子句指定了对数据行的筛选条件,由一个 `whereCondition` 组成。
+- `whereCondition` 是一个逻辑表达式,对于要选择的每一行,其计算结果为真。如果没有 `WHERE` 子句,将选择所有行。
+- 在 `whereCondition` 中,可以使用除聚合函数之外的任何 IOTDB 支持的函数和运算符。
+- 详细说明及示例见文档 [查询过滤条件](./Where-Condition.md) 。
+
+### `GROUP BY` 子句
+
+- `GROUP BY` 子句指定对序列进行分段或分组聚合的方式。
+- 分段聚合是指按照时间维度,针对同时间序列中不同数据点之间的时间关系,对数据在行的方向进行分段,每个段得到一个聚合值。目前仅支持**按时间区间分段**,未来将支持更多分段方式。
+- 分组聚合是指针对不同时间序列,在时间序列的潜在业务属性上分组,每个组包含若干条时间序列,每个组得到一个聚合值。支持**按路径层级分组**和**按序列标签分组**两种分组方式。
+- 分段聚合和分组聚合可以混合使用。
+- 详细说明及示例见文档 [分段分组聚合](./Group-By.md) 。
+
+### `HAVING` 子句
+
+- `HAVING` 子句指定了对聚合结果的筛选条件,由一个 `havingCondition` 组成。
+- `havingCondition` 是一个逻辑表达式,对于要选择的聚合结果,其计算结果为真。如果没有 `HAVING` 子句,将选择所有聚合结果。
+- `HAVING` 要和聚合函数以及 `GROUP BY` 子句一起使用。
+- 详细说明及示例见文档 [聚合结果过滤](./Having-Condition.md) 。
+
+### `ORDER BY` 子句
+
+- `ORDER BY` 子句用户指定结果集的排序方式。
+- 按时间对齐模式下:默认按照时间戳大小升序排列,可以通过 `ORDER BY TIME DESC` 指定结果集按照时间戳大小降序排列。
+- 按设备对齐模式下:默认按照设备名的字典序升序排列,每个设备内部按照时间戳大小升序排列,可以通过 `ORDER BY` 子句调整设备列和时间列的排序优先级。
+- 详细说明及示例见文档 [结果集排序](./Order-By.md) 。
+
+### `FILL` 子句
+
+- `FILL` 子句用于指定数据缺失情况下的填充模式,允许用户按照特定的方法对任何查询的结果集填充空值。
+- 详细说明及示例见文档 [结果集补空值](./Fill.md) 。
+
+### `SLIMIT` 和 `SOFFSET` 子句
+
+- `SLIMIT` 指定查询结果的列数,`SOFFSET` 指定查询结果显示的起始列位置。`SLIMIT` 和 `SOFFSET` 仅用于控制值列,对时间列和设备列无效。
+- 关于查询结果分页,详细说明及示例见文档 [结果集分页](./Pagination.md) 。
+
+### `LIMIT` 和 `OFFSET` 子句
+
+- `LIMIT` 指定查询结果的行数,`OFFSET` 指定查询结果显示的起始行位置。
+- 关于查询结果分页,详细说明及示例见文档 [结果集分页](./Pagination.md) 。
 
-- 每个 `resultColumn` 对应查询结果的一列,支持时间序列后缀、时间序列生成函数(包括用户自定义函数)、聚合函数、数字常量、算数运算表达式。每个 `SELECT` 语句至少应该包含一个 `resultColumn` 。关于 `resultColumn`,详见 [选择表达式](./Select-Expression.md) 。
-- `fromClause` 包含要查询的一个或多个时间序列的前缀。
-- `whereCondition`(可选)指定了查询的筛选条件 `queryFilter`。`queryFilter` 是一个逻辑表达式,查询结果返回计算结果为真的数据点。如果没有指定 `whereCondition`,则返回序列中所有数据点。关于 `queryFilter`,详见 [查询过滤条件](./Query-Filter.md) 。
-- 查询结果默认按照时间戳大小升序排列,可以通过 `ORDER BY TIME DESC` 指定结果集按照时间戳大小降序排列。
-- 当查询结果数据量很大时,可以使用 `LIMIT/SLIMIT` 及 `OFFSET/SOFFSET` 对结果集进行分页,详见 [查询结果分页](./Pagination.md) 。
-- 查询结果集默认按照时间戳进行对齐,即以时间序列为列,每一行数据各列的时间戳相同。其他结果集对齐方式详见 [查询结果对齐格式](./Result-Format.md) 。
 
-## 基本示例
+## SQL 示例
 
-### 根据一个时间区间选择一列数据
+### 示例1:根据一个时间区间选择一列数据
 
 SQL 语句为:
 
@@ -82,7 +146,7 @@ Total line number = 8
 It costs 0.026s
 ```
 
-### 根据一个时间区间选择多列数据
+### 示例2:根据一个时间区间选择多列数据
 
 SQL 语句为:
 
@@ -111,7 +175,7 @@ Total line number = 6
 It costs 0.018s
 ```
 
-### 按照多个时间区间选择同一设备的多列数据
+### 示例3:按照多个时间区间选择同一设备的多列数据
 
 IoTDB 支持在一次查询中指定多个时间区间条件,用户可以根据需求随意组合时间区间条件。例如,
 
@@ -145,7 +209,7 @@ Total line number = 9
 It costs 0.018s
 ```
 
-### 按照多个时间区间选择不同设备的多列数据
+### 示例4:按照多个时间区间选择不同设备的多列数据
 
 该系统支持在一次查询中选择任意列的数据,也就是说,被选择的列可以来源于不同的设备。例如,SQL 语句为:
 
@@ -177,7 +241,7 @@ Total line number = 9
 It costs 0.014s
 ```
 
-### 根据时间降序返回结果集
+### 示例5:根据时间降序返回结果集
 
 IoTDB 支持 `order by time` 语句,用于对结果按照时间进行降序展示。例如,SQL 语句为:
 
@@ -214,10 +278,10 @@ It costs 0.016s
 
 - 在 JDBC 中执行查询语句,详见 [JDBC](../API/Programming-JDBC.md) 。
 
-- 在 JAVA / C++ / Python / Go 等编程语言 API 中执行查询语句,详见应用编程接口一章相关文档。接口原型如下:
+- 在 JAVA / C++ / Python / Go 等编程语言 API 中执行查询语句,详见应用编程接口一章相应文档。接口原型如下:
 
   ```java
-  SessionDataSet executeQueryStatement(String sql)
+  SessionDataSet executeQueryStatement(String sql);
   ```
 
 - 在 RESTful API 中使用,详见 [HTTP API](../API/RestService.md) 。
diff --git a/docs/zh/UserGuide/Query-Data/Pagination.md b/docs/zh/UserGuide/Query-Data/Pagination.md
index 6b05da57e6..03c65b4951 100644
--- a/docs/zh/UserGuide/Query-Data/Pagination.md
+++ b/docs/zh/UserGuide/Query-Data/Pagination.md
@@ -28,7 +28,14 @@
 
 ## 按行分页
 
-通过使用 `LIMIT` 和 `OFFSET` 子句,用户可以以与行相关的方式控制查询结果。 我们将通过以下示例演示如何使用 `LIMIT` 和 `OFFSET` 子句。
+用户可以通过 `LIMIT` 和 `OFFSET` 子句控制查询结果的行数,`LIMIT rowLimit` 指定查询结果的行数,`OFFSET rowOffset` 指定查询结果显示的起始行位置。
+
+注意:
+- 当 `rowOffset` 超过结果集的大小时,返回空结果集。
+- 当 `rowLimit` 超过结果集的大小时,返回所有查询结果。
+- 当 `rowLimit` 和 `rowOffset` 不是正整数,或超过 `INT32` 允许的最大值时,系统将提示错误。
+
+我们将通过以下示例演示如何使用 `LIMIT` 和 `OFFSET` 子句。
 
 - **示例 1:** 基本的 `LIMIT` 子句
 
@@ -146,21 +153,17 @@ Total line number = 4
 It costs 0.016s
 ```
 
-值得注意的是,由于当前的 FILL 子句只能在某个时间点填充时间序列的缺失值,也就是说,FILL 子句的执行结果恰好是一行,因此 LIMIT 和 OFFSE 不能与 FILL 子句结合使用,否则将提示错误。 例如,执行以下 SQL 语句:
-
-```sql
-select temperature from root.sgcc.wf03.wt01 where time = 2017-11-01T16:37:50.000 fill(previous, 1m) limit 10
-```
+## 按列分页
 
-错误提示如下:
+用户可以通过 `SLIMIT` 和 `SOFFSET` 子句控制查询结果的列数,`SLIMIT seriesLimit` 指定查询结果的列数,`SOFFSET seriesOffset` 指定查询结果显示的起始列位置。
 
-```
-Msg: 401: Error occured while parsing SQL to physical plan: line 1:101 mismatched input 'limit' expecting {<EOF>, ';'}
-```
+注意:
+- 仅用于控制值列,对时间列和设备列无效。
+- 当 `seriesOffset` 超过结果集的大小时,返回空结果集。
+- 当 `seriesLimit` 超过结果集的大小时,返回所有查询结果。
+- 当 `seriesLimit` 和 `seriesOffset` 不是正整数,或超过 `INT32` 允许的最大值时,系统将提示错误。
 
-## 按列分页
-
-通过使用 `SLIMIT` 和 `SOFFSET` 子句,用户可以与列相关的方式控制查询结果。 我们将通过以下示例演示如何使用 `SLIMIT` 和 `SOFFSET` 子句。
+我们将通过以下示例演示如何使用 `SLIMIT` 和 `SOFFSET` 子句。
 
 - **示例 1:** 基本的 `SLIMIT` 子句
 
@@ -246,29 +249,7 @@ Total line number = 7
 It costs 0.000s
 ```
 
-- **示例 4:** `SLIMIT` 子句与 `FILL` 子句结合
-
-SQL 语句:
-
-```sql
-select * from root.sgcc.wf03.wt01 where time = 2017-11-01T16:37:50.000 fill(previous, 1m) slimit 1 soffset 1
-```
-
-含义:
-
-```
-+-----------------------------+--------------------------+
-|                         Time|root.sgcc.wf03.wt01.status|
-+-----------------------------+--------------------------+
-|2017-11-01T16:35:00.000+08:00|                      true|
-+-----------------------------+--------------------------+
-Total line number = 1
-It costs 0.007s
-```
-
-## 行和列混合分页
-
-除了对查询结果进行行或列控制之外,IoTDB 还允许用户控制查询结果的行和列。 这是同时包含 `LIMIT` 子句和 `SLIMIT` 子句的完整示例。
+- **示例 4:** `SLIMIT` 子句与 `LIMIT` 子句结合
 
 SQL 语句:
 
@@ -299,69 +280,4 @@ select * from root.ln.wf01.wt01 limit 10 offset 100 slimit 2 soffset 0
 +-----------------------------+-----------------------------+------------------------+
 Total line number = 10
 It costs 0.009s
-```
-
-## 错误处理
-
-当 `LIMIT / SLIMIT` 的参数 `N / SN` 超过结果集的大小时,IoTDB 将按预期返回所有结果。 例如,原始 SQL 语句的查询结果由六行组成,我们通过 `LIMIT` 子句选择前 100 行:
-
-```sql
-select status,temperature from root.ln.wf01.wt01 where time > 2017-11-01T00:05:00.000 and time < 2017-11-01T00:12:00.000 limit 100
-```
-
-结果如下所示:
-
-```
-+-----------------------------+------------------------+-----------------------------+
-|                         Time|root.ln.wf01.wt01.status|root.ln.wf01.wt01.temperature|
-+-----------------------------+------------------------+-----------------------------+
-|2017-11-01T00:06:00.000+08:00|                   false|                        20.71|
-|2017-11-01T00:07:00.000+08:00|                   false|                        21.45|
-|2017-11-01T00:08:00.000+08:00|                   false|                        22.58|
-|2017-11-01T00:09:00.000+08:00|                   false|                        20.98|
-|2017-11-01T00:10:00.000+08:00|                    true|                        25.52|
-|2017-11-01T00:11:00.000+08:00|                   false|                        22.91|
-+-----------------------------+------------------------+-----------------------------+
-Total line number = 6
-It costs 0.005s
-```
-
-当 `LIMIT / SLIMIT` 子句的参数 `N / SN` 超过允许的最大值(`N / SN` 的类型为 `INT32`)时,系统将提示错误。 例如,执行以下 SQL 语句:
-
-```sql
-select status,temperature from root.ln.wf01.wt01 where time > 2017-11-01T00:05:00.000 and time < 2017-11-01T00:12:00.000 limit 1234567890123456789
-```
-
-SQL 语句将不会执行,并且相应的错误提示如下:
-
-```
-Msg: 303: check metadata error: Out of range. LIMIT <N>: N should be Int32.
-```
-
-当 `LIMIT / LIMIT` 子句的参数 `N / SN` 不是正整数时,系统将提示错误。 例如,执行以下 SQL 语句:
-
-```sql
-select status,temperature from root.ln.wf01.wt01 where time > 2017-11-01T00:05:00.000 and time < 2017-11-01T00:12:00.000 limit 13.1
-```
-
-SQL 语句将不会执行,并且相应的错误提示如下:
-
-```
-Msg: 401: line 1:129 mismatched input '.' expecting {<EOF>, ';'}
-```
-
-当 `LIMIT` 子句的参数 `OFFSET` 超过结果集的大小时,IoTDB 将返回空结果集。 例如,执行以下 SQL 语句:
-
-```sql
-select status,temperature from root.ln.wf01.wt01 where time > 2017-11-01T00:05:00.000 and time < 2017-11-01T00:12:00.000 limit 2 offset 6
-```
-
-结果如下所示:
-
-```
-+----+------------------------+-----------------------------+
-|Time|root.ln.wf01.wt01.status|root.ln.wf01.wt01.temperature|
-+----+------------------------+-----------------------------+
-Empty set.
-It costs 0.005s
 ```
\ No newline at end of file
diff --git a/docs/zh/UserGuide/Query-Data/Performance-Tracing-Tool.md b/docs/zh/UserGuide/Query-Data/Performance-Tracing-Tool.md
deleted file mode 100644
index 7f5ea3e9b5..0000000000
--- a/docs/zh/UserGuide/Query-Data/Performance-Tracing-Tool.md
+++ /dev/null
@@ -1,51 +0,0 @@
-<!--
-
-    Licensed to the Apache Software Foundation (ASF) under one
-    or more contributor license agreements.  See the NOTICE file
-    distributed with this work for additional information
-    regarding copyright ownership.  The ASF licenses this file
-    to you under the Apache License, Version 2.0 (the
-    "License"); you may not use this file except in compliance
-    with the License.  You may obtain a copy of the License at
-    
-        http://www.apache.org/licenses/LICENSE-2.0
-    
-    Unless required by applicable law or agreed to in writing,
-    software distributed under the License is distributed on an
-    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-    KIND, either express or implied.  See the License for the
-    specific language governing permissions and limitations
-    under the License.
-
--->
-# 性能追踪工具
-
-> 注意:0.13及以上版本中将不再支持0.12中的 `TRACING ON/OFF` 。
-
-IoTDB 支持使用 `TRACING` 关键词对查询语句进行性能追踪。用户可以分析查询语句执行中存在的潜在性能问题。
-
-性能追踪的结果包括:
-1. 执行过程中各个阶段的累积耗时。
-2. 与性能分析相关的统计信息。对于查询语句,包括查询的时间序列数、涉及访问的 Tsfile 文件数、需要扫描的 chunk 总数以及平均每个 chunk 包含的数据点个数、读取的 Page 总数以及其中乱序 Page 的个数。
-
-**示例:**
-
-例如执行 `tracing select * from root.**`,输出结果如下:
-
-```
-Tracing Activties:
-+---------------------------------------------------------+------------+
-|                                                 Activity|Elapsed Time|
-+---------------------------------------------------------+------------+
-|Start to execute statement: tracing select * from root.**|           0|
-|                               Parse SQL to physical plan|           4|
-|                                 Create and cache dataset|          16|
-|                                 * Num of series paths: 3|            |
-|                          * Num of sequence files read: 2|            |
-|                        * Num of unsequence files read: 1|            |
-|           * Num of sequence chunks: 6, avg points: 100.0|            |
-|         * Num of unsequence chunks: 3, avg points: 100.0|            |
-|            * Num of Pages: 9, overlapped pages: 0 (0.0%)|            |
-|                                         Request complete|          20|
-+---------------------------------------------------------+------------+
-```
\ No newline at end of file
diff --git a/docs/zh/UserGuide/Query-Data/Result-Format.md b/docs/zh/UserGuide/Query-Data/Result-Format.md
deleted file mode 100644
index 76184921ec..0000000000
--- a/docs/zh/UserGuide/Query-Data/Result-Format.md
+++ /dev/null
@@ -1,89 +0,0 @@
-<!--
-
-    Licensed to the Apache Software Foundation (ASF) under one
-    or more contributor license agreements.  See the NOTICE file
-    distributed with this work for additional information
-    regarding copyright ownership.  The ASF licenses this file
-    to you under the Apache License, Version 2.0 (the
-    "License"); you may not use this file except in compliance
-    with the License.  You may obtain a copy of the License at
-    
-        http://www.apache.org/licenses/LICENSE-2.0
-    
-    Unless required by applicable law or agreed to in writing,
-    software distributed under the License is distributed on an
-    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-    KIND, either express or implied.  See the License for the
-    specific language governing permissions and limitations
-    under the License.
-
--->
-
-# 查询结果集格式
-
-在 IoTDB 中,查询结果集默认按照时间对齐,同时支持另外两种结果返回形式:
-
-- 设备时间对齐 `align by device` 
-- 时序不对齐 `disable align`
-
-注意:对齐方式子句只能用于查询语句句尾。
-
-## 按设备对齐
-
-在 `align by device` 对齐方式下,设备名会单独作为一列出现。如果 select 子句中有 `n` 列,最终结果就会有该 `n + 2` 列(时间列和设备名字列)。
-
-> 注意:
->
-> 1.可以将 'align by device' 的结果看成一张关系表,`Time + Device` 看做其主键。
->
-> 2.结果集首先按照 `Device` 进行排序,然后按照 `Time` 排序。
-
-SQL 形如:
-
-```sql
-select * from root.ln.** where time <= 2017-11-01T00:01:00 align by device
-```
-
-结果如下:
-
-```
-+-----------------------------+-----------------+-----------+------+--------+
-|                         Time|           Device|temperature|status|hardware|
-+-----------------------------+-----------------+-----------+------+--------+
-|2017-11-01T00:00:00.000+08:00|root.ln.wf01.wt01|      25.96|  true|    null|
-|2017-11-01T00:01:00.000+08:00|root.ln.wf01.wt01|      24.36|  true|    null|
-|1970-01-01T08:00:00.001+08:00|root.ln.wf02.wt02|       null|  true|      v1|
-|1970-01-01T08:00:00.002+08:00|root.ln.wf02.wt02|       null| false|      v2|
-|2017-11-01T00:00:00.000+08:00|root.ln.wf02.wt02|       null|  true|      v2|
-|2017-11-01T00:01:00.000+08:00|root.ln.wf02.wt02|       null|  true|      v2|
-+-----------------------------+-----------------+-----------+------+--------+
-Total line number = 6
-It costs 0.012s
-```
-
-## 时序不对齐
-
-在 `disable align` 对齐方式下,如果 select 子句中有 `n` 列,最终结果就会有该 `n * 2` 列(时间序列的时间和值)。
-
-注:时序不对齐方式不能用于聚合查询、空值填充,但可使用 Limit 和 Offset 语句进行分页。
-
-SQL 形如:
-
-```sql
-select * from root.ln.** where time <= 2017-11-01T00:01:00 disable align
-```
-
-结果如下:
-
-```
-+-----------------------------+--------------------------+-----------------------------+------------------------+-----------------------------+-----------------------------+-----------------------------+------------------------+
-|                         Time|root.ln.wf02.wt02.hardware|                         Time|root.ln.wf02.wt02.status|                         Time|root.ln.wf01.wt01.temperature|                         Time|root.ln.wf01.wt01.status|
-+-----------------------------+--------------------------+-----------------------------+------------------------+-----------------------------+-----------------------------+-----------------------------+------------------------+
-|1970-01-01T08:00:00.001+08:00|                        v1|1970-01-01T08:00:00.001+08:00|                    true|2017-11-01T00:00:00.000+08:00|                        25.96|2017-11-01T00:00:00.000+08:00|                    true|
-|1970-01-01T08:00:00.002+08:00|                        v2|1970-01-01T08:00:00.002+08:00|                   false|2017-11-01T00:01:00.000+08:00|                        24.36|2017-11-01T00:01:00.000+08:00|                    true|
-|2017-11-01T00:00:00.000+08:00|                        v2|2017-11-01T00:00:00.000+08:00|                    true|                         null|                         null|                         null|                    null|
-|2017-11-01T00:01:00.000+08:00|                        v2|2017-11-01T00:01:00.000+08:00|                    true|                         null|                         null|                         null|                    null|
-+-----------------------------+--------------------------+-----------------------------+------------------------+-----------------------------+-----------------------------+-----------------------------+------------------------+
-Total line number = 4
-It costs 0.018s
-```
diff --git a/docs/zh/UserGuide/Query-Data/Select-Expression.md b/docs/zh/UserGuide/Query-Data/Select-Expression.md
index d02f8492c7..b95be40eee 100644
--- a/docs/zh/UserGuide/Query-Data/Select-Expression.md
+++ b/docs/zh/UserGuide/Query-Data/Select-Expression.md
@@ -21,1085 +21,87 @@
 
 # 选择表达式
 
-## 语法定义
-
-选择表达式(`selectExpr`)是 SELECT 子句的组成单元,每个 `selectExpr` 对应查询结果集中的一列,其语法定义如下:
-
-```sql
-selectClause
-    : SELECT resultColumn (',' resultColumn)*
-    ;
-
-resultColumn
-    : selectExpr (AS alias)?
-    ;
-
-selectExpr
-    : '(' selectExpr ')'
-    | '-' selectExpr
-    | '!' selectExpr
-    | selectExpr ('*' | '/' | '%') selectExpr
-    | selectExpr ('+' | '-') selectExpr
-    | selectExpr ('>' | '>=' | '<' | '<=' | '==' | '!=') selectExpr
-    | selectExpr (AND | OR) selectExpr
-    | functionName '(' selectExpr (',' selectExpr)* functionAttribute* ')'
-    | timeSeriesSuffixPath
-    | number
-    ;
-```
-
-由该语法定义可知,`selectExpr` 可以包含:
-
-- 时间序列路径后缀
+`SELECT` 子句指定查询的输出,由若干个 `selectExpr` 组成。 每个 `selectExpr` 定义了查询结果中的一列或多列。
+
+**`selectExpr` 是一个由时间序列路径后缀、常量、函数和运算符组成的表达式。即 `selectExpr` 中可以包含:**
+- 时间序列路径后缀(支持使用通配符)
+- 运算符
+  - 算数运算符
+  - 比较运算符
+  - 逻辑运算符
 - 函数
-  - 内置聚合函数,详见 [聚合查询](./Aggregate-Query.md) 。
-  - 时间序列生成函数
-  - 用户自定义函数,详见 [UDF](../Process-Data/UDF-User-Defined-Function.md) 。
-- 表达式
-  - 算数运算表达式
-  - 逻辑运算表达式
-  - 时间序列查询嵌套表达式
-  - 聚合查询嵌套表达式
-- 数字常量(仅用于表达式)
-
-## 算数运算查询
-
-> 请注意,对齐时间序列和非对齐时间序列在当前版本中没有任何区别,均支持算数运算查询。
-
-### 运算符
-
-#### 一元算数运算符
-
-支持的运算符:`+`, `-`
-
-输入数据类型要求:`INT32`, `INT64`, `FLOAT`, `DOUBLE`
-
-输出数据类型:与输入数据类型一致
-
-#### 二元算数运算符
-
-支持的运算符:`+`, `-`, `*`, `/`,  `%`
-
-输入数据类型要求:`INT32`, `INT64`, `FLOAT`和`DOUBLE`
-
-输出数据类型:`DOUBLE`
-
-注意:当某个时间戳下左操作数和右操作数都不为空(`null`)时,二元运算操作才会有输出结果
-
-### 使用示例
-
-例如:
-
-```sql
-select s1, - s1, s2, + s2, s1 + s2, s1 - s2, s1 * s2, s1 / s2, s1 % s2 from root.sg.d1
-```
-
-结果:
-
-``` 
-+-----------------------------+-------------+--------------+-------------+-------------+-----------------------------+-----------------------------+-----------------------------+-----------------------------+-----------------------------+
-|                         Time|root.sg.d1.s1|-root.sg.d1.s1|root.sg.d1.s2|root.sg.d1.s2|root.sg.d1.s1 + root.sg.d1.s2|root.sg.d1.s1 - root.sg.d1.s2|root.sg.d1.s1 * root.sg.d1.s2|root.sg.d1.s1 / root.sg.d1.s2|root.sg.d1.s1 % root.sg.d1.s2|
-+-----------------------------+-------------+--------------+-------------+-------------+-----------------------------+-----------------------------+-----------------------------+-----------------------------+-----------------------------+
-|1970-01-01T08:00:00.001+08:00|          1.0|          -1.0|          1.0|          1.0|                          2.0|                          0.0|                          1.0|                          1.0|                          0.0|
-|1970-01-01T08:00:00.002+08:00|          2.0|          -2.0|          2.0|          2.0|                          4.0|                          0.0|                          4.0|                          1.0|                          0.0|
-|1970-01-01T08:00:00.003+08:00|          3.0|          -3.0|          3.0|          3.0|                          6.0|                          0.0|                          9.0|                          1.0|                          0.0|
-|1970-01-01T08:00:00.004+08:00|          4.0|          -4.0|          4.0|          4.0|                          8.0|                          0.0|                         16.0|                          1.0|                          0.0|
-|1970-01-01T08:00:00.005+08:00|          5.0|          -5.0|          5.0|          5.0|                         10.0|                          0.0|                         25.0|                          1.0|                          0.0|
-+-----------------------------+-------------+--------------+-------------+-------------+-----------------------------+-----------------------------+-----------------------------+-----------------------------+-----------------------------+
-Total line number = 5
-It costs 0.014s
-```
-
-## 逻辑运算查询
-### 运算符
-#### 一元逻辑运算符
-支持运算符 `!`
-
-输入数据类型:`BOOLEAN`
-
-输出数据类型:`BOOLEAN`
-
-注意:`!`的优先级很高,记得使用括号调整优先级
-
-#### 二元比较运算符
-
-支持运算符 `>`, `>=`, `<`, `<=`, `==`, `!=`
-
-输入数据类型: `INT32`, `INT64`, `FLOAT`, `DOUBLE`
-
-注意:会将所有数据转换为`DOUBLE`类型后进行比较。`==`和`!=`可以直接比较两个`BOOLEAN`
-
-返回类型:`BOOLEAN`
-
-#### 二元逻辑运算符
-
-支持运算符 AND:`and`,`&`, `&&`; OR:`or`,`|`,`||`
-
-输入数据类型:`BOOLEAN`
-
-返回类型 `BOOLEAN`
-
-注意:当某个时间戳下左操作数和右操作数都为`BOOLEAN`类型时,二元逻辑操作才会有输出结果
-
-#### IN 运算符
-
-支持运算符 `IN`
-
-输入数据类型:`All Types`
-
-返回类型 `BOOLEAN`
-
-注意: 请确保集合中的值串可以被转为操作数的类型
-> 例如:
->
->`s1 in (1, 2, 3, 'test')`,`s1`的数据类型是`INT32`
->
-> 我们将会抛出异常,因为`'test'`不能被转为`INT32`类型
-
-#### 字符串匹配运算符
-
-支持运算符 `LIKE`, `REGEXP`
-
-输入数据类型:`TEXT`
-
-返回类型:`BOOLEAN`
-
-### 使用示例
-输入1:
-```sql
-select a, b, a > 10, a <= b, !(a <= b), a > 10 && a > b from root.test;
-```
-输出1:
-```
-IoTDB> select a, b, a > 10, a <= b, !(a <= b), a > 10 && a > b from root.test;
-+-----------------------------+-----------+-----------+----------------+--------------------------+---------------------------+------------------------------------------------+
-|                         Time|root.test.a|root.test.b|root.test.a > 10|root.test.a <= root.test.b|!root.test.a <= root.test.b|(root.test.a > 10) & (root.test.a > root.test.b)|
-+-----------------------------+-----------+-----------+----------------+--------------------------+---------------------------+------------------------------------------------+
-|1970-01-01T08:00:00.001+08:00|         23|       10.0|            true|                     false|                       true|                                            true|
-|1970-01-01T08:00:00.002+08:00|         33|       21.0|            true|                     false|                       true|                                            true|
-|1970-01-01T08:00:00.004+08:00|         13|       15.0|            true|                      true|                      false|                                           false|
-|1970-01-01T08:00:00.005+08:00|         26|        0.0|            true|                     false|                       true|                                            true|
-|1970-01-01T08:00:00.008+08:00|          1|       22.0|           false|                      true|                      false|                                           false|
-|1970-01-01T08:00:00.010+08:00|         23|       12.0|            true|                     false|                       true|                                            true|
-+-----------------------------+-----------+-----------+----------------+--------------------------+---------------------------+------------------------------------------------+
-```
-
-输入2:
-```sql
-select a, b, a in (1, 2), b like '1%', b regexp '[0-2]' from root.test;
-```
-
-输出2:
-```
-+-----------------------------+-----------+-----------+--------------------+-------------------------+--------------------------+
-|                         Time|root.test.a|root.test.b|root.test.a IN (1,2)|root.test.b LIKE '^1.*?$'|root.test.b REGEXP '[0-2]'|
-+-----------------------------+-----------+-----------+--------------------+-------------------------+--------------------------+
-|1970-01-01T08:00:00.001+08:00|          1| 111test111|                true|                     true|                      true|
-|1970-01-01T08:00:00.003+08:00|          3| 333test333|               false|                    false|                     false|
-+-----------------------------+-----------+-----------+--------------------+-------------------------+--------------------------+
-```
-
-## 运算符优先级
-
-|优先级  |运算符  |含义         |
-|-------|-------|-----------|
-|1      |`-`    |单目运算符负号  |
-|1      |`+`    |单目运算符正号  |
-|1      |`!`    |单目运算符取非  |
-|2      |`*`    |双目运算符乘    |
-|2      |`/`    |双目运算符除    |
-|2      |`%`    |双目运算符取余|
-|3      |`+`    |双目运算符加|
-|3      |`-`    |双目运算符减|
-|4      |`>`    |双目比较运算符大于|
-|4      |`>=`    |双目比较运算符大于等于|
-|4      |`<`    |双目比较运算符小于|
-|4      |`<=`    |双目比较运算符小于等于|
-|4      |`==`    |双目比较运算符等于|
-|4      |`!=`/`<>`    |双目比较运算符不等于|
-|5      |`REGEXP`   |`REGEXP`运算符|
-|5      |`LIKE`    |`LIKE`运算符|
-|6      |`IN`    |`IN`运算符|
-|7      |`and`/`&`/`&&`|双目逻辑运算符与|
-|8      |`or`/ &#124; / &#124;&#124;|双目逻辑运算符或|
-<!--- &#124;即管道符 转义不能用在``里, 表格内不允许使用管道符 -->
-
-## 内置时间序列生成函数
-
-时间序列生成函数可接受若干原始时间序列作为输入,产生一列时间序列输出。与聚合函数不同的是,时间序列生成函数的结果集带有时间戳列。
-
-所有的时间序列生成函数都可以接受 * 作为输入,都可以与原始查询混合进行。
-
-> 请注意,目前对齐时间序列(Aligned Timeseries)尚不支持内置函数查询。使用内置函数时,如果自变量包含对齐时间序列,会提示错误。
-
-### 数学函数
-
-目前 IoTDB 支持下列数学函数,这些数学函数的行为与这些函数在 Java Math 标准库中对应实现的行为一致。
-
-| 函数名  | 输入序列类型                   | 输出序列类型             | Java 标准库中的对应实现                                      |
-| ------- | ------------------------------ | ------------------------ | ------------------------------------------------------------ |
-| SIN     | INT32 / INT64 / FLOAT / DOUBLE | DOUBLE                   | Math#sin(double)                                             |
-| COS     | INT32 / INT64 / FLOAT / DOUBLE | DOUBLE                   | Math#cos(double)                                             |
-| TAN     | INT32 / INT64 / FLOAT / DOUBLE | DOUBLE                   | Math#tan(double)                                             |
-| ASIN    | INT32 / INT64 / FLOAT / DOUBLE | DOUBLE                   | Math#asin(double)                                            |
-| ACOS    | INT32 / INT64 / FLOAT / DOUBLE | DOUBLE                   | Math#acos(double)                                            |
-| ATAN    | INT32 / INT64 / FLOAT / DOUBLE | DOUBLE                   | Math#atan(double)                                            |
-| SINH    | INT32 / INT64 / FLOAT / DOUBLE | DOUBLE                   | Math#sinh(double)                                            |
-| COSH    | INT32 / INT64 / FLOAT / DOUBLE | DOUBLE                   | Math#cosh(double)                                            |
-| TANH    | INT32 / INT64 / FLOAT / DOUBLE | DOUBLE                   | Math#tanh(double)                                            |
-| DEGREES | INT32 / INT64 / FLOAT / DOUBLE | DOUBLE                   | Math#toDegrees(double)                                       |
-| RADIANS | INT32 / INT64 / FLOAT / DOUBLE | DOUBLE                   | Math#toRadians(double)                                       |
-| ABS     | INT32 / INT64 / FLOAT / DOUBLE | 与输入序列的实际类型一致 | Math#abs(int) / Math#abs(long) /Math#abs(float) /Math#abs(double) |
-| SIGN    | INT32 / INT64 / FLOAT / DOUBLE | DOUBLE                   | Math#signum(double)                                          |
-| CEIL    | INT32 / INT64 / FLOAT / DOUBLE | DOUBLE                   | Math#ceil(double)                                            |
-| FLOOR   | INT32 / INT64 / FLOAT / DOUBLE | DOUBLE                   | Math#floor(double)                                           |
-| ROUND   | INT32 / INT64 / FLOAT / DOUBLE | DOUBLE                   | Math#rint(double)                                            |
-| EXP     | INT32 / INT64 / FLOAT / DOUBLE | DOUBLE                   | Math#exp(double)                                             |
-| LN      | INT32 / INT64 / FLOAT / DOUBLE | DOUBLE                   | Math#log(double)                                             |
-| LOG10   | INT32 / INT64 / FLOAT / DOUBLE | DOUBLE                   | Math#log10(double)                                           |
-| SQRT    | INT32 / INT64 / FLOAT / DOUBLE | DOUBLE                   | Math#sqrt(double)                                            |
-
-例如:
-
-```   sql
-select s1, sin(s1), cos(s1), tan(s1) from root.sg1.d1 limit 5 offset 1000;
-```
-
-结果:
-
-```
-+-----------------------------+-------------------+-------------------+--------------------+-------------------+
-|                         Time|     root.sg1.d1.s1|sin(root.sg1.d1.s1)| cos(root.sg1.d1.s1)|tan(root.sg1.d1.s1)|
-+-----------------------------+-------------------+-------------------+--------------------+-------------------+
-|2020-12-10T17:11:49.037+08:00|7360723084922759782| 0.8133527237573284|  0.5817708713544664| 1.3980636773094157|
-|2020-12-10T17:11:49.038+08:00|4377791063319964531|-0.8938962705202537|  0.4482738644511651| -1.994085181866842|
-|2020-12-10T17:11:49.039+08:00|7972485567734642915| 0.9627757585308978|-0.27030138509681073|-3.5618602479083545|
-|2020-12-10T17:11:49.040+08:00|2508858212791964081|-0.6073417341629443| -0.7944406950452296| 0.7644897069734913|
-|2020-12-10T17:11:49.041+08:00|2817297431185141819|-0.8419358900502509| -0.5395775727782725| 1.5603611649667768|
-+-----------------------------+-------------------+-------------------+--------------------+-------------------+
-Total line number = 5
-It costs 0.008s
-```
-
-### 字符串函数
-
-目前 IoTDB 支持下列字符串处理函数:
-
-| 函数名          | 输入序列类型 | 必要的属性参数                       | 输出序列类型 | 功能描述                                  |
-| --------------- | ------------ | ------------------------------------ | ------------ | ----------------------------------------- |
-| STRING_CONTAINS | TEXT         | `s`: 待搜寻的字符串                  | BOOLEAN      | 判断字符串中是否存在`s`                   |
-| STRING_MATCHES  | TEXT         | `regex`: Java 标准库风格的正则表达式 | BOOLEAN      | 判断字符串是否能够被正则表达式`regex`匹配 |
+  - 聚合函数
+  - 时间序列生成函数(包括内置函数和用户自定义函数)
+- 常量
 
-例如:
-
-```   sql
-select s1, string_contains(s1, 's'='warn'), string_matches(s1, 'regex'='[^\\s]+37229') from root.sg1.d4;
-```
-
-结果:
-
-``` 
-+-----------------------------+--------------+-------------------------------------------+------------------------------------------------------+
-|                         Time|root.sg1.d4.s1|string_contains(root.sg1.d4.s1, "s"="warn")|string_matches(root.sg1.d4.s1, "regex"="[^\\s]+37229")|
-+-----------------------------+--------------+-------------------------------------------+------------------------------------------------------+
-|1970-01-01T08:00:00.001+08:00|    warn:-8721|                                       true|                                                 false|
-|1970-01-01T08:00:00.002+08:00|  error:-37229|                                      false|                                                  true|
-|1970-01-01T08:00:00.003+08:00|     warn:1731|                                       true|                                                 false|
-+-----------------------------+--------------+-------------------------------------------+------------------------------------------------------+
-Total line number = 3
-It costs 0.007s
-```
-
-### 选择函数
-
-目前 IoTDB 支持如下选择函数:
-
-| 函数名   | 输入序列类型                          | 必要的属性参数                                    | 输出序列类型             | 功能描述                                                     |
-| -------- | ------------------------------------- | ------------------------------------------------- | ------------------------ | ------------------------------------------------------------ |
-| TOP_K    | INT32 / INT64 / FLOAT / DOUBLE / TEXT | `k`: 最多选择的数据点数,必须大于 0 小于等于 1000 | 与输入序列的实际类型一致 | 返回某时间序列中值最大的`k`个数据点。若多于`k`个数据点的值并列最大,则返回时间戳最小的数据点。 |
-| BOTTOM_K | INT32 / INT64 / FLOAT / DOUBLE / TEXT | `k`: 最多选择的数据点数,必须大于 0 小于等于 1000 | 与输入序列的实际类型一致 | 返回某时间序列中值最小的`k`个数据点。若多于`k`个数据点的值并列最小,则返回时间戳最小的数据点。 |
-
-例如:
-
-```   sql
-select s1, top_k(s1, 'k'='2'), bottom_k(s1, 'k'='2') from root.sg1.d2 where time > 2020-12-10T20:36:15.530+08:00;
-```
-
-结果:
-
-``` 
-+-----------------------------+--------------------+------------------------------+---------------------------------+
-|                         Time|      root.sg1.d2.s1|top_k(root.sg1.d2.s1, "k"="2")|bottom_k(root.sg1.d2.s1, "k"="2")|
-+-----------------------------+--------------------+------------------------------+---------------------------------+
-|2020-12-10T20:36:15.531+08:00| 1531604122307244742|           1531604122307244742|                             null|
-|2020-12-10T20:36:15.532+08:00|-7426070874923281101|                          null|                             null|
-|2020-12-10T20:36:15.533+08:00|-7162825364312197604|          -7162825364312197604|                             null|
-|2020-12-10T20:36:15.534+08:00|-8581625725655917595|                          null|             -8581625725655917595|
-|2020-12-10T20:36:15.535+08:00|-7667364751255535391|                          null|             -7667364751255535391|
-+-----------------------------+--------------------+------------------------------+---------------------------------+
-Total line number = 5
-It costs 0.006s
-```
-
-### 趋势计算函数
-
-目前 IoTDB 支持如下趋势计算函数:
-
-| 函数名                  | 输入序列类型                                    | 输出序列类型             | 功能描述                                                     |
-| ----------------------- | ----------------------------------------------- | ------------------------ | ------------------------------------------------------------ |
-| TIME_DIFFERENCE         | INT32 / INT64 / FLOAT / DOUBLE / BOOLEAN / TEXT | INT64                    | 统计序列中某数据点的时间戳与前一数据点时间戳的差。范围内第一个数据点没有对应的结果输出。 |
-| DIFFERENCE              | INT32 / INT64 / FLOAT / DOUBLE                  | 与输入序列的实际类型一致 | 统计序列中某数据点的值与前一数据点的值的差。范围内第一个数据点没有对应的结果输出。 |
-| NON_NEGATIVE_DIFFERENCE | INT32 / INT64 / FLOAT / DOUBLE                  | 与输入序列的实际类型一致 | 统计序列中某数据点的值与前一数据点的值的差的绝对值。范围内第一个数据点没有对应的结果输出。 |
-| DERIVATIVE              | INT32 / INT64 / FLOAT / DOUBLE                  | DOUBLE                   | 统计序列中某数据点相对于前一数据点的变化率,数量上等同于 DIFFERENCE /  TIME_DIFFERENCE。范围内第一个数据点没有对应的结果输出。 |
-| NON_NEGATIVE_DERIVATIVE | INT32 / INT64 / FLOAT / DOUBLE                  | DOUBLE                   | 统计序列中某数据点相对于前一数据点的变化率的绝对值,数量上等同于 NON_NEGATIVE_DIFFERENCE /  TIME_DIFFERENCE。范围内第一个数据点没有对应的结果输出。 |
-
-例如:
-
-```   sql
-select s1, time_difference(s1), difference(s1), non_negative_difference(s1), derivative(s1), non_negative_derivative(s1) from root.sg1.d1 limit 5 offset 1000; 
-```
-
-结果:
-
-``` 
-+-----------------------------+-------------------+-------------------------------+--------------------------+---------------------------------------+--------------------------+---------------------------------------+
-|                         Time|     root.sg1.d1.s1|time_difference(root.sg1.d1.s1)|difference(root.sg1.d1.s1)|non_negative_difference(root.sg1.d1.s1)|derivative(root.sg1.d1.s1)|non_negative_derivative(root.sg1.d1.s1)|
-+-----------------------------+-------------------+-------------------------------+--------------------------+---------------------------------------+--------------------------+---------------------------------------+
-|2020-12-10T17:11:49.037+08:00|7360723084922759782|                              1|      -8431715764844238876|                    8431715764844238876|    -8.4317157648442388E18|                  8.4317157648442388E18|
-|2020-12-10T17:11:49.038+08:00|4377791063319964531|                              1|      -2982932021602795251|                    2982932021602795251|     -2.982932021602795E18|                   2.982932021602795E18|
-|2020-12-10T17:11:49.039+08:00|7972485567734642915|                              1|       3594694504414678384|                    3594694504414678384|     3.5946945044146785E18|                  3.5946945044146785E18|
-|2020-12-10T17:11:49.040+08:00|2508858212791964081|                              1|      -5463627354942678834|                    5463627354942678834|     -5.463627354942679E18|                   5.463627354942679E18|
-|2020-12-10T17:11:49.041+08:00|2817297431185141819|                              1|        308439218393177738|                     308439218393177738|     3.0843921839317773E17|                  3.0843921839317773E17|
-+-----------------------------+-------------------+-------------------------------+--------------------------+---------------------------------------+--------------------------+---------------------------------------+
-Total line number = 5
-It costs 0.014s
-```
-
-### 常序列生成函数
-
-常序列生成函数用于生成所有数据点的值都相同的时间序列。
-
-常序列生成函数接受一个或者多个时间序列输入,其输出的数据点的时间戳集合是这些输入序列时间戳集合的并集。
-
-目前 IoTDB 支持如下常序列生成函数:
-
-| 函数名 | 必要的属性参数                                               | 输出序列类型               | 功能描述                                                     |
-| ------ | ------------------------------------------------------------ | -------------------------- | ------------------------------------------------------------ |
-| CONST  | `value`: 输出的数据点的值 <br />`type`: 输出的数据点的类型,只能是 INT32 / INT64 / FLOAT / DOUBLE / BOOLEAN / TEXT | 由输入属性参数 `type` 决定 | 根据输入属性 `value` 和 `type` 输出用户指定的常序列。        |
-| PI     | 无                                                           | DOUBLE                     | 常序列的值:`π` 的 `double` 值,圆的周长与其直径的比值,即圆周率,等于 *Java标准库* 中的`Math.PI`。 |
-| E      | 无                                                           | DOUBLE                     | 常序列的值:`e` 的 `double` 值,自然对数的底,它等于 *Java 标准库*  中的 `Math.E`。 |
-
-例如:
-
-```   sql
-select s1, s2, const(s1, 'value'='1024', 'type'='INT64'), pi(s2), e(s1, s2) from root.sg1.d1; 
-```
-
-结果:
-
-```
-select s1, s2, const(s1, 'value'='1024', 'type'='INT64'), pi(s2), e(s1, s2) from root.sg1.d1; 
-+-----------------------------+--------------+--------------+-----------------------------------------------------+------------------+---------------------------------+
-|                         Time|root.sg1.d1.s1|root.sg1.d1.s2|const(root.sg1.d1.s1, "value"="1024", "type"="INT64")|pi(root.sg1.d1.s2)|e(root.sg1.d1.s1, root.sg1.d1.s2)|
-+-----------------------------+--------------+--------------+-----------------------------------------------------+------------------+---------------------------------+
-|1970-01-01T08:00:00.000+08:00|           0.0|           0.0|                                                 1024| 3.141592653589793|                2.718281828459045|
-|1970-01-01T08:00:00.001+08:00|           1.0|          null|                                                 1024|              null|                2.718281828459045|
-|1970-01-01T08:00:00.002+08:00|           2.0|          null|                                                 1024|              null|                2.718281828459045|
-|1970-01-01T08:00:00.003+08:00|          null|           3.0|                                                 null| 3.141592653589793|                2.718281828459045|
-|1970-01-01T08:00:00.004+08:00|          null|           4.0|                                                 null| 3.141592653589793|                2.718281828459045|
-+-----------------------------+--------------+--------------+-----------------------------------------------------+------------------+---------------------------------+
-Total line number = 5
-It costs 0.005s
-```
-
-### 数据类型转换函数
-
-当前IoTDB支持6种数据类型,其中包括INT32、INT64、FLOAT、DOUBLE、BOOLEAN以及TEXT。当我们对数据进行查询或者计算时可能需要进行数据类型的转换, 比如说将TEXT转换为INT32,或者提高数据精度,比如说将FLOAT转换为DOUBLE。所以,IoTDB支持使用cast函数对数据类型进行转换。  
-
-| 函数名 | 必要的属性参数                                               | 输出序列类型             | 功能类型                           |
-| ------ | ------------------------------------------------------------ | ------------------------ | ---------------------------------- |
-| CAST   | `type`:输出的数据点的类型,只能是 INT32 / INT64 / FLOAT / DOUBLE / BOOLEAN / TEXT | 由输入属性参数`type`决定 | 将数据转换为`type`参数指定的类型。 |
-
-##### 类型转换说明
-
-1.当INT32、INT64类型的值不为0时,FLOAT与DOUBLE类型的值不为0.0时,TEXT类型不为空字符串或者"false"时,转换为BOOLEAN类型时值为true,否则为false。
-
-```
-IoTDB> show timeseries root.sg.d1.*;
-+-------------+-----+-------------+--------+--------+-----------+----+----------+
-|   timeseries|alias|database|dataType|encoding|compression|tags|attributes|
-+-------------+-----+-------------+--------+--------+-----------+----+----------+
-|root.sg.d1.s3| null|      root.sg|   FLOAT|     RLE|     SNAPPY|null|      null|
-|root.sg.d1.s4| null|      root.sg|  DOUBLE|     RLE|     SNAPPY|null|      null|
-|root.sg.d1.s5| null|      root.sg|    TEXT|   PLAIN|     SNAPPY|null|      null|
-|root.sg.d1.s6| null|      root.sg| BOOLEAN|     RLE|     SNAPPY|null|      null|
-|root.sg.d1.s1| null|      root.sg|   INT32|     RLE|     SNAPPY|null|      null|
-|root.sg.d1.s2| null|      root.sg|   INT64|     RLE|     SNAPPY|null|      null|
-+-------------+-----+-------------+--------+--------+-----------+----+----------+
-Total line number = 6
-It costs 0.006s
-IoTDB> select * from root.sg.d1;
-+-----------------------------+-------------+-------------+-------------+-------------+-------------+-------------+
-|                         Time|root.sg.d1.s3|root.sg.d1.s4|root.sg.d1.s5|root.sg.d1.s6|root.sg.d1.s1|root.sg.d1.s2|
-+-----------------------------+-------------+-------------+-------------+-------------+-------------+-------------+
-|1970-01-01T08:00:00.001+08:00|          1.1|          1.1|         test|        false|            1|            1|
-|1970-01-01T08:00:00.002+08:00|         -2.2|         -2.2|        false|         true|           -2|           -2|
-|1970-01-01T08:00:00.003+08:00|          0.0|          0.0|         true|         true|            0|            0|
-+-----------------------------+-------------+-------------+-------------+-------------+-------------+-------------+
-Total line number = 3
-It costs 0.009s
-IoTDB> select cast(s1, 'type'='BOOLEAN'), cast(s2, 'type'='BOOLEAN'), cast(s3, 'type'='BOOLEAN'), cast(s4, 'type'='BOOLEAN'), cast(s5, 'type'='BOOLEAN') from root.sg.d1;
-+-----------------------------+-------------------------------------+-------------------------------------+-------------------------------------+-------------------------------------+-------------------------------------+
-|                         Time|cast(root.sg.d1.s1, "type"="BOOLEAN")|cast(root.sg.d1.s2, "type"="BOOLEAN")|cast(root.sg.d1.s3, "type"="BOOLEAN")|cast(root.sg.d1.s4, "type"="BOOLEAN")|cast(root.sg.d1.s5, "type"="BOOLEAN")|
-+-----------------------------+-------------------------------------+-------------------------------------+-------------------------------------+-------------------------------------+-------------------------------------+
-|1970-01-01T08:00:00.001+08:00|                                 true|                                 true|                                 true|                                 true|                                 true|
-|1970-01-01T08:00:00.002+08:00|                                 true|                                 true|                                 true|                                 true|                                false|
-|1970-01-01T08:00:00.003+08:00|                                false|                                false|                                false|                                false|                                 true|
-+-----------------------------+-------------------------------------+-------------------------------------+-------------------------------------+-------------------------------------+-------------------------------------+
-Total line number = 3
-It costs 0.012s
-```
-
-2.当BOOLEAN类型的值为true时,转换为INT32与INT64类型的值为1,转换为FLOAT或者DOUBLE类型时值为1.0,转换为TEXT类型时值为"true"。当BOOLEAN类型的值为false时,转换为INT32与INT64类型的值为0,转换为FLOAT或者DOUBLE类型时值为0.0,转换为TEXT类型时值为"false"。  
-
-```
-IoTDB> select cast(s6, 'type'='INT32'), cast(s6, 'type'='INT64'), cast(s6, 'type'='FLOAT'), cast(s6, 'type'='DOUBLE'), cast(s6, 'type'='TEXT') from root.sg.d1;
-+-----------------------------+-----------------------------------+-----------------------------------+-----------------------------------+------------------------------------+----------------------------------+
-|                         Time|cast(root.sg.d1.s6, "type"="INT32")|cast(root.sg.d1.s6, "type"="INT64")|cast(root.sg.d1.s6, "type"="FLOAT")|cast(root.sg.d1.s6, "type"="DOUBLE")|cast(root.sg.d1.s6, "type"="TEXT")|
-+-----------------------------+-----------------------------------+-----------------------------------+-----------------------------------+------------------------------------+----------------------------------+
-|1970-01-01T08:00:00.001+08:00|                                  0|                                  0|                                0.0|                                 0.0|                             false|
-|1970-01-01T08:00:00.002+08:00|                                  1|                                  1|                                1.0|                                 1.0|                              true|
-|1970-01-01T08:00:00.003+08:00|                                  1|                                  1|                                1.0|                                 1.0|                              true|
-+-----------------------------+-----------------------------------+-----------------------------------+-----------------------------------+------------------------------------+----------------------------------+
-Total line number = 3
-It costs 0.016s
-```
-
-3.当TEXT类型转换为INT32、INT64、FLOAT类型时,会先将TEXT类型的数据转换为DOUBLE类型,然后再转换为对应的类型,此时可能会存在损失精度的问题。如果无法转换的话则直接跳过。
-
-```
-IoTDB> select cast(s5, 'type'='INT32'), cast(s5, 'type'='INT64'), cast(s5, 'type'='FLOAT') from root.sg.d1;
-+----+-----------------------------------+-----------------------------------+-----------------------------------+
-|Time|cast(root.sg.d1.s5, "type"="INT32")|cast(root.sg.d1.s5, "type"="INT64")|cast(root.sg.d1.s5, "type"="FLOAT")|
-+----+-----------------------------------+-----------------------------------+-----------------------------------+
-+----+-----------------------------------+-----------------------------------+-----------------------------------+
-Empty set.
-It costs 0.009s
-```
-
-
-
-##### 演示
-测试数据:
-```
-IoTDB> select text from root.test;
-+-----------------------------+--------------+
-|                         Time|root.test.text|
-+-----------------------------+--------------+
-|1970-01-01T08:00:00.001+08:00|           1.1|
-|1970-01-01T08:00:00.002+08:00|             1|
-|1970-01-01T08:00:00.003+08:00|   hello world|
-|1970-01-01T08:00:00.004+08:00|         false|
-+-----------------------------+--------------+
-```
-SQL语句:
-```sql
-select cast(text, 'type'='BOOLEAN'), cast(text, 'type'='INT32'), cast(text, 'type'='INT64'), cast(text, 'type'='FLOAT'), cast(text, 'type'='DOUBLE') from root.test;
-```
-结果:
-```
-+-----------------------------+--------------------------------------+------------------------------------+------------------------------------+------------------------------------+-------------------------------------+
-|                         Time|cast(root.test.text, "type"="BOOLEAN")|cast(root.test.text, "type"="INT32")|cast(root.test.text, "type"="INT64")|cast(root.test.text, "type"="FLOAT")|cast(root.test.text, "type"="DOUBLE")|
-+-----------------------------+--------------------------------------+------------------------------------+------------------------------------+------------------------------------+-------------------------------------+
-|1970-01-01T08:00:00.001+08:00|                                  true|                                   1|                                   1|                                 1.1|                                  1.1|
-|1970-01-01T08:00:00.002+08:00|                                  true|                                   1|                                   1|                                 1.0|                                  1.0|
-|1970-01-01T08:00:00.003+08:00|                                  true|                                null|                                null|                                null|                                 null|
-|1970-01-01T08:00:00.004+08:00|                                 false|                                null|                                null|                                null|                                 null|
-+-----------------------------+--------------------------------------+------------------------------------+------------------------------------+------------------------------------+-------------------------------------+
-Total line number = 4
-It costs 0.078s
-```
-
-### 条件函数
-条件函数针对每个数据点进行条件判断,返回布尔值
-
-目前IoTDB支持以下条件函数
-
-| 函数名      | 可接收的输入序列类型                     | 必要的属性参数                               | 输出序列类型     | 功能类型                                             |
-|----------|--------------------------------|---------------------------------------|------------|--------------------------------------------------|
-| ON_OFF   | INT32 / INT64 / FLOAT / DOUBLE | `threshold`:DOUBLE类型                  | BOOLEAN 类型 | 返回`ts_value >= threshold`的bool值                  |
-| IN_RANGE | INT32 / INT64 / FLOAT / DOUBLE | `lower`:DOUBLE类型<br/>`upper`:DOUBLE类型 | BOOLEAN类型  | 返回`ts_value >= lower && ts_value <= upper`的bool值 |                                                    |
-
-测试数据:
-```
-IoTDB> select ts from root.test;
-+-----------------------------+------------+
-|                         Time|root.test.ts|
-+-----------------------------+------------+
-|1970-01-01T08:00:00.001+08:00|           1|
-|1970-01-01T08:00:00.002+08:00|           2|
-|1970-01-01T08:00:00.003+08:00|           3|
-|1970-01-01T08:00:00.004+08:00|           4|
-+-----------------------------+------------+
-```
-
-##### 测试1
-
-SQL语句:
-```sql
-select ts, on_off(ts, 'threshold'='2') from root.test;
-```
-
-输出:
-```
-IoTDB> select ts, on_off(ts, 'threshold'='2') from root.test;
-+-----------------------------+------------+-------------------------------------+
-|                         Time|root.test.ts|on_off(root.test.ts, "threshold"="2")|
-+-----------------------------+------------+-------------------------------------+
-|1970-01-01T08:00:00.001+08:00|           1|                                false|
-|1970-01-01T08:00:00.002+08:00|           2|                                 true|
-|1970-01-01T08:00:00.003+08:00|           3|                                 true|
-|1970-01-01T08:00:00.004+08:00|           4|                                 true|
-+-----------------------------+------------+-------------------------------------+
-```
-
-##### 测试2
-Sql语句:
-```sql
-select ts, in_range(ts, 'lower'='2', 'upper'='3.1') from root.test;
-```
-
-输出:
-```
-IoTDB> select ts, in_range(ts, 'lower'='2', 'upper'='3.1') from root.test;
-+-----------------------------+------------+--------------------------------------------------+
-|                         Time|root.test.ts|in_range(root.test.ts, "lower"="2", "upper"="3.1")|
-+-----------------------------+------------+--------------------------------------------------+
-|1970-01-01T08:00:00.001+08:00|           1|                                             false|
-|1970-01-01T08:00:00.002+08:00|           2|                                              true|
-|1970-01-01T08:00:00.003+08:00|           3|                                              true|
-|1970-01-01T08:00:00.004+08:00|           4|                                             false|
-+-----------------------------+------------+--------------------------------------------------+
-```
-
-### 连续满足区间函数
-连续满足条件区间函数用来查询所有满足指定条件的连续区间。
-按返回值可分为两类:
-  1. 返回满足条件连续区间的起始时间戳和时间跨度(时间跨度为0表示此处只有起始时间这一个数据点满足条件)
-  2. 返回满足条件连续区间的起始时间戳和后面连续满足条件的点的个数(个数为1表示此处只有起始时间这一个数据点满足条件)
-
-| 函数名               | 输入序列类型                               | 属性参数                                           | 输出序列类型 | 功能描述                                                             |
-|-------------------|--------------------------------------|------------------------------------------------|-------|------------------------------------------------------------------|
-| ZERO_DURATION     | INT32/ INT64/ FLOAT/ DOUBLE/ BOOLEAN | `min`:可选,默认值0</br>`max`:可选,默认值`Long.MAX_VALUE` | Long  | 返回时间序列连续为0(false)的开始时间与持续时间,持续时间t(单位ms)满足`t >= min && t <= max`  |
-| NON_ZERO_DURATION | INT32/ INT64/ FLOAT/ DOUBLE/ BOOLEAN | `min`:可选,默认值0</br>`max`:可选,默认值`Long.MAX_VALUE` | Long  | 返回时间序列连续不为0(false)的开始时间与持续时间,持续时间t(单位ms)满足`t >= min && t <= max` |               |
-| ZERO_COUNT        | INT32/ INT64/ FLOAT/ DOUBLE/ BOOLEAN | `min`:可选,默认值1</br>`max`:可选,默认值`Long.MAX_VALUE` | Long  | 返回时间序列连续为0(false)的开始时间与其后数据点的个数,数据点个数n满足`n >= min && n <= max`   |               |
-| NON_ZERO_COUNT    | INT32/ INT64/ FLOAT/ DOUBLE/ BOOLEAN | `min`:可选,默认值1</br>`max`:可选,默认值`Long.MAX_VALUE` | Long  | 返回时间序列连续不为0(false)的开始时间与其后数据点的个数,数据点个数n满足`n >= min && n <= max`  |               |
-
-##### 演示
-测试数据:
-```
-IoTDB> select s1,s2,s3,s4,s5 from root.sg.d2;
-+-----------------------------+-------------+-------------+-------------+-------------+-------------+
-|                         Time|root.sg.d2.s1|root.sg.d2.s2|root.sg.d2.s3|root.sg.d2.s4|root.sg.d2.s5|
-+-----------------------------+-------------+-------------+-------------+-------------+-------------+
-|1970-01-01T08:00:00.000+08:00|            0|            0|          0.0|          0.0|        false|
-|1970-01-01T08:00:00.001+08:00|            1|            1|          1.0|          1.0|         true|
-|1970-01-01T08:00:00.002+08:00|            1|            1|          1.0|          1.0|         true|
-|1970-01-01T08:00:00.003+08:00|            0|            0|          0.0|          0.0|        false|
-|1970-01-01T08:00:00.004+08:00|            1|            1|          1.0|          1.0|         true|
-|1970-01-01T08:00:00.005+08:00|            0|            0|          0.0|          0.0|        false|
-|1970-01-01T08:00:00.006+08:00|            0|            0|          0.0|          0.0|        false|
-|1970-01-01T08:00:00.007+08:00|            1|            1|          1.0|          1.0|         true|
-+-----------------------------+-------------+-------------+-------------+-------------+-------------+
-```
-sql:
-```sql
-select s1, zero_count(s1), non_zero_count(s2), zero_duration(s3), non_zero_duration(s4) from root.sg.d2;
-```
-结果:
-```
-+-----------------------------+-------------+-------------------------+-----------------------------+----------------------------+--------------------------------+
-|                         Time|root.sg.d2.s1|zero_count(root.sg.d2.s1)|non_zero_count(root.sg.d2.s2)|zero_duration(root.sg.d2.s3)|non_zero_duration(root.sg.d2.s4)|
-+-----------------------------+-------------+-------------------------+-----------------------------+----------------------------+--------------------------------+
-|1970-01-01T08:00:00.000+08:00|            0|                        1|                         null|                           0|                            null|
-|1970-01-01T08:00:00.001+08:00|            1|                     null|                            2|                        null|                               1|
-|1970-01-01T08:00:00.002+08:00|            1|                     null|                         null|                        null|                            null|
-|1970-01-01T08:00:00.003+08:00|            0|                        1|                         null|                           0|                            null|
-|1970-01-01T08:00:00.004+08:00|            1|                     null|                            1|                        null|                               0|
-|1970-01-01T08:00:00.005+08:00|            0|                        2|                         null|                           1|                            null|
-|1970-01-01T08:00:00.006+08:00|            0|                     null|                         null|                        null|                            null|
-|1970-01-01T08:00:00.007+08:00|            1|                     null|                            1|                        null|                               0|
-+-----------------------------+-------------+-------------------------+-----------------------------+----------------------------+--------------------------------+
-```
-
-### 等数量分桶降采样函数
-本函数对输入序列进行等数量分桶采样,即根据用户给定的降采样比例和降采样方法将输入序列按固定点数等分为若干桶。在每个桶内通过给定的采样方法进行采样。
-- `proportion`:降采样比例,取值区间为`(0, 1]`。
-#### 等数量分桶随机采样
-对等数量分桶后,桶内进行随机采样。
-
-| 函数名      | 可接收的输入序列类型                     | 必要的属性参数                               | 输出序列类型     | 功能类型                                             |
-|----------|--------------------------------|---------------------------------------|------------|--------------------------------------------------|
-| EQUAL_SIZE_BUCKET_RANDOM_SAMPLE   | INT32 / INT64 / FLOAT / DOUBLE | `proportion`取值范围为`(0, 1]`,默认为`0.1`  | INT32 / INT64 / FLOAT / DOUBLE | 返回符合采样比例的等分桶随机采样                |
-
-##### 演示
-测试数据:`root.ln.wf01.wt01.temperature`从`0.0-99.0`共`100`条有序数据。
-```
-IoTDB> select temperature from root.ln.wf01.wt01;
-+-----------------------------+-----------------------------+
-|                         Time|root.ln.wf01.wt01.temperature|
-+-----------------------------+-----------------------------+
-|1970-01-01T08:00:00.000+08:00|                          0.0|
-|1970-01-01T08:00:00.001+08:00|                          1.0|
-|1970-01-01T08:00:00.002+08:00|                          2.0|
-|1970-01-01T08:00:00.003+08:00|                          3.0|
-|1970-01-01T08:00:00.004+08:00|                          4.0|
-|1970-01-01T08:00:00.005+08:00|                          5.0|
-|1970-01-01T08:00:00.006+08:00|                          6.0|
-|1970-01-01T08:00:00.007+08:00|                          7.0|
-|1970-01-01T08:00:00.008+08:00|                          8.0|
-|1970-01-01T08:00:00.009+08:00|                          9.0|
-|1970-01-01T08:00:00.010+08:00|                         10.0|
-|1970-01-01T08:00:00.011+08:00|                         11.0|
-|1970-01-01T08:00:00.012+08:00|                         12.0|
-|.............................|.............................|            
-|1970-01-01T08:00:00.089+08:00|                         89.0|
-|1970-01-01T08:00:00.090+08:00|                         90.0|
-|1970-01-01T08:00:00.091+08:00|                         91.0|
-|1970-01-01T08:00:00.092+08:00|                         92.0|
-|1970-01-01T08:00:00.093+08:00|                         93.0|
-|1970-01-01T08:00:00.094+08:00|                         94.0|
-|1970-01-01T08:00:00.095+08:00|                         95.0|
-|1970-01-01T08:00:00.096+08:00|                         96.0|
-|1970-01-01T08:00:00.097+08:00|                         97.0|
-|1970-01-01T08:00:00.098+08:00|                         98.0|
-|1970-01-01T08:00:00.099+08:00|                         99.0|
-+-----------------------------+-----------------------------+
-```
-sql:
-```sql
-select equal_size_bucket_random_sample(temperature,'proportion'='0.1') as random_sample from root.ln.wf01.wt01;
-```
-结果:
-```
-+-----------------------------+-------------+
-|                         Time|random_sample|
-+-----------------------------+-------------+
-|1970-01-01T08:00:00.007+08:00|          7.0|
-|1970-01-01T08:00:00.014+08:00|         14.0|
-|1970-01-01T08:00:00.020+08:00|         20.0|
-|1970-01-01T08:00:00.035+08:00|         35.0|
-|1970-01-01T08:00:00.047+08:00|         47.0|
-|1970-01-01T08:00:00.059+08:00|         59.0|
-|1970-01-01T08:00:00.063+08:00|         63.0|
-|1970-01-01T08:00:00.079+08:00|         79.0|
-|1970-01-01T08:00:00.086+08:00|         86.0|
-|1970-01-01T08:00:00.096+08:00|         96.0|
-+-----------------------------+-------------+
-Total line number = 10
-It costs 0.024s
-```
-
-#### 等数量分桶聚合采样
-
-采用聚合采样法对输入序列进行采样,用户需要另外提供一个聚合函数参数即
-- `type`:聚合类型,取值为`avg`或`max`或`min`或`sum`或`extreme`或`variance`。在缺省情况下,采用`avg`。其中`extreme`表示等分桶中,绝对值最大的值。`variance`表示采样等分桶中的方差。
-
-每个桶采样输出的时间戳为这个桶第一个点的时间戳
-
-
-| 函数名      | 可接收的输入序列类型                     | 必要的属性参数                               | 输出序列类型     | 功能类型                                             |
-|----------|--------------------------------|---------------------------------------|------------|--------------------------------------------------|
-| EQUAL_SIZE_BUCKET_AGG_SAMPLE   | INT32 / INT64 / FLOAT / DOUBLE | `proportion`取值范围为`(0, 1]`,默认为`0.1`</br>`type`:取值类型有`avg`, `max`, `min`, `sum`, `extreme`, `variance`, 默认为`avg`  | INT32 / INT64 / FLOAT / DOUBLE | 返回符合采样比例的等分桶聚合采样                |
-
-##### 演示
-测试数据:`root.ln.wf01.wt01.temperature`从`0.0-99.0`共`100`条有序数据,同等分桶随机采样的测试数据。
-
-sql:
-```sql
-select equal_size_bucket_agg_sample(temperature, 'type'='avg','proportion'='0.1') as agg_avg, equal_size_bucket_agg_sample(temperature, 'type'='max','proportion'='0.1') as agg_max, equal_size_bucket_agg_sample(temperature,'type'='min','proportion'='0.1') as agg_min, equal_size_bucket_agg_sample(temperature, 'type'='sum','proportion'='0.1') as agg_sum, equal_size_bucket_agg_sample(temperature, 'type'='extreme','proportion'='0.1') as agg_extreme, equal_size_bucket_agg_sample(temperature, ' [...]
-```
-结果:
-```
-+-----------------------------+-----------------+-------+-------+-------+-----------+------------+
-|                         Time|          agg_avg|agg_max|agg_min|agg_sum|agg_extreme|agg_variance|
-+-----------------------------+-----------------+-------+-------+-------+-----------+------------+
-|1970-01-01T08:00:00.000+08:00|              4.5|    9.0|    0.0|   45.0|        9.0|        8.25|
-|1970-01-01T08:00:00.010+08:00|             14.5|   19.0|   10.0|  145.0|       19.0|        8.25|
-|1970-01-01T08:00:00.020+08:00|             24.5|   29.0|   20.0|  245.0|       29.0|        8.25|
-|1970-01-01T08:00:00.030+08:00|             34.5|   39.0|   30.0|  345.0|       39.0|        8.25|
-|1970-01-01T08:00:00.040+08:00|             44.5|   49.0|   40.0|  445.0|       49.0|        8.25|
-|1970-01-01T08:00:00.050+08:00|             54.5|   59.0|   50.0|  545.0|       59.0|        8.25|
-|1970-01-01T08:00:00.060+08:00|             64.5|   69.0|   60.0|  645.0|       69.0|        8.25|
-|1970-01-01T08:00:00.070+08:00|74.50000000000001|   79.0|   70.0|  745.0|       79.0|        8.25|
-|1970-01-01T08:00:00.080+08:00|             84.5|   89.0|   80.0|  845.0|       89.0|        8.25|
-|1970-01-01T08:00:00.090+08:00|             94.5|   99.0|   90.0|  945.0|       99.0|        8.25|
-+-----------------------------+-----------------+-------+-------+-------+-----------+------------+
-Total line number = 10
-It costs 0.044s
-```
-#### 等数量分桶M4采样
-
-采用M4采样法对输入序列进行采样。即对于每个桶采样首、尾、最小和最大值。
-
-| 函数名      | 可接收的输入序列类型                     | 必要的属性参数                               | 输出序列类型     | 功能类型                                             |
-|----------|--------------------------------|---------------------------------------|------------|--------------------------------------------------|
-| EQUAL_SIZE_BUCKET_M4_SAMPLE   | INT32 / INT64 / FLOAT / DOUBLE | `proportion`取值范围为`(0, 1]`,默认为`0.1`| INT32 / INT64 / FLOAT / DOUBLE | 返回符合采样比例的等分桶M4采样                |
-
-##### 演示
-测试数据:`root.ln.wf01.wt01.temperature`从`0.0-99.0`共`100`条有序数据,同等分桶随机采样的测试数据。
-
-sql:
-```sql
-select equal_size_bucket_m4_sample(temperature, 'proportion'='0.1') as M4_sample from root.ln.wf01.wt01;
-```
-结果:
-```
-+-----------------------------+---------+
-|                         Time|M4_sample|
-+-----------------------------+---------+
-|1970-01-01T08:00:00.000+08:00|      0.0|
-|1970-01-01T08:00:00.001+08:00|      1.0|
-|1970-01-01T08:00:00.038+08:00|     38.0|
-|1970-01-01T08:00:00.039+08:00|     39.0|
-|1970-01-01T08:00:00.040+08:00|     40.0|
-|1970-01-01T08:00:00.041+08:00|     41.0|
-|1970-01-01T08:00:00.078+08:00|     78.0|
-|1970-01-01T08:00:00.079+08:00|     79.0|
-|1970-01-01T08:00:00.080+08:00|     80.0|
-|1970-01-01T08:00:00.081+08:00|     81.0|
-|1970-01-01T08:00:00.098+08:00|     98.0|
-|1970-01-01T08:00:00.099+08:00|     99.0|
-+-----------------------------+---------+
-Total line number = 12
-It costs 0.065s
-```
+## 使用别名
 
-#### 等数量分桶离群值采样
-本函数对输入序列进行等数量分桶离群值采样,即根据用户给定的降采样比例和桶内采样个数将输入序列按固定点数等分为若干桶,在每个桶内通过给定的离群值采样方法进行采样。
+由于 IoTDB 独特的数据模型,在每个传感器前都附带有设备等诸多额外信息。有时,我们只针对某个具体设备查询,而这些前缀信息频繁显示造成了冗余,影响了结果集的显示与分析。
 
-| 函数名      | 可接收的输入序列类型                     | 必要的属性参数                               | 输出序列类型     | 功能类型                                             |
-|----------|--------------------------------|---------------------------------------|------------|--------------------------------------------------|
-| EQUAL_SIZE_BUCKET_OUTLIER_SAMPLE   | INT32 / INT64 / FLOAT / DOUBLE | `proportion`取值范围为`(0, 1]`,默认为`0.1`</br>`type`取值为`avg`或`stendis`或`cos`或`prenextdis`,默认为`avg`</br>`number`取值应大于0,默认`3`| INT32 / INT64 / FLOAT / DOUBLE | 返回符合采样比例和桶内采样个数的等分桶离群值采样                |
+IoTDB 支持使用`AS`为查询结果集中的列指定别名。
 
-参数说明
-- `proportion`: 采样比例
-  - `number`: 每个桶内的采样个数,默认`3`
-- `type`: 离群值采样方法,取值为
-    - `avg`: 取桶内数据点的平均值,并根据采样比例,找到距离均值最远的`top number`个
-    - `stendis`: 取桶内每一个数据点距离桶的首末数据点连成直线的垂直距离,并根据采样比例,找到距离最大的`top number`个
-    - `cos`: 设桶内一个数据点为b,b左边的数据点为a,b右边的数据点为c,则取ab与bc向量的夹角的余弦值,值越小,说明形成的角度越大,越可能是异常值。找到cos值最小的`top number`个
-    - `prenextdis`: 设桶内一个数据点为b,b左边的数据点为a,b右边的数据点为c,则取ab与bc的长度之和作为衡量标准,和越大越可能是异常值,找到最大的`top number`个
+**示例:**
 
-##### 演示
-测试数据:`root.ln.wf01.wt01.temperature`从`0.0-99.0`共`100`条数据,其中为了加入离群值,我们使得个位数为5的值自增100。
-```
-IoTDB> select temperature from root.ln.wf01.wt01;
-+-----------------------------+-----------------------------+
-|                         Time|root.ln.wf01.wt01.temperature|
-+-----------------------------+-----------------------------+
-|1970-01-01T08:00:00.000+08:00|                          0.0|
-|1970-01-01T08:00:00.001+08:00|                          1.0|
-|1970-01-01T08:00:00.002+08:00|                          2.0|
-|1970-01-01T08:00:00.003+08:00|                          3.0|
-|1970-01-01T08:00:00.004+08:00|                          4.0|
-|1970-01-01T08:00:00.005+08:00|                        105.0|
-|1970-01-01T08:00:00.006+08:00|                          6.0|
-|1970-01-01T08:00:00.007+08:00|                          7.0|
-|1970-01-01T08:00:00.008+08:00|                          8.0|
-|1970-01-01T08:00:00.009+08:00|                          9.0|
-|1970-01-01T08:00:00.010+08:00|                         10.0|
-|1970-01-01T08:00:00.011+08:00|                         11.0|
-|1970-01-01T08:00:00.012+08:00|                         12.0|
-|1970-01-01T08:00:00.013+08:00|                         13.0|
-|1970-01-01T08:00:00.014+08:00|                         14.0|
-|1970-01-01T08:00:00.015+08:00|                        115.0|
-|1970-01-01T08:00:00.016+08:00|                         16.0|
-|.............................|.............................|
-|1970-01-01T08:00:00.092+08:00|                         92.0|
-|1970-01-01T08:00:00.093+08:00|                         93.0|
-|1970-01-01T08:00:00.094+08:00|                         94.0|
-|1970-01-01T08:00:00.095+08:00|                        195.0|
-|1970-01-01T08:00:00.096+08:00|                         96.0|
-|1970-01-01T08:00:00.097+08:00|                         97.0|
-|1970-01-01T08:00:00.098+08:00|                         98.0|
-|1970-01-01T08:00:00.099+08:00|                         99.0|
-+-----------------------------+-----------------------------+
-```
-sql:
 ```sql
-select equal_size_bucket_outlier_sample(temperature, 'proportion'='0.1', 'type'='avg', 'number'='2') as outlier_avg_sample, equal_size_bucket_outlier_sample(temperature, 'proportion'='0.1', 'type'='stendis', 'number'='2') as outlier_stendis_sample, equal_size_bucket_outlier_sample(temperature, 'proportion'='0.1', 'type'='cos', 'number'='2') as outlier_cos_sample, equal_size_bucket_outlier_sample(temperature, 'proportion'='0.1', 'type'='prenextdis', 'number'='2') as outlier_prenextdis_sam [...]
-```
-结果:
-```
-+-----------------------------+------------------+----------------------+------------------+-------------------------+
-|                         Time|outlier_avg_sample|outlier_stendis_sample|outlier_cos_sample|outlier_prenextdis_sample|
-+-----------------------------+------------------+----------------------+------------------+-------------------------+
-|1970-01-01T08:00:00.005+08:00|             105.0|                 105.0|             105.0|                    105.0|
-|1970-01-01T08:00:00.015+08:00|             115.0|                 115.0|             115.0|                    115.0|
-|1970-01-01T08:00:00.025+08:00|             125.0|                 125.0|             125.0|                    125.0|
-|1970-01-01T08:00:00.035+08:00|             135.0|                 135.0|             135.0|                    135.0|
-|1970-01-01T08:00:00.045+08:00|             145.0|                 145.0|             145.0|                    145.0|
-|1970-01-01T08:00:00.055+08:00|             155.0|                 155.0|             155.0|                    155.0|
-|1970-01-01T08:00:00.065+08:00|             165.0|                 165.0|             165.0|                    165.0|
-|1970-01-01T08:00:00.075+08:00|             175.0|                 175.0|             175.0|                    175.0|
-|1970-01-01T08:00:00.085+08:00|             185.0|                 185.0|             185.0|                    185.0|
-|1970-01-01T08:00:00.095+08:00|             195.0|                 195.0|             195.0|                    195.0|
-+-----------------------------+------------------+----------------------+------------------+-------------------------+
-Total line number = 10
-It costs 0.041s
+select s1 as temperature, s2 as speed from root.ln.wf01.wt01;
 ```
 
-### M4函数
-
-M4用于在窗口内采样第一个点(`first`)、最后一个点(`last`)、最小值点(`bottom`)、最大值点(`top`):
-
--   第一个点是拥有这个窗口内最小时间戳的点;
--   最后一个点是拥有这个窗口内最大时间戳的点;
--   最小值点是拥有这个窗口内最小值的点(如果有多个这样的点,M4只返回其中一个);
--   最大值点是拥有这个窗口内最大值的点(如果有多个这样的点,M4只返回其中一个)。
-
-<img src="https://user-images.githubusercontent.com/33376433/198178733-a0919d17-0663-4672-9c4f-1efad6f463c2.png" alt="image" style="zoom:50%;" />
-
-| 函数名 | 可接收的输入序列类型           | 属性参数                                                     | 输出序列类型                   | 功能类型                                                     |
-| ------ | ------------------------------ | ------------------------------------------------------------ | ------------------------------ | ------------------------------------------------------------ |
-| M4     | INT32 / INT64 / FLOAT / DOUBLE | 包含固定点数的窗口和滑动时间窗口使用不同的属性参数。包含固定点数的窗口使用属性`windowSize`和`slidingStep`。滑动时间窗口使用属性`timeInterval`、`slidingStep`、`displayWindowBegin`和`displayWindowEnd`。更多细节见下文。 | INT32 / INT64 / FLOAT / DOUBLE | 返回每个窗口内的第一个点(`first`)、最后一个点(`last`)、最小值点(`bottom`)、最大值点(`top`)。在一个窗口内的聚合点输出之前,M4会将它们按照时间戳递增排序并且去重。 |
-
-#### 属性参数
-
-**(1) 包含固定点数的窗口(SlidingSizeWindowAccessStrategy)使用的属性参数:**
-
-+ `windowSize`: 一个窗口内的点数。Int数据类型。必需的属性参数。
-+ `slidingStep`: 按照设定的点数来滑动窗口。Int数据类型。可选的属性参数;如果没有设置,默认取值和`windowSize`一样。
-
-<img src="https://user-images.githubusercontent.com/33376433/198181449-00d563c8-7bce-4ecd-a031-ec120ca42c3f.png" alt="image" style="zoom: 50%;" />
+结果集将显示为:
 
-*(图片来源: https://iotdb.apache.org/UserGuide/Master/Process-Data/UDF-User-Defined-Function.html#udtf-user-defined-timeseries-generating-function)*
-
-**(2) 滑动时间窗口(SlidingTimeWindowAccessStrategy)使用的属性参数:**
-
-+ `timeInterval`: 一个窗口的时间长度。Long数据类型。必需的属性参数。
-+ `slidingStep`: 按照设定的时长来滑动窗口。Long数据类型。可选的属性参数;如果没有设置,默认取值和`timeInterval`一样。
-+ `displayWindowBegin`: 窗口滑动的起始时间戳位置(包含在内)。Long数据类型。可选的属性参数;如果没有设置,默认取值为Long.MIN_VALUE,意为使用输入的时间序列的第一个点的时间戳作为窗口滑动的起始时间戳位置。
-+ `displayWindowEnd`: 结束时间限制(不包含在内;本质上和`WHERE time < displayWindowEnd`起的效果是一样的)。Long数据类型。可选的属性参数;如果没有设置,默认取值为Long.MAX_VALUE,意为除了输入的时间序列自身数据读取完毕之外没有增加额外的结束时间过滤条件限制。
-
-<img src="https://user-images.githubusercontent.com/33376433/198183015-93b56644-3330-4acf-ae9e-d718a02b5f4c.png" alt="groupBy window" style="zoom: 67%;" />
-
-*(图片来源: https://iotdb.apache.org/UserGuide/Master/Query-Data/Aggregate-Query.html#downsampling-aggregate-query)*
-
-#### 演示
-
-输入的时间序列:
-
-```sql
-+-----------------------------+------------------+
-|                         Time|root.vehicle.d1.s1|
-+-----------------------------+------------------+
-|1970-01-01T08:00:00.001+08:00|               5.0|
-|1970-01-01T08:00:00.002+08:00|              15.0|
-|1970-01-01T08:00:00.005+08:00|              10.0|
-|1970-01-01T08:00:00.008+08:00|               8.0|
-|1970-01-01T08:00:00.010+08:00|              30.0|
-|1970-01-01T08:00:00.020+08:00|              20.0|
-|1970-01-01T08:00:00.025+08:00|               8.0|
-|1970-01-01T08:00:00.027+08:00|              20.0|
-|1970-01-01T08:00:00.030+08:00|              40.0|
-|1970-01-01T08:00:00.033+08:00|               9.0|
-|1970-01-01T08:00:00.035+08:00|              10.0|
-|1970-01-01T08:00:00.040+08:00|              20.0|
-|1970-01-01T08:00:00.045+08:00|              30.0|
-|1970-01-01T08:00:00.052+08:00|               8.0|
-|1970-01-01T08:00:00.054+08:00|              18.0|
-+-----------------------------+------------------+
-```
+| Time | temperature | speed |
+| ---- | ----------- | ----- |
+| ...  | ...         | ...   |
 
-查询语句1:
+## 运算符
 
-```sql
-select M4(s1,'timeInterval'='25','displayWindowBegin'='0','displayWindowEnd'='100') from root.vehicle.d1
-```
+IoTDB 中支持的运算符列表见文档 [运算符和函数](../Operators-Functions/Overview.md)。
 
-输出结果1:
+## 函数
 
-```sql
-+-----------------------------+-----------------------------------------------------------------------------------------------+
-|                         Time|M4(root.vehicle.d1.s1, "timeInterval"="25", "displayWindowBegin"="0", "displayWindowEnd"="100")|
-+-----------------------------+-----------------------------------------------------------------------------------------------+
-|1970-01-01T08:00:00.001+08:00|                                                                                            5.0|
-|1970-01-01T08:00:00.010+08:00|                                                                                           30.0|
-|1970-01-01T08:00:00.020+08:00|                                                                                           20.0|
-|1970-01-01T08:00:00.025+08:00|                                                                                            8.0|
-|1970-01-01T08:00:00.030+08:00|                                                                                           40.0|
-|1970-01-01T08:00:00.045+08:00|                                                                                           30.0|
-|1970-01-01T08:00:00.052+08:00|                                                                                            8.0|
-|1970-01-01T08:00:00.054+08:00|                                                                                           18.0|
-+-----------------------------+-----------------------------------------------------------------------------------------------+
-Total line number = 8
-```
+### 聚合函数
 
-查询语句2:
+聚合函数是多对一函数。它们对一组值进行聚合计算,得到单个聚合结果。
 
-```sql
-select M4(s1,'windowSize'='10') from root.vehicle.d1
-```
+**包含聚合函数的查询称为聚合查询**,否则称为时间序列查询。
 
-输出结果2:
+**注意:聚合查询和时间序列查询不能混合使用。** 下列语句是不支持的:
 
 ```sql
-+-----------------------------+-----------------------------------------+
-|                         Time|M4(root.vehicle.d1.s1, "windowSize"="10")|
-+-----------------------------+-----------------------------------------+
-|1970-01-01T08:00:00.001+08:00|                                      5.0|
-|1970-01-01T08:00:00.030+08:00|                                     40.0|
-|1970-01-01T08:00:00.033+08:00|                                      9.0|
-|1970-01-01T08:00:00.035+08:00|                                     10.0|
-|1970-01-01T08:00:00.045+08:00|                                     30.0|
-|1970-01-01T08:00:00.052+08:00|                                      8.0|
-|1970-01-01T08:00:00.054+08:00|                                     18.0|
-+-----------------------------+-----------------------------------------+
-Total line number = 7
+select s1, count(s1) from root.sg.d1;
+select sin(s1), count(s1) from root.sg.d1;
+select s1, count(s1) from root.sg.d1 group by ([10,100),10ms);
 ```
 
+IoTDB 支持的聚合函数见文档 [聚合函数](../Operators-Functions/Aggregation.md)。
 
+### 时间序列生成函数
 
-#### 推荐的使用场景
-
-**(1) 使用场景:保留极端点的降采样**
-
-由于M4为每个窗口聚合其第一个点(`first`)、最后一个点(`last`)、最小值点(`bottom`)、最大值点(`top`),因此M4通常保留了极值点,因此比其他下采样方法(如分段聚合近似 (PAA))能更好地保留模式。如果你想对时间序列进行下采样并且希望保留极值点,你可以试试 M4。
-
-**(2) 使用场景:基于数据缩约的大规模时间序列的零误差双色折线图可视化**
-
-参考论文: ["M4: A Visualization-Oriented Time Series Data Aggregation"](http://www.vldb.org/pvldb/vol7/p797-jugel.pdf).
-
-假设屏幕画布的像素宽乘高是`w*h`,假设时间序列root.vehicle.d1.s1要可视化的时间范围是`[tqs,tqe)`(在这个使用场景里面,需要请你自行将tqe自适应调整使得(tqe-tqs)是w的整数倍),那么落在第i个时间跨度`Ii=[tqs+(tqe-tqs)/w*(i-1),tqs+(tqe-tqs)/w*i)` 内的点将会被画在第i个像素列中,i=1,2,...,w。
-
-于是从可视化驱动的角度出发,使用查询语句:`"select M4(s1,'timeInterval'='(tqe-tqs)/w','displayWindowBegin'='tqs','displayWindowEnd'='tqe') from root.vehicle.d1"`,来采集每个时间跨度内的第一个点(`first`)、最后一个点(`last`)、最小值点(`bottom`)、最大值点(`top`)。最终结果点数不会超过`4*w`个,使用这些聚合点画出来的折线图与使用原始数据画出来的图在像素级别上是完全一致的。
-
-
-
-#### 和其它SQL的功能比较
-
-| SQL                                               | 是否支持M4聚合                                               | 滑动窗口类型                                      | 示例                                                         | 相关文档                                                     |
-| ------------------------------------------------- | ------------------------------------------------------------ | ------------------------------------------------- | ------------------------------------------------------------ | ------------------------------------------------------------ |
-| 1. 带有Group By子句的内置聚合函数                 | 不支持,缺少`BOTTOM_TIME`和`TOP_TIME`,即缺少最小值点和最大值点的时间戳。 | Time Window                                       | `select count(status), max_value(temperature) from root.ln.wf01.wt01 group by ([2017-11-01 00:00:00, 2017-11-07 23:00:00), 3h, 1d)` | https://iotdb.apache.org/UserGuide/Master/Query-Data/Aggregate-Query.html#built-in-aggregate-functions <br />https://iotdb.apache.org/UserGuide/Master/Query-Data/Aggregate-Query.html#downsampling-aggregate-query |
-| 2. EQUAL_SIZE_BUCKET_M4_SAMPLE (内置UDF)          | 支持*                                                        | Size Window. `windowSize = 4*(int)(1/proportion)` | `select equal_size_bucket_m4_sample(temperature, 'proportion'='0.1') as M4_sample from root.ln.wf01.wt01` | https://iotdb.apache.org/UserGuide/Master/Query-Data/Select-Expression.html#time-series-generating-functions |
-| **3. M4 (内置UDF)**                               | 支持*                                                        | Size Window, Time Window                          | (1) Size Window: `select M4(s1,'windowSize'='10') from root.vehicle.d1` <br />(2) Time Window: `select M4(s1,'timeInterval'='25','displayWindowBegin'='0','displayWindowEnd'='100') from root.vehicle.d1` | 本文档                                                       |
-| 4. 扩展带有Group By子句的内置聚合函数来支持M4聚合 | 未实施                                                       | 未实施                                            | 未实施                                                       | 未实施                                                       |
-
-进一步比较`EQUAL_SIZE_BUCKET_M4_SAMPLE`和`M4`:
-
-**(1) 不同的M4聚合函数定义:**
-
-在每个窗口内,`EQUAL_SIZE_BUCKET_M4_SAMPLE`从排除了第一个点和最后一个点之后剩余的点中提取最小值点和最大值点。
-
-而`M4`则是从窗口内所有点中(包括第一个点和最后一个点)提取最小值点和最大值点,这个定义与元数据中保存的`max_value`和`min_value`的语义更加一致。
-
-值得注意的是,在一个窗口内的聚合点输出之前,`EQUAL_SIZE_BUCKET_M4_SAMPLE`和`M4`都会将它们按照时间戳递增排序并且去重。 
-
-**(2) 不同的滑动窗口:** 
-
-`EQUAL_SIZE_BUCKET_M4_SAMPLE`使用SlidingSizeWindowAccessStrategy,并且通过采样比例(`proportion`)来间接控制窗口点数(`windowSize`),转换公式是`windowSize = 4*(int)(1/proportion)`。
-
-`M4`支持两种滑动窗口:SlidingSizeWindowAccessStrategy和SlidingTimeWindowAccessStrategy,并且`M4`通过相应的参数直接控制窗口的点数或者时长。
-
-
-
-### JEXL自定义函数
-
-Java Expression Language (JEXL) 是一个表达式语言引擎。我们使用JEXL来扩展UDF,在命令行中,通过简易的lambda表达式来实现UDF。lambda表达式中支持的运算符详见链接 [JEXL中lambda表达式支持的运算符](https://commons.apache.org/proper/commons-jexl/apidocs/org/apache/commons/jexl3/package-summary.html#customization) 。
-
-
-| 函数名      | 可接收的输入序列类型                     | 必要的属性参数                               | 输出序列类型     | 功能类型                                             |
-|----------|--------------------------------|---------------------------------------|------------|--------------------------------------------------|
-| JEXL   | INT32 / INT64 / FLOAT / DOUBLE / TEXT / BOOLEAN | `expr`是一个支持标准的一元或多元参数的lambda表达式,符合`x -> {...}`或`(x, y, z) -> {...}`的格式,例如`x -> {x * 2}`, `(x, y, z) -> {x + y * z}`| INT32 / INT64 / FLOAT / DOUBLE / TEXT / BOOLEAN | 返回将输入的时间序列通过lambda表达式变换的序列             |
+时间序列生成函数接受若干原始时间序列作为输入,产生一列时间序列输出。与聚合函数不同的是,时间序列生成函数的结果集带有时间戳列。
 
-#### 演示
-测试数据:`root.ln.wf01.wt01.temperature`, `root.ln.wf01.wt01.st`, `root.ln.wf01.wt01.str`共`11`条数据。
-```
-IoTDB> select * from root.ln.wf01.wt01;
-+-----------------------------+---------------------+--------------------+-----------------------------+
-|                         Time|root.ln.wf01.wt01.str|root.ln.wf01.wt01.st|root.ln.wf01.wt01.temperature|
-+-----------------------------+---------------------+--------------------+-----------------------------+
-|1970-01-01T08:00:00.000+08:00|                  str|                10.0|                          0.0|
-|1970-01-01T08:00:00.001+08:00|                  str|                20.0|                          1.0|
-|1970-01-01T08:00:00.002+08:00|                  str|                30.0|                          2.0|
-|1970-01-01T08:00:00.003+08:00|                  str|                40.0|                          3.0|
-|1970-01-01T08:00:00.004+08:00|                  str|                50.0|                          4.0|
-|1970-01-01T08:00:00.005+08:00|                  str|                60.0|                          5.0|
-|1970-01-01T08:00:00.006+08:00|                  str|                70.0|                          6.0|
-|1970-01-01T08:00:00.007+08:00|                  str|                80.0|                          7.0|
-|1970-01-01T08:00:00.008+08:00|                  str|                90.0|                          8.0|
-|1970-01-01T08:00:00.009+08:00|                  str|               100.0|                          9.0|
-|1970-01-01T08:00:00.010+08:00|                  str|               110.0|                         10.0|
-+-----------------------------+---------------------+--------------------+-----------------------------+
-```
-sql:
-```sql
-select jexl(temperature, 'expr'='x -> {x + x}') as jexl1, jexl(temperature, 'expr'='x -> {x * 3}') as jexl2, jexl(temperature, 'expr'='x -> {x * x}') as jexl3, jexl(temperature, 'expr'='x -> {multiply(x, 100)}') as jexl4, jexl(temperature, st, 'expr'='(x, y) -> {x + y}') as jexl5, jexl(temperature, st, str, 'expr'='(x, y, z) -> {x + y + z}') as jexl6 from root.ln.wf01.wt01;```
-```
-结果:
-```
-+-----------------------------+-----+-----+-----+------+-----+--------+
-|                         Time|jexl1|jexl2|jexl3| jexl4|jexl5|   jexl6|
-+-----------------------------+-----+-----+-----+------+-----+--------+
-|1970-01-01T08:00:00.000+08:00|  0.0|  0.0|  0.0|   0.0| 10.0| 10.0str|
-|1970-01-01T08:00:00.001+08:00|  2.0|  3.0|  1.0| 100.0| 21.0| 21.0str|
-|1970-01-01T08:00:00.002+08:00|  4.0|  6.0|  4.0| 200.0| 32.0| 32.0str|
-|1970-01-01T08:00:00.003+08:00|  6.0|  9.0|  9.0| 300.0| 43.0| 43.0str|
-|1970-01-01T08:00:00.004+08:00|  8.0| 12.0| 16.0| 400.0| 54.0| 54.0str|
-|1970-01-01T08:00:00.005+08:00| 10.0| 15.0| 25.0| 500.0| 65.0| 65.0str|
-|1970-01-01T08:00:00.006+08:00| 12.0| 18.0| 36.0| 600.0| 76.0| 76.0str|
-|1970-01-01T08:00:00.007+08:00| 14.0| 21.0| 49.0| 700.0| 87.0| 87.0str|
-|1970-01-01T08:00:00.008+08:00| 16.0| 24.0| 64.0| 800.0| 98.0| 98.0str|
-|1970-01-01T08:00:00.009+08:00| 18.0| 27.0| 81.0| 900.0|109.0|109.0str|
-|1970-01-01T08:00:00.010+08:00| 20.0| 30.0|100.0|1000.0|120.0|120.0str|
-+-----------------------------+-----+-----+-----+------+-----+--------+
-Total line number = 11
-It costs 0.118s
-```
-
-### 自定义时间序列生成函数
+所有的时间序列生成函数都可以接受 * 作为输入,都可以与原始时间序列查询混合进行。
 
-请参考 [UDF](../Process-Data/UDF-User-Defined-Function.md)。
+#### 内置时间序列生成函数
 
-已知的自定义时间序列生成函数库实现:
+IoTDB 中支持的内置函数列表见文档 [运算符和函数](../Operators-Functions/Overview.md)。
 
-+ [IoTDB-Quality](https://thulab.github.io/iotdb-quality),一个关于数据质量的 UDF 库实现,包括数据画像、数据质量评估与修复等一系列函数。
+#### 自定义时间序列生成函数
 
-## 嵌套表达式
+IoTDB 支持通过 [用户自定义函数](./User-Defined-Function.md) 能力进行函数功能扩展。
 
-IoTDB支持嵌套表达式,由于聚合查询和时间序列查询不能在一条查询语句中同时出现,我们将支持的嵌套表达式分为时间序列查询嵌套表达式和聚合查询嵌套表达式两类。
+## 嵌套表达式举例
 
-下面是嵌套表达式统一的 `SELECT` 子句语法定义:
-
-```sql
-selectClause
-    : SELECT resultColumn (',' resultColumn)*
-    ;
-
-resultColumn
-    : expression (AS ID)?
-    ;
-
-expression
-    : '(' expression ')'
-    | '-' expression
-    | expression ('*' | '/' | '%') expression
-    | expression ('+' | '-') expression
-    | functionName '(' expression (',' expression)* functionAttribute* ')'
-    | timeSeriesSuffixPath
-    | number
-    ;
-```
+IoTDB 支持嵌套表达式,由于聚合查询和时间序列查询不能在一条查询语句中同时出现,我们将支持的嵌套表达式分为时间序列查询嵌套表达式和聚合查询嵌套表达式两类。
 
 ### 时间序列查询嵌套表达式
 
-IoTDB 支持在 `SELECT` 子句中计算由**数字常量,时间序列、时间序列生成函数(包括用户自定义函数)和算数运算表达式**组成的任意嵌套表达式。
+IoTDB 支持在 `SELECT` 子句中计算由**时间序列、常量、时间序列生成函数(包括用户自定义函数)和运算符**组成的任意嵌套表达式。
+
+**说明:**
 
-#### 示例
+- 当某个时间戳下左操作数和右操作数都不为空(`null`)时,表达式才会有结果,否则表达式值为`null`,且默认不出现在结果集中。 
+- 如果表达式中某个操作数对应多条时间序列(如通配符 `*`),那么每条时间序列对应的结果都会出现在结果集中(按照笛卡尔积形式)。
 
-输入1:
+**示例 1:**
 
 ```sql
 select a,
@@ -1110,7 +112,7 @@ select a,
 from root.sg1;
 ```
 
-结果集1:
+运行结果:
 
 ```
 +-----------------------------+----------+----------+----------------------------------------+---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------+
@@ -1127,13 +129,13 @@ Total line number = 6
 It costs 0.048s
 ```
 
-输入2:
+**示例 2:**
 
 ```sql
 select (a + b) * 2 + sin(a) from root.sg
 ```
 
-结果集2:
+运行结果:
 
 ```
 +-----------------------------+----------------------------------------------+
@@ -1153,13 +155,13 @@ Total line number = 9
 It costs 0.011s
 ```
 
-输入3:
+**示例 3:**
 
 ```sql
 select (a + *) / 2  from root.sg1
 ```
 
-结果集3:
+运行结果:
 
 ```
 +-----------------------------+-----------------------------+-----------------------------+
@@ -1175,13 +177,13 @@ Total line number = 5
 It costs 0.011s
 ```
 
-输入4:
+**示例 4:**
 
 ```sql
 select (a + b) * 3 from root.sg, root.ln
 ```
 
-结果集4:
+运行结果:
 
 ```
 +-----------------------------+---------------------------+---------------------------+---------------------------+---------------------------+
@@ -1201,25 +203,15 @@ Total line number = 9
 It costs 0.014s
 ```
 
-#### 说明
-
-- 当某个时间戳下左操作数和右操作数都不为空(`null`)时,表达式才会有结果,否则表达式值为`null`,且默认不出现在结果集中。
-  - 从结果集1中可知,时间戳40下,时间序列`root.sg.a`的值为4,`root.sg.b`的值为`null`。所以在时间戳40下,表达式`(a + b) * 2 + sin(a)`的值为`null`,从结果集2可以看出,时间戳40没有出现。
-- 如果表达式中某个操作数对应多条时间序列(如通配符`*`),那么每条时间序列对应的结果都会出现在结果集中(按照笛卡尔积形式)。请参考示例中输入3、4和对应结果集3、4。
-
-#### 注意
-
-> 目前对齐时间序列(Aligned Timeseries)尚不支持时间序列查询嵌套表达式。使用时间序列查询嵌套表达式时,如果操作数包含对齐时间序列,会提示错误。
-
 ### 聚合查询嵌套表达式
 
-IoTDB 支持在 `SELECT` 子句中计算由**数字常量,聚合查询和算数运算表达式**组成的任意嵌套表达式。
-
-#### 示例
+IoTDB 支持在 `SELECT` 子句中计算由**聚合函数、常量、时间序列生成函数和表达式**组成的任意嵌套表达式。
 
-不指定 `GROUP BY` 的聚合查询。
+**说明:**
+- 当某个时间戳下左操作数和右操作数都不为空(`null`)时,表达式才会有结果,否则表达式值为`null`,且默认不出现在结果集中。但在使用`GROUP BY`子句的聚合查询嵌套表达式中,我们希望保留每个时间窗口的值,所以表达式值为`null`的窗口也包含在结果集中。
+- 如果表达式中某个操作数对应多条时间序列(如通配符`*`),那么每条时间序列对应的结果都会出现在结果集中(按照笛卡尔积形式)。
 
-输入1:
+**示例 1:**
 
 ```sql
 select avg(temperature),
@@ -1230,7 +222,7 @@ select avg(temperature),
 from root.ln.wf01.wt01;
 ```
 
-结果集1:
+运行结果:
 
 ```
 +----------------------------------+---------------------------------------+--------------------------------------+--------------------------------+--------------------------------------------------------------------+
@@ -1242,7 +234,7 @@ Total line number = 1
 It costs 0.009s
 ```
 
-输入2:
+**示例 2:**
 
 ```sql
 select avg(*), 
@@ -1250,7 +242,7 @@ select avg(*),
 from root.sg1
 ```
 
-结果集2:
+运行结果:
 
 ```
 +---------------+---------------+-------------------------------------+-------------------------------------+
@@ -1262,9 +254,7 @@ Total line number = 1
 It costs 0.007s
 ```
 
-指定 `GROUP BY` 的聚合查询。
-
-输入3:
+**示例 3:**
 
 ```sql
 select avg(temperature),
@@ -1276,7 +266,7 @@ from root.ln.wf01.wt01
 GROUP BY([10, 90), 10ms);
 ```
 
-结果集3:
+运行结果:
 
 ```
 +-----------------------------+----------------------------------+---------------------------------------+--------------------------------------+--------------------------------+----------+
@@ -1293,39 +283,4 @@ GROUP BY([10, 90), 10ms);
 +-----------------------------+----------------------------------+---------------------------------------+--------------------------------------+--------------------------------+----------+
 Total line number = 8
 It costs 0.012s
-```
-
-#### 说明
-
-- 当某个时间戳下左操作数和右操作数都不为空(`null`)时,表达式才会有结果,否则表达式值为`null`,且默认不出现在结果集中。但在使用`GROUP BY`子句的聚合查询嵌套表达式中,我们希望保留每个时间窗口的值,所以表达式值为`null`的窗口也包含在结果集中。请参考输入3及结果集3。
-- 如果表达式中某个操作数对应多条时间序列(如通配符`*`),那么每条时间序列对应的结果都会出现在结果集中(按照笛卡尔积形式)。请参考输入2及结果集2。
-
-#### 注意
-
-> 目前此功能尚不支持填充算子(`FILL`)和按层级聚合(`GROUP BY LEVEL`)查询, 在后续版本会支持。
->
-> 聚合计算目前只能当做最底层表达式输入,暂不支持聚合函数内部出现表达式。
->
-> 即不支持以下查询
->
-> ```SQL
-> SELECT avg(s1 + 1) FROM root.sg.d1; -- 聚合函数内部有表达式
-> SELECT avg(s1) + avg(s2) FROM root.sg.* GROUP BY LEVEL=1; -- 按层级聚合
-> SELECT avg(s1) + avg(s2) FROM root.sg.d1 GROUP BY([0, 10000), 1s) FILL(previous); -- 空值填充 
-> ```
-
-## 使用别名
-
-由于 IoTDB 独特的数据模型,在每个传感器前都附带有设备等诸多额外信息。有时,我们只针对某个具体设备查询,而这些前缀信息频繁显示造成了冗余,影响了结果集的显示与分析。这时我们可以使用 IoTDB 提供的 AS 函数,将查询中出现的时间序列给定一个别名。
-
-例如:
-
-```sql
-select s1 as temperature, s2 as speed from root.ln.wf01.wt01;
-```
-
-则结果集将显示为:
-
-| Time | temperature | speed |
-| ---- | ----------- | ----- |
-| ...  | ...         | ...   |
+```
\ No newline at end of file
diff --git a/docs/zh/UserGuide/Process-Data/Select-Into.md b/docs/zh/UserGuide/Query-Data/Select-Into.md
similarity index 93%
rename from docs/zh/UserGuide/Process-Data/Select-Into.md
rename to docs/zh/UserGuide/Query-Data/Select-Into.md
index 47407ee9ba..f39206048c 100644
--- a/docs/zh/UserGuide/Process-Data/Select-Into.md
+++ b/docs/zh/UserGuide/Query-Data/Select-Into.md
@@ -26,7 +26,7 @@
 应用场景如下:
 - **实现 IoTDB 内部 ETL**:对原始数据进行 ETL 处理后写入新序列。
 - **查询结果存储**:将查询结果进行持久化存储,起到类似物化视图的作用。
-- **非对齐序列转对齐序列**:对齐序列从0.13版本开始支持,可以通过该功能将历史的非对齐序列重新写成对齐序列。
+- **非对齐序列转对齐序列**:对齐序列从0.13版本开始支持,可以通过该功能将非对齐序列的数据写入新的对齐序列中。
 
 ## 语法定义
 
@@ -129,8 +129,6 @@ It costs 0.625s
 
 该语句同样是将 `root.sg` database 下四条序列的查询结果写入到 `root.sg_copy` database 下指定的四条序列中。但在按设备对齐中,`intoItem` 的数量必须和查询的设备数量一致,每个查询设备对应一个 `intoItem`。
 
-容易看出,在按设备对齐查询的情况下,同一个设备下的列只能写入相同的目标设备。
-
 > 按设备对齐查询时,`CLI` 展示的结果集多出一列 `source device` 列表示查询的设备。
 
 - **示例 4**(按设备对齐)
@@ -156,13 +154,11 @@ It costs 0.532s
 - 后缀复制符 `::`:复制查询设备后缀(或物理量),表示从该层开始一直到设备的最后一层(或物理量),目标设备的节点名(或物理量名)与查询的设备对应的节点名(或物理量名)相同。
 - 单层节点匹配符 `${i}`:表示目标序列当前层节点名与查询序列的第`i`层节点名相同。比如,对于路径`root.sg1.d1.s1`而言,`${1}`表示`sg1`,`${2}`表示`d1`,`${3}`表示`s1`。
 
-注意:变量占位符**只能描述序列与序列之间的对应关系**,不能用于函数、表达式等。
-
 在使用变量占位符时,`intoItem`与查询结果集列的对应关系不能存在歧义,具体情况分类讨论如下:
 
 #### 按时间对齐(默认)
 
-> 注:如果查询中包含聚合、表达式计算,此时查询结果中的列无法与某个序列对应,因此目标设备和目标物理量都不能使用变量占位符。 
+> 注:变量占位符**只能描述序列与序列之间的对应关系**,如果查询中包含聚合、表达式计算,此时查询结果中的列无法与某个序列对应,因此目标设备和目标物理量都不能使用变量占位符。 
 
 ##### (1)目标设备不使用变量占位符 & 目标物理量列表使用变量占位符
   
@@ -176,13 +172,13 @@ It costs 0.532s
 
 ```sql
 select s1, s2
-into root.sg_copy.d1(::), rot.sg_copy.d2(s1), root.sg_copy.d1(${3}), root.sg_copy.d2(::),
+into root.sg_copy.d1(::), root.sg_copy.d2(s1), root.sg_copy.d1(${3}), root.sg_copy.d2(::)
 from root.sg.d1, root.sg.d2;
 ```
 该语句等价于:
 ```sql
 select s1, s2
-into root.sg_copy.d1(s1), rot.sg_copy.d2(s1), root.sg_copy.d1(s2), root.sg_copy.d2(s2),
+into root.sg_copy.d1(s1), root.sg_copy.d2(s1), root.sg_copy.d1(s2), root.sg_copy.d2(s2)
 from root.sg.d1, root.sg.d2;
 ```
 可以看到,在这种情况下,语句并不能得到很好地简化。
@@ -214,7 +210,7 @@ select * into root.sg_bk.::(::) from root.sg.**;
 
 #### 按设备对齐(使用 `ALIGN BY DEVICE`)
 
-> 注:如果查询中包含聚合、表达式计算,此时查询结果中的列无法与某个物理量对应,因此目标物理量不能使用变量占位符。
+> 注:变量占位符**只能描述序列与序列之间的对应关系**,如果查询中包含聚合、表达式计算,此时查询结果中的列无法与某个物理量对应,因此目标物理量不能使用变量占位符。
 
 ##### (1)目标设备不使用变量占位符 & 目标物理量列表使用变量占位符
 
@@ -260,10 +256,16 @@ select * into ::(backup_${4}) from root.sg.** align by device;
 
 通过 `ALIGNED` 关键词可以指定写入的目标设备为对齐写入,每个 `intoItem` 可以独立设置。
 
+**示例:**
+```sql
+select s1, s2 into root.sg_copy.d1(t1, t2), aligned root.sg_copy.d2(t1, t2) from root.sg.d1, root.sg.d2 align by device;
+```
+该语句指定了 `root.sg_copy.d1` 是非对齐设备,`root.sg_copy.d2`是对齐设备。
+
 ### 不支持使用的查询子句
 
 - `SLIMIT`、`SOFFSET`:查询出来的列不确定,功能不清晰,因此不支持。
-- `LAST`、`GROUP BY TAGS`、`DISABLE ALIGN`:表结构和写入结构不一致,因此不支持。
+- `LAST`查询、`GROUP BY TAGS`、`DISABLE ALIGN`:表结构和写入结构不一致,因此不支持。
 
 ### 其他要注意的点
 
@@ -309,7 +311,7 @@ It costs 0.115s
 以上语句将降采样查询的结果持久化存储到新序列中。
 
 ### 非对齐序列转对齐序列
-对齐序列从 0.13 版本开始支持,可以通过该功能将历史的非对齐序列重新写成对齐序列。
+对齐序列从 0.13 版本开始支持,可以通过该功能将非对齐序列的数据写入新的对齐序列中。
 
 **注意:** 建议配合使用 `LIMIT & OFFSET` 子句或 `WHERE` 子句(时间过滤条件)对数据进行分批,防止单次操作的数据量过大。
 
diff --git a/docs/zh/UserGuide/Query-Data/Tracing-Tool.md b/docs/zh/UserGuide/Query-Data/Tracing-Tool.md
deleted file mode 100644
index 6ec4641639..0000000000
--- a/docs/zh/UserGuide/Query-Data/Tracing-Tool.md
+++ /dev/null
@@ -1,48 +0,0 @@
-<!--
-
-    Licensed to the Apache Software Foundation (ASF) under one
-    or more contributor license agreements.  See the NOTICE file
-    distributed with this work for additional information
-    regarding copyright ownership.  The ASF licenses this file
-    to you under the Apache License, Version 2.0 (the
-    "License"); you may not use this file except in compliance
-    with the License.  You may obtain a copy of the License at
-    
-        http://www.apache.org/licenses/LICENSE-2.0
-    
-    Unless required by applicable law or agreed to in writing,
-    software distributed under the License is distributed on an
-    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-    KIND, either express or implied.  See the License for the
-    specific language governing permissions and limitations
-    under the License.
-
--->
-
-# 查询性能追踪
-
-IoTDB 支持使用 `TRACING` 关键词对查询语句进行性能追踪。用户可以使用性能追踪工具来分析语句执行中存在的潜在性能问题。
-
-性能追踪的结果包括:
-1. 查询执行过程中各个阶段的累积耗时。
-2. 与查询性能分析相关的统计信息,包括查询的时间序列数、涉及访问的 Tsfile 文件数、需要扫描的 chunk 总数以及平均每个 chunk 包含的数据点个数、读取的 Page 总数以及其中乱序 Page 的个数。
-
-例如执行 `tracing select * from root.**`,输出结果如下:
-
-```
-Tracing Activties:
-+---------------------------------------------------------+------------+
-|                                                 Activity|Elapsed Time|
-+---------------------------------------------------------+------------+
-|Start to execute statement: tracing select * from root.**|           0|
-|                               Parse SQL to physical plan|           4|
-|                                 Create and cache dataset|          16|
-|                                 * Num of series paths: 3|            |
-|                          * Num of sequence files read: 2|            |
-|                        * Num of unsequence files read: 1|            |
-|           * Num of sequence chunks: 6, avg points: 100.0|            |
-|         * Num of unsequence chunks: 3, avg points: 100.0|            |
-|            * Num of Pages: 9, overlapped pages: 0 (0.0%)|            |
-|                                         Request complete|          20|
-+---------------------------------------------------------+------------+
-```
\ No newline at end of file
diff --git a/docs/zh/UserGuide/Query-Data/Query-Filter.md b/docs/zh/UserGuide/Query-Data/Where-Condition.md
similarity index 85%
rename from docs/zh/UserGuide/Query-Data/Query-Filter.md
rename to docs/zh/UserGuide/Query-Data/Where-Condition.md
index a53f1c7994..82cc553fa0 100644
--- a/docs/zh/UserGuide/Query-Data/Query-Filter.md
+++ b/docs/zh/UserGuide/Query-Data/Where-Condition.md
@@ -21,14 +21,12 @@
 
 # 查询过滤条件
 
-在 IoTDB 查询语句中,支持使用**时间过滤**和**值过滤**两种过滤条件。
+`WHERE` 子句指定了对数据行的筛选条件,由一个 `whereCondition` 组成。
 
-支持的运算符如下:
+`whereCondition` 是一个逻辑表达式,对于要选择的每一行,其计算结果为真。如果没有 `WHERE` 子句,将选择所有行。
+在 `whereCondition` 中,可以使用除聚合函数之外的任何 IOTDB 支持的函数和运算符。
 
-- 比较运算符:大于(`>`)、大于等于( `>=`)、等于( `=` 或 `==`)、不等于( `!=` 或 `<>`)、小于等于( `<=`)、小于( `<`)。
-- 逻辑运算符:与( `AND` 或 `&` 或 `&&`)、或( `OR` 或 `|` 或 `||`)、非( `NOT` 或 `!`)。
-- 范围包含运算符:包含( `IN` )。
-- 字符串匹配运算符:`LIKE`, `REGEXP`。
+根据过滤条件的不同,可以分为时间过滤条件和值过滤条件。时间过滤条件和值过滤条件可以混合使用。
 
 ## 时间过滤条件
 
@@ -58,7 +56,8 @@
 
 ## 值过滤条件
 
-使用值过滤条件可以筛选数据值满足特定条件的数据。**允许**使用 select 子句中未选择的时间序列作为值过滤条件。
+使用值过滤条件可以筛选数据值满足特定条件的数据。
+**允许**使用 select 子句中未选择的时间序列作为值过滤条件。
 
 示例如下:
 
@@ -94,15 +93,13 @@
    select code from root.sg1.d1 where code not in ('200', '300', '400', '500');
    ```
 
-## 空值过滤
-使用空值过滤条件可以筛选出值为空或非空的数据
-1. 选择值为空的数据:
+6. 选择值为空的数据:
 
     ```sql
     select code from root.sg1.d1 where temperature is null;
     ````
 
-2. 选择值为非空的数据:
+7. 选择值为非空的数据:
 
     ```sql
     select code from root.sg1.d1 where temperature is not null;
@@ -110,7 +107,7 @@
 
 ## 模糊查询
 
-在值过滤条件中,对于 TEXT 类型的数据,支持使用 `Like` 和 `Regexp` 运算符对数据进行模糊匹配
+对于 TEXT 类型的数据,支持使用 `Like` 和 `Regexp` 运算符对数据进行模糊匹配
 
 ### 使用 `Like` 进行模糊匹配 
 
diff --git a/docs/zh/UserGuide/Query-Data/Without-Null.md b/docs/zh/UserGuide/Query-Data/Without-Null.md
deleted file mode 100644
index 0c1f34454b..0000000000
--- a/docs/zh/UserGuide/Query-Data/Without-Null.md
+++ /dev/null
@@ -1,172 +0,0 @@
-<!--
-
-    Licensed to the Apache Software Foundation (ASF) under one
-    or more contributor license agreements.  See the NOTICE file
-    distributed with this work for additional information
-    regarding copyright ownership.  The ASF licenses this file
-    to you under the Apache License, Version 2.0 (the
-    "License"); you may not use this file except in compliance
-    with the License.  You may obtain a copy of the License at
-    
-        http://www.apache.org/licenses/LICENSE-2.0
-    
-    Unless required by applicable law or agreed to in writing,
-    software distributed under the License is distributed on an
-    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-    KIND, either express or implied.  See the License for the
-    specific language governing permissions and limitations
-    under the License.
-
--->
-
-# 结果集空值过滤
-
-在实际应用中,用户可能希望对查询的结果集中某些存在空值的行进行过滤。在 IoTDB 中,可以使用  `WITHOUT NULL`  子句对结果集中的空值进行过滤,有两种过滤策略:`WITHOUT NULL ANY`和`WITHOUT NULL ALL`。不仅如此, `WITHOUT NULL`  子句支持指定相应列进行过滤。
-
-> WITHOUT NULL ANY: 指定的列集中,存在一列为NULL,则满足条件进行过滤
-> 
-> WITHOUT NULL ALL: 指定的列集中,所有列都为NULL,才满足条件进行过滤
-
-## 不指定列
-
-> 默认就是对结果集中的所有列生效,即指定的列集为结果集中的所有列
-
-1. 在下列查询中,如果结果集中某一行任意一列为 null,则过滤掉该行;即获得的结果集不包含任何空值。
-
-```sql
-select * from root.ln.** where time <= 2017-11-01T00:01:00 WITHOUT NULL ANY
-```
-
-2. 在下列查询中,如果结果集的某一行所有列都为 null,则过滤掉该行;即获得的结果集不包含所有值都为 null 的行。
-
-```sql
-select * from root.ln.** where group by ([1,10), 2ms) WITHOUT NULL ALL
-```
-
-## 指定列
-
-> 只对指定的列集生效
-
-使用 `WITHOUT NULL`子句对结果集中指定列名的空值进行过滤,下面是一些例子及其说明:
-
-> 注意,如果指定的列在当前元数据里不存在则会直接过滤掉,这与目前查询列的输出结果是一致的;
-> 如果指定的列存在,但与结果集中输出的列名不匹配,则会报错: `The without null columns don't match the columns queried.If has alias, please use the alias.`
-
-比如下面的例子
-
-1. 比如`without null`指定的列集中`root.test.sg1.s1`列在元数据中存在,`root.test.sg1.usag`列在元数据不存在,则下面查询的without null子句的作用相当于without null all(s1)
-
-```sql
-select * from root.test.sg1 without null all (s1, usag)
-```
-
-2. 比如`without null`指定的列集中`root.test.sg1.s2`列在元数据中存在,但查询的结果集中输出列不包括,所以会报错:`The without null columns don't match the columns queried.If has alias, please use the alias.`
-
-```sql
-select s1 + s2, s1 - s2, s1 * s2, s1 / s2, s1 % s2 from root.test.sg1 without null all (s1+s2, s2)
-```
-
-### 原始数据查询
-
-1. 如果查询的结果集中, root.ln.sg1.s1这一列如果为null,则过滤掉该行
-
-```sql
-select * from root.ln.sg1 WITHOUT NULL ANY(s1)
-```
-
-2. 如果查询的结果集中, root.ln.sg1.s1和root.ln.sg1.s2中只要存在至少一列为null,则过滤掉该行
-
-```sql
-select * from root.ln.sg1 WITHOUT NULL ANY(s1, s2)
-```
-
-3. 如果查询的结果集中, 只要root.ln.sg1.s1和root.ln.sg1.s2这两列都为null,则过滤掉该行
-
-```sql
-select * from root.ln.sg1 WITHOUT NULL ALL(s1, s2)
-```
-
-### 带表达式查询
-
-指定的列可以为表达式
-
-1. 计算s2+s4和s2这两列是否都为null,如果是则过滤
-
-```sql
-select s2, - s2, s4, + s4, s2 + s4, s2 - s4, s2 * s4, s2 / s4, s2 % s4 from root.test.sg1 without null all (s2+s4, s2)
-```
-
-2. 计算s2+s4和s2这两列是否至少有一列为null,如果是则过滤
-
-```sql
-select s2, - s2, s4, + s4, s2 + s4, s2 - s4, s2 * s4, s2 / s4, s2 % s4 from root.test.sg1 without null any (s2+s4, s2)
-```
-
-
-### 带函数查询
-
-```sql
-select s1, sin(s2) + cos(s2), cos(sin(s2 + s4) + s2) from root.test.sg1 without null all (sin(s2) + cos(s2), cos(sin(s2 + s4) + s2))
-```
-
-### 按设备对齐查询
-
-```sql
-select last_value(*) from root.test.sg1 group by([1,10), 2ms) without null all(last_value(s2), last_value(s3)) align by device
-```
-
-结果示例如下:
-
-```
-IoTDB> select last_value(*) from root.sg1.* group by([1,10), 2ms) without null all(last_value(s2), last_value(s3)) align by device
-+-----------------------------+-----------+--------------+--------------+--------------+
-|                         Time|     Device|last_value(s1)|last_value(s2)|last_value(s3)|
-+-----------------------------+-----------+--------------+--------------+--------------+
-|1970-01-01T08:00:00.001+08:00|root.sg1.d1|           1.0|           2.0|          null|
-|1970-01-01T08:00:00.003+08:00|root.sg1.d1|           3.0|           4.0|          null|
-|1970-01-01T08:00:00.001+08:00|root.sg1.d2|           1.0|           1.0|           1.0|
-+-----------------------------+-----------+--------------+--------------+--------------+
-Total line number = 3
-It costs 0.007s
-```
-
-指定的列名是与输出结果的列名对应,目前`without null`子句不支持指定某设备的某列,会报错:`The without null columns don't match the columns queried.If has alias, please use the alias.` 比如下面这个查询例子,指定last_value(root.sg1.d1.s3)为null的行进行过滤,目前是不支持的。
-
-```sql
-select last_value(*) from root.test.sg1 group by([1,10), 2ms) without null all(last_value(`root.sg1.d1.s3`)) align by device
-```
-
-### 聚合查询
-
-```sql
-select avg(s4), sum(s2) from root.test.sg1 group by ([1,10), 2ms) without null all(sum(s2))
-```
-
-```sql
-select avg(s4), sum(s2), count(s3) from root.test.sg1 group by ([1,10), 2ms) without null all(avg(s4), sum(s2))
-```
-
-### 指定全路径列名
-
-假设下面的查询输出的结果列为"root.test.sg1.s2", "root.test.sg1.s3", "root.test.sg2.s2", "root.test.sg2.s3"四个,可以使用全路径名指定相应列进行过滤,比如下面的例子:
-
-1. 指定`root.test.sg1.s2`, `root.test.sg2.s3`两列都为null则过滤
-
-```sql
-select s2, s3 from root.test.** without null all(root.test.sg1.s2, root.test.sg2.s3)
-```
-
-2. 指定`root.test.sg1.s2`, `root.test.sg1.s3`, `root.test.sg2.s3`三列都为null则过滤
-
-```sql
-select s2, s3 from root.test.** without null all(root.test.sg1.s2, s3)
-```
-
-### 对齐序列查询
-
-1. 可以指定`without null` 子句后的列名为对齐序列列名
-
-```sql
-CREATE ALIGNED TIMESERIES root.test.sg3(s5 INT32, s6 BOOLEAN, s7 DOUBLE, s8 INT32)
-select sg1.s1, sg1.s2, sg2.s3, sg3.* from root.test without null all (sg3.s5, sg3.s6, sg2.s3)
-```
\ No newline at end of file
diff --git a/docs/zh/UserGuide/Reference/Syntax-Conventions.md b/docs/zh/UserGuide/Reference/Syntax-Conventions.md
index a066f8d649..fb1222b9e7 100644
--- a/docs/zh/UserGuide/Reference/Syntax-Conventions.md
+++ b/docs/zh/UserGuide/Reference/Syntax-Conventions.md
@@ -26,11 +26,7 @@
 
 ### 字符串常量
 
-> 我们参照了 MySQL 对 字符串的定义:A string is a sequence of bytes or characters, enclosed within either single quote (`'`) or double quote (`"`) characters.
-
-MySQL 对字符串的定义可以参考:[MySQL :: MySQL 8.0 Reference Manual :: 9.1.1 String Literals](https://dev.mysql.com/doc/refman/8.0/en/string-literals.html)
-
-即在 IoTDB 中,字符串是由**单引号(`'`)或双引号(`"`)字符括起来的字符序列**。示例如下:
+在 IoTDB 中,字符串是由**单引号(`'`)或双引号(`"`)字符括起来的字符序列**。示例如下:
 
 ```Plain%20Text
 'a string'
diff --git a/docs/zh/UserGuide/Process-Data/Triggers.md b/docs/zh/UserGuide/Trigger/Trigger.md
similarity index 100%
rename from docs/zh/UserGuide/Process-Data/Triggers.md
rename to docs/zh/UserGuide/Trigger/Trigger.md
diff --git a/docs/zh/UserGuide/UDF-Library/Quick-Start.md b/docs/zh/UserGuide/UDF-Library/Quick-Start.md
deleted file mode 100644
index 002a85ecf0..0000000000
--- a/docs/zh/UserGuide/UDF-Library/Quick-Start.md
+++ /dev/null
@@ -1,40 +0,0 @@
-<!--
-
-​    Licensed to the Apache Software Foundation (ASF) under one
-​    or more contributor license agreements.  See the NOTICE file
-​    distributed with this work for additional information
-​    regarding copyright ownership.  The ASF licenses this file
-​    to you under the Apache License, Version 2.0 (the
-​    "License"); you may not use this file except in compliance
-​    with the License.  You may obtain a copy of the License at
-​    
-​        http://www.apache.org/licenses/LICENSE-2.0
-​    
-​    Unless required by applicable law or agreed to in writing,
-​    software distributed under the License is distributed on an
-​    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-​    KIND, either express or implied.  See the License for the
-​    specific language governing permissions and limitations
-​    under the License.
-
--->
-
-# 快速开始
-
-## 什么是 UDF 函数库
-
-对基于时序数据的应用而言,数据质量至关重要。**UDF 函数库** 基于 IoTDB 用户自定义函数 (UDF),实现了一系列关于数据质量的函数,包括数据画像、数据质量评估与修复等,有效满足了工业领域对数据质量的需求。
-
-## 快速开始
-
-1. 下载包含全部依赖的 jar 包和注册脚本;
-2. 将 jar 包复制到 IoTDB 程序目录的`ext\udf`目录下;
-3. 运行`sbin\start-server.bat`(在 Windows 下)或`sbin\start-server.sh`(在 Linux 或 MacOS 下)以启动 IoTDB 服务器;
-4. 将注册脚本复制到 IoTDB 的程序目录下(与`sbin`目录同级的根目录下),修改脚本中的参数(如果需要)并运行注册脚本以注册 UDF。
-
-
-## 下载
-
-由于我们的代码正在审核中,Apache仓库中目前还没有代码。在审核完成之前,您可以前往我们的[旧网页](https://thulab.github.io/iotdb-quality/zh/Download.html)下载上述文件。
-
-
diff --git a/server/src/main/java/org/apache/iotdb/db/mpp/plan/execution/config/metadata/ShowFunctionsTask.java b/server/src/main/java/org/apache/iotdb/db/mpp/plan/execution/config/metadata/ShowFunctionsTask.java
index a1cf76f11c..b54183234f 100644
--- a/server/src/main/java/org/apache/iotdb/db/mpp/plan/execution/config/metadata/ShowFunctionsTask.java
+++ b/server/src/main/java/org/apache/iotdb/db/mpp/plan/execution/config/metadata/ShowFunctionsTask.java
@@ -39,6 +39,8 @@ import com.google.common.util.concurrent.SettableFuture;
 
 import java.lang.reflect.InvocationTargetException;
 import java.nio.ByteBuffer;
+import java.util.ArrayList;
+import java.util.Comparator;
 import java.util.List;
 import java.util.stream.Collectors;
 
@@ -62,16 +64,21 @@ public class ShowFunctionsTask implements IConfigTask {
             .map(ColumnHeader::getColumnType)
             .collect(Collectors.toList());
     TsBlockBuilder builder = new TsBlockBuilder(outputDataTypes);
+    List<UDFInformation> udfInformations = new ArrayList<>();
     if (allUDFInformation != null && !allUDFInformation.isEmpty()) {
       for (ByteBuffer udfInformationByteBuffer : allUDFInformation) {
         UDFInformation udfInformation = UDFInformation.deserialize(udfInformationByteBuffer);
-        appendUDFInformation(builder, udfInformation);
+        udfInformations.add(udfInformation);
       }
     }
     // native and built-in functions
-    UDFManagementService.getInstance()
-        .getAllBuiltInTimeSeriesGeneratingInformation()
-        .forEach(udfInformation -> appendUDFInformation(builder, udfInformation));
+    udfInformations.addAll(
+        UDFManagementService.getInstance().getAllBuiltInTimeSeriesGeneratingInformation());
+
+    udfInformations.sort(Comparator.comparing(UDFInformation::getFunctionName));
+    for (UDFInformation udfInformation : udfInformations) {
+      appendUDFInformation(builder, udfInformation);
+    }
     appendNativeFunctions(builder);
     DatasetHeader datasetHeader = DatasetHeaderFactory.getShowFunctionsHeader();
     future.set(new ConfigTaskResult(TSStatusCode.SUCCESS_STATUS, builder.build(), datasetHeader));
diff --git a/server/src/main/java/org/apache/iotdb/db/mpp/plan/parser/ASTVisitor.java b/server/src/main/java/org/apache/iotdb/db/mpp/plan/parser/ASTVisitor.java
index e0d786cbb0..da4b06a49a 100644
--- a/server/src/main/java/org/apache/iotdb/db/mpp/plan/parser/ASTVisitor.java
+++ b/server/src/main/java/org/apache/iotdb/db/mpp/plan/parser/ASTVisitor.java
@@ -3058,7 +3058,7 @@ public class ASTVisitor extends IoTDBSqlParserBaseVisitor<Statement> {
   private void parseSelectStatementForPipe(
       IoTDBSqlParser.SelectStatementContext ctx, CreatePipeStatement statement)
       throws SQLParserException {
-    if (ctx.TRACING() != null || ctx.intoClause() != null || ctx.specialClause() != null) {
+    if (ctx.intoClause() != null || ctx.specialClause() != null) {
       throw new SQLParserException("Not support for this sql in pipe.");
     }
 
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 5237b450b1..4a9b7afeb4 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
@@ -1207,7 +1207,7 @@ public class IoTDBSqlVisitor extends IoTDBSqlParserBaseVisitor<Operator> {
       WhereComponent whereComponent = parseWhereClause(ctx.whereClause());
       queryOp.setWhereComponent(whereComponent);
     }
-    queryOp.setEnableTracing(ctx.TRACING() != null);
+    queryOp.setEnableTracing(false);
     // 4. Check whether it's a select-into clause
     return ctx.intoClause() == null ? queryOp : parseAndConstructSelectIntoOperator(ctx);
   }
@@ -2448,7 +2448,7 @@ public class IoTDBSqlVisitor extends IoTDBSqlParserBaseVisitor<Operator> {
   private void parseSelectStatementForPipe(
       IoTDBSqlParser.SelectStatementContext ctx, CreatePipeOperator operator)
       throws SQLParserException {
-    if (ctx.TRACING() != null || ctx.intoClause() != null || ctx.specialClause() != null) {
+    if (ctx.intoClause() != null || ctx.specialClause() != null) {
       throw new SQLParserException("Not support for this sql in pipe.");
     }
 
diff --git a/site/src/main/.vuepress/config.js b/site/src/main/.vuepress/config.js
index 9bbeb462c4..c60dddbc63 100644
--- a/site/src/main/.vuepress/config.js
+++ b/site/src/main/.vuepress/config.js
@@ -647,7 +647,7 @@ var config = {
 				],
 				'/UserGuide/V0.13.x/': [
 					{
-						title:'IoTDB User Guide (latest)',
+						title:'IoTDB User Guide (V0.13.x)',
 						collapsable: false,
 					},
 					{
@@ -925,9 +925,7 @@ var config = {
 							['Query-Data/Result-Format.md','Query Result Formats'],
 							['Query-Data/Aggregate-Query.md','Aggregate Query'],
 							['Query-Data/Last-Query.md','Last Query'],
-							['Query-Data/Fill-Null-Value.md','Fill Null Value'],
-							['Query-Data/Without-Null.md','Without Null'],
-							['Query-Data/Tracing-Tool.md','Tracing Tool']
+							['Query-Data/Fill-Null-Value.md','Fill Null Value']
 						]
 					},
 					{
@@ -1595,7 +1593,7 @@ var config = {
 				],
 				'/zh/UserGuide/V0.13.x/': [
 					{
-						title: 'IoTDB用户手册 (In progress)',
+						title: 'IoTDB用户手册 (V0.13.x)',
 						collapsable: false,
 					},
 					{
@@ -1866,26 +1864,55 @@ var config = {
 						title: '数据查询',
 						sidebarDepth: 1,
 						children: [
-							['Query-Data/Overview.md','概述'],
-							['Query-Data/Select-Expression.md','选择表达式'],
-							['Query-Data/Query-Filter.md','查询过滤条件'],
-							['Query-Data/Pagination.md','查询结果分页'],
-							['Query-Data/Result-Format.md','查询结果对齐格式'],
-							['Query-Data/Aggregate-Query.md','聚合查询'],
-							['Query-Data/Last-Query.md','最新点查询'],
-							['Query-Data/Fill-Null-Value.md','空值填充'],
-							['Query-Data/Without-Null.md','空值过滤'],
-							['Query-Data/Tracing-Tool.md','查询性能追踪']
+							['Query-Data/Overview','概述'],
+							['Query-Data/Select-Expression','选择表达式'],
+							['Query-Data/Last-Query','最新点查询'],
+							['Query-Data/Align-By','查询对齐模式'],
+							['Query-Data/Where-Condition','查询过滤条件'],
+							['Query-Data/Group-By','分段分组聚合'],
+							['Query-Data/Having-Condition','聚合结果过滤'],
+							['Query-Data/Order-By','结果集排序'],
+							['Query-Data/Fill','结果集补空值'],
+							['Query-Data/Pagination','结果集分页'],
+							['Query-Data/Select-Into','查询写回'],
+							['Query-Data/Continuous-Query','连续查询'],
 						]
 					},
 					{
-						title: '数据处理',
+						title: '运算符和函数',
 						sidebarDepth: 1,
 						children: [
-							['Process-Data/UDF-User-Defined-Function','用户定义函数(UDF)'],
-							['Process-Data/Select-Into','查询写回(SELECT INTO)'],
-							['Process-Data/Continuous-Query','连续查询(CQ)'],
-							['Process-Data/Triggers','触发器'],
+							['Operators-Functions/Overview','概述'],
+							['Operators-Functions/User-Defined-Function','用户自定义函数'],
+							['Operators-Functions/Aggregation','聚合函数'],
+							['Operators-Functions/Mathematical','算数运算符和函数'],
+							['Operators-Functions/Comparison','比较运算符和函数'],
+							['Operators-Functions/Logical','逻辑运算符'],
+							['Operators-Functions/String','字符串处理'],
+							['Operators-Functions/Conversion','数据类型转换'],
+							['Operators-Functions/Constant','常序列生成'],
+							['Operators-Functions/Selection','选择函数'],
+							['Operators-Functions/Continuous-Interval','区间查询'],
+							['Operators-Functions/Variation-Trend','趋势计算'],
+							['Operators-Functions/Sample','采样函数'],
+							['Operators-Functions/Time-Series','时间序列处理'],
+							['Operators-Functions/Lambda','Lambda 表达式'],
+
+							// IoTDB-Quality
+							['Operators-Functions/Data-Profiling','数据画像'],
+							['Operators-Functions/Anomaly-Detection','异常检测'],
+							['Operators-Functions/Data-Matching','数据匹配'],
+							['Operators-Functions/Frequency-Domain','频域分析'],
+							['Operators-Functions/Data-Quality','数据质量'],
+							['Operators-Functions/Data-Repairing','数据修复'],
+							['Operators-Functions/Series-Discovery','序列发现']
+						]
+					},
+					{
+						title: '触发器',
+						sidebarDepth: 1,
+						children: [
+							['Trigger/Trigger','触发器'],
 						]
 					},
 					{
@@ -1944,23 +1971,6 @@ var config = {
 						]
 					},
 					{
-                        title: 'UDF 资料库',
-                        sidebarDepth: 1,
-                        children: [
-                            ['UDF-Library/Quick-Start', '快速开始'],
-                            ['UDF-Library/Data-Profiling', '数据画像'],
-                            ['UDF-Library/Anomaly-Detection', '异常检测'],
-                            ['UDF-Library/Data-Matching', '数据匹配'],
-                            ['UDF-Library/Frequency-Domain', '频域分析'],
-                            ['UDF-Library/Data-Quality', '数据质量'],
-                            ['UDF-Library/Data-Repairing', '数据修复'],
-                            ['UDF-Library/Series-Discovery', '序列发现'],
-                            ['UDF-Library/Series-Processing', '序列处理'],
-                            ['UDF-Library/String-Processing', '字符串处理'],
-                            ['UDF-Library/M4', 'M4']
-                        ]
-                    },
-					{
 						title: 'FAQ',
 						children: [
 							['FAQ/Frequently-asked-questions','常见问题'],