You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by qi...@apache.org on 2022/01/01 15:42:56 UTC

[iotdb] branch master updated: [IOTDB-2240] Library-UDF Data Quality Docs (#4693)

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

qiaojialin 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 10e58c2  [IOTDB-2240] Library-UDF Data Quality Docs (#4693)
10e58c2 is described below

commit 10e58c2eef83da860fec95b73de22d59f71f7306
Author: Pengyu Chen <48...@users.noreply.github.com>
AuthorDate: Sat Jan 1 23:42:22 2022 +0800

    [IOTDB-2240] Library-UDF Data Quality Docs (#4693)
---
 docs/UserGuide/Library-UDF/Data-Quality.md    | 520 ++++++++++++++++++++++++++
 docs/zh/UserGuide/Library-UDF/Data-Quality.md | 509 +++++++++++++++++++++++++
 site/src/main/.vuepress/config.js             |   6 +-
 3 files changed, 1033 insertions(+), 2 deletions(-)

diff --git a/docs/UserGuide/Library-UDF/Data-Quality.md b/docs/UserGuide/Library-UDF/Data-Quality.md
new file mode 100644
index 0000000..4881ad3
--- /dev/null
+++ b/docs/UserGuide/Library-UDF/Data-Quality.md
@@ -0,0 +1,520 @@
+<!--
+
+    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.
+
+-->
+# Completeness
+
+## Usage
+This function is used to calculate the completeness of time series. The input series are divided into several continuous and non overlapping windows. The timestamp of the first data point and the completeness of each window will be output.
+
+**Name:** COMPLETENESS
+
+**Input Series:** Only support a single input series. The type is INT32 / INT64 / FLOAT / DOUBLE.
+
+**Parameters:**
+
++ `window`: The size of each window. It is a positive integer or a positive number with an unit. The former is the number of data points in each window. The number of data points in the last window may be less than it. The latter is the time of the window. The unit is 'ms' for millisecond, 's' for second, 'm' for minute, 'h' for hour and 'd' for day. By default, all input data belongs to the same window.
++ `downtime`: Whether the downtime exception is considered in the calculation of completeness. It is 'true' or 'false' (default). When considering the downtime exception, long-term missing data will be considered as downtime exception without any influence on completeness.
+
+**Output Series:** Output a single series. The type is DOUBLE. The range of each value is [0,1].
+
+**Note:** Only when the number of data points in the window exceeds 10, the calculation will be performed. Otherwise, the window will be ignored and nothing will be output.
+
+
+
+## Examples
+
+### Default Parameters
+
+With default parameters, this function will regard all input data as the same window.
+
+Input series:
+
+```
++-----------------------------+---------------+
+|                         Time|root.test.d1.s1|
++-----------------------------+---------------+
+|2020-01-01T00:00:02.000+08:00|          100.0|
+|2020-01-01T00:00:03.000+08:00|          101.0|
+|2020-01-01T00:00:04.000+08:00|          102.0|
+|2020-01-01T00:00:06.000+08:00|          104.0|
+|2020-01-01T00:00:08.000+08:00|          126.0|
+|2020-01-01T00:00:10.000+08:00|          108.0|
+|2020-01-01T00:00:14.000+08:00|          112.0|
+|2020-01-01T00:00:15.000+08:00|          113.0|
+|2020-01-01T00:00:16.000+08:00|          114.0|
+|2020-01-01T00:00:18.000+08:00|          116.0|
+|2020-01-01T00:00:20.000+08:00|          118.0|
+|2020-01-01T00:00:22.000+08:00|          120.0|
+|2020-01-01T00:00:26.000+08:00|          124.0|
+|2020-01-01T00:00:28.000+08:00|          126.0|
+|2020-01-01T00:00:30.000+08:00|            NaN|
++-----------------------------+---------------+
+```
+
+SQL for query:
+
+```sql
+select completeness(s1) from root.test.d1 where time <= 2020-01-01 00:00:30
+```
+
+Output series:
+
+```
++-----------------------------+-----------------------------+
+|                         Time|completeness(root.test.d1.s1)|
++-----------------------------+-----------------------------+
+|2020-01-01T00:00:02.000+08:00|                        0.875|
++-----------------------------+-----------------------------+
+```
+
+### Specific Window Size
+
+When the window size is given, this function will divide the input data as multiple windows.
+
+Input series:
+
+```
++-----------------------------+---------------+
+|                         Time|root.test.d1.s1|
++-----------------------------+---------------+
+|2020-01-01T00:00:02.000+08:00|          100.0|
+|2020-01-01T00:00:03.000+08:00|          101.0|
+|2020-01-01T00:00:04.000+08:00|          102.0|
+|2020-01-01T00:00:06.000+08:00|          104.0|
+|2020-01-01T00:00:08.000+08:00|          126.0|
+|2020-01-01T00:00:10.000+08:00|          108.0|
+|2020-01-01T00:00:14.000+08:00|          112.0|
+|2020-01-01T00:00:15.000+08:00|          113.0|
+|2020-01-01T00:00:16.000+08:00|          114.0|
+|2020-01-01T00:00:18.000+08:00|          116.0|
+|2020-01-01T00:00:20.000+08:00|          118.0|
+|2020-01-01T00:00:22.000+08:00|          120.0|
+|2020-01-01T00:00:26.000+08:00|          124.0|
+|2020-01-01T00:00:28.000+08:00|          126.0|
+|2020-01-01T00:00:30.000+08:00|            NaN|
+|2020-01-01T00:00:32.000+08:00|          130.0|
+|2020-01-01T00:00:34.000+08:00|          132.0|
+|2020-01-01T00:00:36.000+08:00|          134.0|
+|2020-01-01T00:00:38.000+08:00|          136.0|
+|2020-01-01T00:00:40.000+08:00|          138.0|
+|2020-01-01T00:00:42.000+08:00|          140.0|
+|2020-01-01T00:00:44.000+08:00|          142.0|
+|2020-01-01T00:00:46.000+08:00|          144.0|
+|2020-01-01T00:00:48.000+08:00|          146.0|
+|2020-01-01T00:00:50.000+08:00|          148.0|
+|2020-01-01T00:00:52.000+08:00|          150.0|
+|2020-01-01T00:00:54.000+08:00|          152.0|
+|2020-01-01T00:00:56.000+08:00|          154.0|
+|2020-01-01T00:00:58.000+08:00|          156.0|
+|2020-01-01T00:01:00.000+08:00|          158.0|
++-----------------------------+---------------+
+```
+
+SQL for query:
+
+```sql
+select completeness(s1,"window"="15") from root.test.d1 where time <= 2020-01-01 00:01:00
+```
+
+Output series:
+
+```
++-----------------------------+--------------------------------------------+
+|                         Time|completeness(root.test.d1.s1, "window"="15")|
++-----------------------------+--------------------------------------------+
+|2020-01-01T00:00:02.000+08:00|                                       0.875|
+|2020-01-01T00:00:32.000+08:00|                                         1.0|
++-----------------------------+--------------------------------------------+
+```
+
+# Consistency
+
+## Usage
+This function is used to calculate the consistency of time series. The input series are divided into several continuous and non overlapping windows. The timestamp of the first data point and the consistency of each window will be output.
+
+**Name:** CONSISTENCY
+
+**Input Series:** Only support a single input series. The type is INT32 / INT64 / FLOAT / DOUBLE.
+
+**Parameters:**
+
++ `window`: The size of each window. It is a positive integer or a positive number with an unit. The former is the number of data points in each window. The number of data points in the last window may be less than it. The latter is the time of the window. The unit is 'ms' for millisecond, 's' for second, 'm' for minute, 'h' for hour and 'd' for day. By default, all input data belongs to the same window.
+
+**Output Series:** Output a single series. The type is DOUBLE. The range of each value is [0,1].
+
+**Note:** Only when the number of data points in the window exceeds 10, the calculation will be performed. Otherwise, the window will be ignored and nothing will be output.
+
+
+
+## Examples
+
+### Default Parameters
+
+With default parameters, this function will regard all input data as the same window.
+
+Input series:
+
+```
++-----------------------------+---------------+
+|                         Time|root.test.d1.s1|
++-----------------------------+---------------+
+|2020-01-01T00:00:02.000+08:00|          100.0|
+|2020-01-01T00:00:03.000+08:00|          101.0|
+|2020-01-01T00:00:04.000+08:00|          102.0|
+|2020-01-01T00:00:06.000+08:00|          104.0|
+|2020-01-01T00:00:08.000+08:00|          126.0|
+|2020-01-01T00:00:10.000+08:00|          108.0|
+|2020-01-01T00:00:14.000+08:00|          112.0|
+|2020-01-01T00:00:15.000+08:00|          113.0|
+|2020-01-01T00:00:16.000+08:00|          114.0|
+|2020-01-01T00:00:18.000+08:00|          116.0|
+|2020-01-01T00:00:20.000+08:00|          118.0|
+|2020-01-01T00:00:22.000+08:00|          120.0|
+|2020-01-01T00:00:26.000+08:00|          124.0|
+|2020-01-01T00:00:28.000+08:00|          126.0|
+|2020-01-01T00:00:30.000+08:00|            NaN|
++-----------------------------+---------------+
+```
+
+SQL for query:
+
+```sql
+select consistency(s1) from root.test.d1 where time <= 2020-01-01 00:00:30
+```
+
+Output series:
+
+```
++-----------------------------+----------------------------+
+|                         Time|consistency(root.test.d1.s1)|
++-----------------------------+----------------------------+
+|2020-01-01T00:00:02.000+08:00|          0.9333333333333333|
++-----------------------------+----------------------------+
+```
+
+### Specific Window Size
+
+When the window size is given, this function will divide the input data as multiple windows.
+
+Input series:
+
+```
++-----------------------------+---------------+
+|                         Time|root.test.d1.s1|
++-----------------------------+---------------+
+|2020-01-01T00:00:02.000+08:00|          100.0|
+|2020-01-01T00:00:03.000+08:00|          101.0|
+|2020-01-01T00:00:04.000+08:00|          102.0|
+|2020-01-01T00:00:06.000+08:00|          104.0|
+|2020-01-01T00:00:08.000+08:00|          126.0|
+|2020-01-01T00:00:10.000+08:00|          108.0|
+|2020-01-01T00:00:14.000+08:00|          112.0|
+|2020-01-01T00:00:15.000+08:00|          113.0|
+|2020-01-01T00:00:16.000+08:00|          114.0|
+|2020-01-01T00:00:18.000+08:00|          116.0|
+|2020-01-01T00:00:20.000+08:00|          118.0|
+|2020-01-01T00:00:22.000+08:00|          120.0|
+|2020-01-01T00:00:26.000+08:00|          124.0|
+|2020-01-01T00:00:28.000+08:00|          126.0|
+|2020-01-01T00:00:30.000+08:00|            NaN|
+|2020-01-01T00:00:32.000+08:00|          130.0|
+|2020-01-01T00:00:34.000+08:00|          132.0|
+|2020-01-01T00:00:36.000+08:00|          134.0|
+|2020-01-01T00:00:38.000+08:00|          136.0|
+|2020-01-01T00:00:40.000+08:00|          138.0|
+|2020-01-01T00:00:42.000+08:00|          140.0|
+|2020-01-01T00:00:44.000+08:00|          142.0|
+|2020-01-01T00:00:46.000+08:00|          144.0|
+|2020-01-01T00:00:48.000+08:00|          146.0|
+|2020-01-01T00:00:50.000+08:00|          148.0|
+|2020-01-01T00:00:52.000+08:00|          150.0|
+|2020-01-01T00:00:54.000+08:00|          152.0|
+|2020-01-01T00:00:56.000+08:00|          154.0|
+|2020-01-01T00:00:58.000+08:00|          156.0|
+|2020-01-01T00:01:00.000+08:00|          158.0|
++-----------------------------+---------------+
+```
+
+SQL for query:
+
+```sql
+select consistency(s1,"window"="15") from root.test.d1 where time <= 2020-01-01 00:01:00
+```
+
+Output series:
+
+```
++-----------------------------+-------------------------------------------+
+|                         Time|consistency(root.test.d1.s1, "window"="15")|
++-----------------------------+-------------------------------------------+
+|2020-01-01T00:00:02.000+08:00|                         0.9333333333333333|
+|2020-01-01T00:00:32.000+08:00|                                        1.0|
++-----------------------------+-------------------------------------------+
+```
+
+# Timeliness
+
+## Usage
+This function is used to calculate the timeliness of time series. The input series are divided into several continuous and non overlapping windows. The timestamp of the first data point and the timeliness of each window will be output.
+
+**Name:** TIMELINESS
+
+**Input Series:** Only support a single input series. The type is INT32 / INT64 / FLOAT / DOUBLE.
+
+**Parameters:**
+
++ `window`: The size of each window. It is a positive integer or a positive number with an unit. The former is the number of data points in each window. The number of data points in the last window may be less than it. The latter is the time of the window. The unit is 'ms' for millisecond, 's' for second, 'm' for minute, 'h' for hour and 'd' for day. By default, all input data belongs to the same window.
+
+**Output Series:** Output a single series. The type is DOUBLE. The range of each value is [0,1].
+
+**Note:** Only when the number of data points in the window exceeds 10, the calculation will be performed. Otherwise, the window will be ignored and nothing will be output.
+
+
+
+## Examples
+
+### Default Parameters
+
+With default parameters, this function will regard all input data as the same window.
+
+Input series:
+
+```
++-----------------------------+---------------+
+|                         Time|root.test.d1.s1|
++-----------------------------+---------------+
+|2020-01-01T00:00:02.000+08:00|          100.0|
+|2020-01-01T00:00:03.000+08:00|          101.0|
+|2020-01-01T00:00:04.000+08:00|          102.0|
+|2020-01-01T00:00:06.000+08:00|          104.0|
+|2020-01-01T00:00:08.000+08:00|          126.0|
+|2020-01-01T00:00:10.000+08:00|          108.0|
+|2020-01-01T00:00:14.000+08:00|          112.0|
+|2020-01-01T00:00:15.000+08:00|          113.0|
+|2020-01-01T00:00:16.000+08:00|          114.0|
+|2020-01-01T00:00:18.000+08:00|          116.0|
+|2020-01-01T00:00:20.000+08:00|          118.0|
+|2020-01-01T00:00:22.000+08:00|          120.0|
+|2020-01-01T00:00:26.000+08:00|          124.0|
+|2020-01-01T00:00:28.000+08:00|          126.0|
+|2020-01-01T00:00:30.000+08:00|            NaN|
++-----------------------------+---------------+
+```
+
+SQL for query:
+
+```sql
+select timeliness(s1) from root.test.d1 where time <= 2020-01-01 00:00:30
+```
+
+Output series:
+
+```
++-----------------------------+---------------------------+
+|                         Time|timeliness(root.test.d1.s1)|
++-----------------------------+---------------------------+
+|2020-01-01T00:00:02.000+08:00|         0.9333333333333333|
++-----------------------------+---------------------------+
+```
+
+### Specific Window Size
+
+When the window size is given, this function will divide the input data as multiple windows.
+
+Input series:
+
+```
++-----------------------------+---------------+
+|                         Time|root.test.d1.s1|
++-----------------------------+---------------+
+|2020-01-01T00:00:02.000+08:00|          100.0|
+|2020-01-01T00:00:03.000+08:00|          101.0|
+|2020-01-01T00:00:04.000+08:00|          102.0|
+|2020-01-01T00:00:06.000+08:00|          104.0|
+|2020-01-01T00:00:08.000+08:00|          126.0|
+|2020-01-01T00:00:10.000+08:00|          108.0|
+|2020-01-01T00:00:14.000+08:00|          112.0|
+|2020-01-01T00:00:15.000+08:00|          113.0|
+|2020-01-01T00:00:16.000+08:00|          114.0|
+|2020-01-01T00:00:18.000+08:00|          116.0|
+|2020-01-01T00:00:20.000+08:00|          118.0|
+|2020-01-01T00:00:22.000+08:00|          120.0|
+|2020-01-01T00:00:26.000+08:00|          124.0|
+|2020-01-01T00:00:28.000+08:00|          126.0|
+|2020-01-01T00:00:30.000+08:00|            NaN|
+|2020-01-01T00:00:32.000+08:00|          130.0|
+|2020-01-01T00:00:34.000+08:00|          132.0|
+|2020-01-01T00:00:36.000+08:00|          134.0|
+|2020-01-01T00:00:38.000+08:00|          136.0|
+|2020-01-01T00:00:40.000+08:00|          138.0|
+|2020-01-01T00:00:42.000+08:00|          140.0|
+|2020-01-01T00:00:44.000+08:00|          142.0|
+|2020-01-01T00:00:46.000+08:00|          144.0|
+|2020-01-01T00:00:48.000+08:00|          146.0|
+|2020-01-01T00:00:50.000+08:00|          148.0|
+|2020-01-01T00:00:52.000+08:00|          150.0|
+|2020-01-01T00:00:54.000+08:00|          152.0|
+|2020-01-01T00:00:56.000+08:00|          154.0|
+|2020-01-01T00:00:58.000+08:00|          156.0|
+|2020-01-01T00:01:00.000+08:00|          158.0|
++-----------------------------+---------------+
+```
+
+SQL for query:
+
+```sql
+select timeliness(s1,"window"="15") from root.test.d1 where time <= 2020-01-01 00:01:00
+```
+
+Output series:
+
+```
++-----------------------------+------------------------------------------+
+|                         Time|timeliness(root.test.d1.s1, "window"="15")|
++-----------------------------+------------------------------------------+
+|2020-01-01T00:00:02.000+08:00|                        0.9333333333333333|
+|2020-01-01T00:00:32.000+08:00|                                       1.0|
++-----------------------------+------------------------------------------+
+```
+
+# Validity
+
+## Usage
+This function is used to calculate the Validity of time series. The input series are divided into several continuous and non overlapping windows. The timestamp of the first data point and the Validity of each window will be output.
+
+**Name:** VALIDITY
+
+**Input Series:** Only support a single input series. The type is INT32 / INT64 / FLOAT / DOUBLE.
+
+**Parameters:**
+
++ `window`: The size of each window. It is a positive integer or a positive number with an unit. The former is the number of data points in each window. The number of data points in the last window may be less than it. The latter is the time of the window. The unit is 'ms' for millisecond, 's' for second, 'm' for minute, 'h' for hour and 'd' for day. By default, all input data belongs to the same window.
+
+**Output Series:** Output a single series. The type is DOUBLE. The range of each value is [0,1].
+
+**Note:** Only when the number of data points in the window exceeds 10, the calculation will be performed. Otherwise, the window will be ignored and nothing will be output.
+
+
+
+## Examples
+
+### Default Parameters
+
+With default parameters, this function will regard all input data as the same window.
+
+Input series:
+
+```
++-----------------------------+---------------+
+|                         Time|root.test.d1.s1|
++-----------------------------+---------------+
+|2020-01-01T00:00:02.000+08:00|          100.0|
+|2020-01-01T00:00:03.000+08:00|          101.0|
+|2020-01-01T00:00:04.000+08:00|          102.0|
+|2020-01-01T00:00:06.000+08:00|          104.0|
+|2020-01-01T00:00:08.000+08:00|          126.0|
+|2020-01-01T00:00:10.000+08:00|          108.0|
+|2020-01-01T00:00:14.000+08:00|          112.0|
+|2020-01-01T00:00:15.000+08:00|          113.0|
+|2020-01-01T00:00:16.000+08:00|          114.0|
+|2020-01-01T00:00:18.000+08:00|          116.0|
+|2020-01-01T00:00:20.000+08:00|          118.0|
+|2020-01-01T00:00:22.000+08:00|          120.0|
+|2020-01-01T00:00:26.000+08:00|          124.0|
+|2020-01-01T00:00:28.000+08:00|          126.0|
+|2020-01-01T00:00:30.000+08:00|            NaN|
++-----------------------------+---------------+
+```
+
+SQL for query:
+
+```sql
+select Validity(s1) from root.test.d1 where time <= 2020-01-01 00:00:30
+```
+
+Output series:
+
+```
++-----------------------------+-------------------------+
+|                         Time|validity(root.test.d1.s1)|
++-----------------------------+-------------------------+
+|2020-01-01T00:00:02.000+08:00|       0.8833333333333333|
++-----------------------------+-------------------------+
+```
+
+### Specific Window Size
+
+When the window size is given, this function will divide the input data as multiple windows.
+
+Input series:
+
+```
++-----------------------------+---------------+
+|                         Time|root.test.d1.s1|
++-----------------------------+---------------+
+|2020-01-01T00:00:02.000+08:00|          100.0|
+|2020-01-01T00:00:03.000+08:00|          101.0|
+|2020-01-01T00:00:04.000+08:00|          102.0|
+|2020-01-01T00:00:06.000+08:00|          104.0|
+|2020-01-01T00:00:08.000+08:00|          126.0|
+|2020-01-01T00:00:10.000+08:00|          108.0|
+|2020-01-01T00:00:14.000+08:00|          112.0|
+|2020-01-01T00:00:15.000+08:00|          113.0|
+|2020-01-01T00:00:16.000+08:00|          114.0|
+|2020-01-01T00:00:18.000+08:00|          116.0|
+|2020-01-01T00:00:20.000+08:00|          118.0|
+|2020-01-01T00:00:22.000+08:00|          120.0|
+|2020-01-01T00:00:26.000+08:00|          124.0|
+|2020-01-01T00:00:28.000+08:00|          126.0|
+|2020-01-01T00:00:30.000+08:00|            NaN|
+|2020-01-01T00:00:32.000+08:00|          130.0|
+|2020-01-01T00:00:34.000+08:00|          132.0|
+|2020-01-01T00:00:36.000+08:00|          134.0|
+|2020-01-01T00:00:38.000+08:00|          136.0|
+|2020-01-01T00:00:40.000+08:00|          138.0|
+|2020-01-01T00:00:42.000+08:00|          140.0|
+|2020-01-01T00:00:44.000+08:00|          142.0|
+|2020-01-01T00:00:46.000+08:00|          144.0|
+|2020-01-01T00:00:48.000+08:00|          146.0|
+|2020-01-01T00:00:50.000+08:00|          148.0|
+|2020-01-01T00:00:52.000+08:00|          150.0|
+|2020-01-01T00:00:54.000+08:00|          152.0|
+|2020-01-01T00:00:56.000+08:00|          154.0|
+|2020-01-01T00:00:58.000+08:00|          156.0|
+|2020-01-01T00:01:00.000+08:00|          158.0|
++-----------------------------+---------------+
+```
+
+SQL for query:
+
+```sql
+select Validity(s1,"window"="15") from root.test.d1 where time <= 2020-01-01 00:01:00
+```
+
+Output series:
+
+```
++-----------------------------+----------------------------------------+
+|                         Time|validity(root.test.d1.s1, "window"="15")|
++-----------------------------+----------------------------------------+
+|2020-01-01T00:00:02.000+08:00|                      0.8833333333333333|
+|2020-01-01T00:00:32.000+08:00|                                     1.0|
++-----------------------------+----------------------------------------+
+```
\ No newline at end of file
diff --git a/docs/zh/UserGuide/Library-UDF/Data-Quality.md b/docs/zh/UserGuide/Library-UDF/Data-Quality.md
new file mode 100644
index 0000000..5c71b14
--- /dev/null
+++ b/docs/zh/UserGuide/Library-UDF/Data-Quality.md
@@ -0,0 +1,509 @@
+<!--
+
+    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.
+
+-->
+# Completeness
+
+## 函数简介
+本函数用于计算时间序列的完整性。将输入序列划分为若干个连续且不重叠的窗口,分别计算每一个窗口的完整性,并输出窗口第一个数据点的时间戳和窗口的完整性。
+
+**函数名:** COMPLETENESS
+
+**输入序列:** 仅支持单个输入序列,类型为 INT32 / INT64 / FLOAT / DOUBLE。
+
+**参数:**
+
++ `window`:窗口大小,它是一个大于0的整数或者一个有单位的正数。前者代表每一个窗口包含的数据点数目,最后一个窗口的数据点数目可能会不足;后者代表窗口的时间跨度,目前支持五种单位,分别是'ms'(毫秒)、's'(秒)、'm'(分钟)、'h'(小时)和'd'(天)。缺省情况下,全部输入数据都属于同一个窗口。
++ `downtime`:完整性计算是否考虑停机异常。它的取值为 'true' 或 'false',默认值为 'true'. 在考虑停机异常时,长时间的数据缺失将被视作停机,不对完整性产生影响。
+
+**输出序列:** 输出单个序列,类型为DOUBLE,其中每一个数据点的值的范围都是 [0,1].
+
+**提示:** 只有当窗口内的数据点数目超过10时,才会进行完整性计算。否则,该窗口将被忽略,不做任何输出。
+
+
+## 使用示例
+
+### 参数缺省
+
+在参数缺省的情况下,本函数将会把全部输入数据都作为同一个窗口计算完整性。
+
+输入序列:
+```
++-----------------------------+---------------+
+|                         Time|root.test.d1.s1|
++-----------------------------+---------------+
+|2020-01-01T00:00:02.000+08:00|          100.0|
+|2020-01-01T00:00:03.000+08:00|          101.0|
+|2020-01-01T00:00:04.000+08:00|          102.0|
+|2020-01-01T00:00:06.000+08:00|          104.0|
+|2020-01-01T00:00:08.000+08:00|          126.0|
+|2020-01-01T00:00:10.000+08:00|          108.0|
+|2020-01-01T00:00:14.000+08:00|          112.0|
+|2020-01-01T00:00:15.000+08:00|          113.0|
+|2020-01-01T00:00:16.000+08:00|          114.0|
+|2020-01-01T00:00:18.000+08:00|          116.0|
+|2020-01-01T00:00:20.000+08:00|          118.0|
+|2020-01-01T00:00:22.000+08:00|          120.0|
+|2020-01-01T00:00:26.000+08:00|          124.0|
+|2020-01-01T00:00:28.000+08:00|          126.0|
+|2020-01-01T00:00:30.000+08:00|            NaN|
++-----------------------------+---------------+
+```
+
+用于查询的SQL语句:
+
+```sql
+select completeness(s1) from root.test.d1 where time <= 2020-01-01 00:00:30
+```
+
+输出序列:
+
+```
++-----------------------------+-----------------------------+
+|                         Time|completeness(root.test.d1.s1)|
++-----------------------------+-----------------------------+
+|2020-01-01T00:00:02.000+08:00|                        0.875|
++-----------------------------+-----------------------------+
+```
+
+### 指定窗口大小
+
+在指定窗口大小的情况下,本函数会把输入数据划分为若干个窗口计算完整性。
+
+输入序列:
+```
++-----------------------------+---------------+
+|                         Time|root.test.d1.s1|
++-----------------------------+---------------+
+|2020-01-01T00:00:02.000+08:00|          100.0|
+|2020-01-01T00:00:03.000+08:00|          101.0|
+|2020-01-01T00:00:04.000+08:00|          102.0|
+|2020-01-01T00:00:06.000+08:00|          104.0|
+|2020-01-01T00:00:08.000+08:00|          126.0|
+|2020-01-01T00:00:10.000+08:00|          108.0|
+|2020-01-01T00:00:14.000+08:00|          112.0|
+|2020-01-01T00:00:15.000+08:00|          113.0|
+|2020-01-01T00:00:16.000+08:00|          114.0|
+|2020-01-01T00:00:18.000+08:00|          116.0|
+|2020-01-01T00:00:20.000+08:00|          118.0|
+|2020-01-01T00:00:22.000+08:00|          120.0|
+|2020-01-01T00:00:26.000+08:00|          124.0|
+|2020-01-01T00:00:28.000+08:00|          126.0|
+|2020-01-01T00:00:30.000+08:00|            NaN|
+|2020-01-01T00:00:32.000+08:00|          130.0|
+|2020-01-01T00:00:34.000+08:00|          132.0|
+|2020-01-01T00:00:36.000+08:00|          134.0|
+|2020-01-01T00:00:38.000+08:00|          136.0|
+|2020-01-01T00:00:40.000+08:00|          138.0|
+|2020-01-01T00:00:42.000+08:00|          140.0|
+|2020-01-01T00:00:44.000+08:00|          142.0|
+|2020-01-01T00:00:46.000+08:00|          144.0|
+|2020-01-01T00:00:48.000+08:00|          146.0|
+|2020-01-01T00:00:50.000+08:00|          148.0|
+|2020-01-01T00:00:52.000+08:00|          150.0|
+|2020-01-01T00:00:54.000+08:00|          152.0|
+|2020-01-01T00:00:56.000+08:00|          154.0|
+|2020-01-01T00:00:58.000+08:00|          156.0|
+|2020-01-01T00:01:00.000+08:00|          158.0|
++-----------------------------+---------------+
+```
+
+用于查询的 SQL 语句:
+
+```sql
+select completeness(s1,"window"="15") from root.test.d1 where time <= 2020-01-01 00:01:00
+```
+
+输出序列:
+
+```
++-----------------------------+--------------------------------------------+
+|                         Time|completeness(root.test.d1.s1, "window"="15")|
++-----------------------------+--------------------------------------------+
+|2020-01-01T00:00:02.000+08:00|                                       0.875|
+|2020-01-01T00:00:32.000+08:00|                                         1.0|
++-----------------------------+--------------------------------------------+
+```
+
+# Consistency
+
+## 函数简介
+本函数用于计算时间序列的一致性。将输入序列划分为若干个连续且不重叠的窗口,分别计算每一个窗口的一致性,并输出窗口第一个数据点的时间戳和窗口的时效性。
+
+**函数名:** CONSISTENCY
+
+**输入序列:** 仅支持单个输入序列,类型为 INT32 / INT64 / FLOAT / DOUBLE
+
+**参数:**
+
++ `window`:窗口大小,它是一个大于0的整数或者一个有单位的正数。前者代表每一个窗口包含的数据点数目,最后一个窗口的数据点数目可能会不足;后者代表窗口的时间跨度,目前支持五种单位,分别是 'ms'(毫秒)、's'(秒)、'm'(分钟)、'h'(小时)和'd'(天)。缺省情况下,全部输入数据都属于同一个窗口。
+
+**输出序列:** 输出单个序列,类型为DOUBLE,其中每一个数据点的值的范围都是 [0,1].
+
+**提示:** 只有当窗口内的数据点数目超过10时,才会进行一致性计算。否则,该窗口将被忽略,不做任何输出。
+
+
+## 使用示例
+
+### 参数缺省
+
+在参数缺省的情况下,本函数将会把全部输入数据都作为同一个窗口计算一致性。
+
+输入序列:
+```
++-----------------------------+---------------+
+|                         Time|root.test.d1.s1|
++-----------------------------+---------------+
+|2020-01-01T00:00:02.000+08:00|          100.0|
+|2020-01-01T00:00:03.000+08:00|          101.0|
+|2020-01-01T00:00:04.000+08:00|          102.0|
+|2020-01-01T00:00:06.000+08:00|          104.0|
+|2020-01-01T00:00:08.000+08:00|          126.0|
+|2020-01-01T00:00:10.000+08:00|          108.0|
+|2020-01-01T00:00:14.000+08:00|          112.0|
+|2020-01-01T00:00:15.000+08:00|          113.0|
+|2020-01-01T00:00:16.000+08:00|          114.0|
+|2020-01-01T00:00:18.000+08:00|          116.0|
+|2020-01-01T00:00:20.000+08:00|          118.0|
+|2020-01-01T00:00:22.000+08:00|          120.0|
+|2020-01-01T00:00:26.000+08:00|          124.0|
+|2020-01-01T00:00:28.000+08:00|          126.0|
+|2020-01-01T00:00:30.000+08:00|            NaN|
++-----------------------------+---------------+
+```
+
+用于查询的SQL语句:
+
+```sql
+select consistency(s1) from root.test.d1 where time <= 2020-01-01 00:00:30
+```
+
+输出序列:
+
+```
++-----------------------------+----------------------------+
+|                         Time|consistency(root.test.d1.s1)|
++-----------------------------+----------------------------+
+|2020-01-01T00:00:02.000+08:00|          0.9333333333333333|
++-----------------------------+----------------------------+
+```
+
+### 指定窗口大小
+
+在指定窗口大小的情况下,本函数会把输入数据划分为若干个窗口计算一致性。
+
+输入序列:
+```
++-----------------------------+---------------+
+|                         Time|root.test.d1.s1|
++-----------------------------+---------------+
+|2020-01-01T00:00:02.000+08:00|          100.0|
+|2020-01-01T00:00:03.000+08:00|          101.0|
+|2020-01-01T00:00:04.000+08:00|          102.0|
+|2020-01-01T00:00:06.000+08:00|          104.0|
+|2020-01-01T00:00:08.000+08:00|          126.0|
+|2020-01-01T00:00:10.000+08:00|          108.0|
+|2020-01-01T00:00:14.000+08:00|          112.0|
+|2020-01-01T00:00:15.000+08:00|          113.0|
+|2020-01-01T00:00:16.000+08:00|          114.0|
+|2020-01-01T00:00:18.000+08:00|          116.0|
+|2020-01-01T00:00:20.000+08:00|          118.0|
+|2020-01-01T00:00:22.000+08:00|          120.0|
+|2020-01-01T00:00:26.000+08:00|          124.0|
+|2020-01-01T00:00:28.000+08:00|          126.0|
+|2020-01-01T00:00:30.000+08:00|            NaN|
+|2020-01-01T00:00:32.000+08:00|          130.0|
+|2020-01-01T00:00:34.000+08:00|          132.0|
+|2020-01-01T00:00:36.000+08:00|          134.0|
+|2020-01-01T00:00:38.000+08:00|          136.0|
+|2020-01-01T00:00:40.000+08:00|          138.0|
+|2020-01-01T00:00:42.000+08:00|          140.0|
+|2020-01-01T00:00:44.000+08:00|          142.0|
+|2020-01-01T00:00:46.000+08:00|          144.0|
+|2020-01-01T00:00:48.000+08:00|          146.0|
+|2020-01-01T00:00:50.000+08:00|          148.0|
+|2020-01-01T00:00:52.000+08:00|          150.0|
+|2020-01-01T00:00:54.000+08:00|          152.0|
+|2020-01-01T00:00:56.000+08:00|          154.0|
+|2020-01-01T00:00:58.000+08:00|          156.0|
+|2020-01-01T00:01:00.000+08:00|          158.0|
++-----------------------------+---------------+
+```
+
+用于查询的SQL语句:
+
+```sql
+select consistency(s1,"window"="15") from root.test.d1 where time <= 2020-01-01 00:01:00
+```
+
+输出序列:
+
+```
++-----------------------------+-------------------------------------------+
+|                         Time|consistency(root.test.d1.s1, "window"="15")|
++-----------------------------+-------------------------------------------+
+|2020-01-01T00:00:02.000+08:00|                         0.9333333333333333|
+|2020-01-01T00:00:32.000+08:00|                                        1.0|
++-----------------------------+-------------------------------------------+
+```
+
+# Timeliness
+
+## 函数简介
+本函数用于计算时间序列的时效性。将输入序列划分为若干个连续且不重叠的窗口,分别计算每一个窗口的时效性,并输出窗口第一个数据点的时间戳和窗口的时效性。
+
+**函数名:** TIMELINESS
+
+**输入序列:** 仅支持单个输入序列,类型为 INT32 / INT64 / FLOAT / DOUBLE
+
+**参数:**
+
++ `window`:窗口大小,它是一个大于0的整数或者一个有单位的正数。前者代表每一个窗口包含的数据点数目,最后一个窗口的数据点数目可能会不足;后者代表窗口的时间跨度,目前支持五种单位,分别是 'ms'(毫秒)、's'(秒)、'm'(分钟)、'h'(小时)和'd'(天)。缺省情况下,全部输入数据都属于同一个窗口。
+
+**输出序列:** 输出单个序列,类型为DOUBLE,其中每一个数据点的值的范围都是 [0,1].
+
+**提示:** 只有当窗口内的数据点数目超过10时,才会进行时效性计算。否则,该窗口将被忽略,不做任何输出。
+
+
+## 使用示例
+
+### 参数缺省
+
+在参数缺省的情况下,本函数将会把全部输入数据都作为同一个窗口计算时效性。
+
+输入序列:
+```
++-----------------------------+---------------+
+|                         Time|root.test.d1.s1|
++-----------------------------+---------------+
+|2020-01-01T00:00:02.000+08:00|          100.0|
+|2020-01-01T00:00:03.000+08:00|          101.0|
+|2020-01-01T00:00:04.000+08:00|          102.0|
+|2020-01-01T00:00:06.000+08:00|          104.0|
+|2020-01-01T00:00:08.000+08:00|          126.0|
+|2020-01-01T00:00:10.000+08:00|          108.0|
+|2020-01-01T00:00:14.000+08:00|          112.0|
+|2020-01-01T00:00:15.000+08:00|          113.0|
+|2020-01-01T00:00:16.000+08:00|          114.0|
+|2020-01-01T00:00:18.000+08:00|          116.0|
+|2020-01-01T00:00:20.000+08:00|          118.0|
+|2020-01-01T00:00:22.000+08:00|          120.0|
+|2020-01-01T00:00:26.000+08:00|          124.0|
+|2020-01-01T00:00:28.000+08:00|          126.0|
+|2020-01-01T00:00:30.000+08:00|            NaN|
++-----------------------------+---------------+
+```
+
+用于查询的SQL语句:
+
+```sql
+select timeliness(s1) from root.test.d1 where time <= 2020-01-01 00:00:30
+```
+
+输出序列:
+
+```
++-----------------------------+---------------------------+
+|                         Time|timeliness(root.test.d1.s1)|
++-----------------------------+---------------------------+
+|2020-01-01T00:00:02.000+08:00|         0.9333333333333333|
++-----------------------------+---------------------------+
+```
+
+### 指定窗口大小
+
+在指定窗口大小的情况下,本函数会把输入数据划分为若干个窗口计算时效性。
+
+输入序列:
+```
++-----------------------------+---------------+
+|                         Time|root.test.d1.s1|
++-----------------------------+---------------+
+|2020-01-01T00:00:02.000+08:00|          100.0|
+|2020-01-01T00:00:03.000+08:00|          101.0|
+|2020-01-01T00:00:04.000+08:00|          102.0|
+|2020-01-01T00:00:06.000+08:00|          104.0|
+|2020-01-01T00:00:08.000+08:00|          126.0|
+|2020-01-01T00:00:10.000+08:00|          108.0|
+|2020-01-01T00:00:14.000+08:00|          112.0|
+|2020-01-01T00:00:15.000+08:00|          113.0|
+|2020-01-01T00:00:16.000+08:00|          114.0|
+|2020-01-01T00:00:18.000+08:00|          116.0|
+|2020-01-01T00:00:20.000+08:00|          118.0|
+|2020-01-01T00:00:22.000+08:00|          120.0|
+|2020-01-01T00:00:26.000+08:00|          124.0|
+|2020-01-01T00:00:28.000+08:00|          126.0|
+|2020-01-01T00:00:30.000+08:00|            NaN|
+|2020-01-01T00:00:32.000+08:00|          130.0|
+|2020-01-01T00:00:34.000+08:00|          132.0|
+|2020-01-01T00:00:36.000+08:00|          134.0|
+|2020-01-01T00:00:38.000+08:00|          136.0|
+|2020-01-01T00:00:40.000+08:00|          138.0|
+|2020-01-01T00:00:42.000+08:00|          140.0|
+|2020-01-01T00:00:44.000+08:00|          142.0|
+|2020-01-01T00:00:46.000+08:00|          144.0|
+|2020-01-01T00:00:48.000+08:00|          146.0|
+|2020-01-01T00:00:50.000+08:00|          148.0|
+|2020-01-01T00:00:52.000+08:00|          150.0|
+|2020-01-01T00:00:54.000+08:00|          152.0|
+|2020-01-01T00:00:56.000+08:00|          154.0|
+|2020-01-01T00:00:58.000+08:00|          156.0|
+|2020-01-01T00:01:00.000+08:00|          158.0|
++-----------------------------+---------------+
+```
+
+用于查询的SQL语句:
+
+```sql
+select timeliness(s1,"window"="15") from root.test.d1 where time <= 2020-01-01 00:01:00
+```
+
+输出序列:
+
+```
++-----------------------------+------------------------------------------+
+|                         Time|timeliness(root.test.d1.s1, "window"="15")|
++-----------------------------+------------------------------------------+
+|2020-01-01T00:00:02.000+08:00|                        0.9333333333333333|
+|2020-01-01T00:00:32.000+08:00|                                       1.0|
++-----------------------------+------------------------------------------+
+```
+
+# Validity
+
+## 函数简介
+本函数用于计算时间序列的有效性。将输入序列划分为若干个连续且不重叠的窗口,分别计算每一个窗口的有效性,并输出窗口第一个数据点的时间戳和窗口的有效性。
+
+
+**函数名:** VALIDITY
+
+**输入序列:** 仅支持单个输入序列,类型为 INT32 / INT64 / FLOAT / DOUBLE
+
+**参数:**
+
++ `window`:窗口大小,它是一个大于0的整数或者一个有单位的正数。前者代表每一个窗口包含的数据点数目,最后一个窗口的数据点数目可能会不足;后者代表窗口的时间跨度,目前支持五种单位,分别是 'ms'(毫秒)、's'(秒)、'm'(分钟)、'h'(小时)和'd'(天)。缺省情况下,全部输入数据都属于同一个窗口。
+
+**输出序列:** 输出单个序列,类型为DOUBLE,其中每一个数据点的值的范围都是 [0,1].
+
+**提示:** 只有当窗口内的数据点数目超过10时,才会进行有效性计算。否则,该窗口将被忽略,不做任何输出。
+
+
+## 使用示例
+
+### 参数缺省
+
+在参数缺省的情况下,本函数将会把全部输入数据都作为同一个窗口计算有效性。
+
+输入序列:
+```
++-----------------------------+---------------+
+|                         Time|root.test.d1.s1|
++-----------------------------+---------------+
+|2020-01-01T00:00:02.000+08:00|          100.0|
+|2020-01-01T00:00:03.000+08:00|          101.0|
+|2020-01-01T00:00:04.000+08:00|          102.0|
+|2020-01-01T00:00:06.000+08:00|          104.0|
+|2020-01-01T00:00:08.000+08:00|          126.0|
+|2020-01-01T00:00:10.000+08:00|          108.0|
+|2020-01-01T00:00:14.000+08:00|          112.0|
+|2020-01-01T00:00:15.000+08:00|          113.0|
+|2020-01-01T00:00:16.000+08:00|          114.0|
+|2020-01-01T00:00:18.000+08:00|          116.0|
+|2020-01-01T00:00:20.000+08:00|          118.0|
+|2020-01-01T00:00:22.000+08:00|          120.0|
+|2020-01-01T00:00:26.000+08:00|          124.0|
+|2020-01-01T00:00:28.000+08:00|          126.0|
+|2020-01-01T00:00:30.000+08:00|            NaN|
++-----------------------------+---------------+
+```
+
+用于查询的SQL语句:
+
+```sql
+select validity(s1) from root.test.d1 where time <= 2020-01-01 00:00:30
+```
+
+输出序列:
+
+```
++-----------------------------+-------------------------+
+|                         Time|validity(root.test.d1.s1)|
++-----------------------------+-------------------------+
+|2020-01-01T00:00:02.000+08:00|       0.8833333333333333|
++-----------------------------+-------------------------+
+```
+
+### 指定窗口大小
+
+在指定窗口大小的情况下,本函数会把输入数据划分为若干个窗口计算有效性。
+
+输入序列:
+```
++-----------------------------+---------------+
+|                         Time|root.test.d1.s1|
++-----------------------------+---------------+
+|2020-01-01T00:00:02.000+08:00|          100.0|
+|2020-01-01T00:00:03.000+08:00|          101.0|
+|2020-01-01T00:00:04.000+08:00|          102.0|
+|2020-01-01T00:00:06.000+08:00|          104.0|
+|2020-01-01T00:00:08.000+08:00|          126.0|
+|2020-01-01T00:00:10.000+08:00|          108.0|
+|2020-01-01T00:00:14.000+08:00|          112.0|
+|2020-01-01T00:00:15.000+08:00|          113.0|
+|2020-01-01T00:00:16.000+08:00|          114.0|
+|2020-01-01T00:00:18.000+08:00|          116.0|
+|2020-01-01T00:00:20.000+08:00|          118.0|
+|2020-01-01T00:00:22.000+08:00|          120.0|
+|2020-01-01T00:00:26.000+08:00|          124.0|
+|2020-01-01T00:00:28.000+08:00|          126.0|
+|2020-01-01T00:00:30.000+08:00|            NaN|
+|2020-01-01T00:00:32.000+08:00|          130.0|
+|2020-01-01T00:00:34.000+08:00|          132.0|
+|2020-01-01T00:00:36.000+08:00|          134.0|
+|2020-01-01T00:00:38.000+08:00|          136.0|
+|2020-01-01T00:00:40.000+08:00|          138.0|
+|2020-01-01T00:00:42.000+08:00|          140.0|
+|2020-01-01T00:00:44.000+08:00|          142.0|
+|2020-01-01T00:00:46.000+08:00|          144.0|
+|2020-01-01T00:00:48.000+08:00|          146.0|
+|2020-01-01T00:00:50.000+08:00|          148.0|
+|2020-01-01T00:00:52.000+08:00|          150.0|
+|2020-01-01T00:00:54.000+08:00|          152.0|
+|2020-01-01T00:00:56.000+08:00|          154.0|
+|2020-01-01T00:00:58.000+08:00|          156.0|
+|2020-01-01T00:01:00.000+08:00|          158.0|
++-----------------------------+---------------+
+```
+
+用于查询的SQL语句:
+
+```sql
+select validity(s1,"window"="15") from root.test.d1 where time <= 2020-01-01 00:01:00
+```
+
+输出序列:
+
+```
++-----------------------------+----------------------------------------+
+|                         Time|validity(root.test.d1.s1, "window"="15")|
++-----------------------------+----------------------------------------+
+|2020-01-01T00:00:02.000+08:00|                      0.8833333333333333|
+|2020-01-01T00:00:32.000+08:00|                                     1.0|
++-----------------------------+----------------------------------------+
+```
\ No newline at end of file
diff --git a/site/src/main/.vuepress/config.js b/site/src/main/.vuepress/config.js
index 6776929..08f28af 100644
--- a/site/src/main/.vuepress/config.js
+++ b/site/src/main/.vuepress/config.js
@@ -723,7 +723,8 @@ var config = {
 					{
 					    title: 'UDF Library',
 					    children: [
-					        ['Library-UDF/Get-Started', 'Get Started']
+					        ['Library-UDF/Get-Started', 'Get Started'],
+					        ['Library-UDF/Data-Quality', 'Data Quality']
 					    ]
 					},
 					{
@@ -1529,7 +1530,8 @@ var config = {
 					{
           				title: 'UDF 函数库',
           				children: [
-          					['Library-UDF/Get-Started', '快速上手']
+          					['Library-UDF/Get-Started', '快速上手'],
+          					['Library-UDF/Data-Quality', '数据质量']
           				]
 					},
 					{