You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by ro...@apache.org on 2021/09/26 03:30:52 UTC

[iotdb] 02/05: zh docs

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

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

commit d46ca7bbf518c41cd2265601b9998cc267a4c6fc
Author: Steve Yurong Su <ro...@apache.org>
AuthorDate: Sun Sep 26 10:47:57 2021 +0800

    zh docs
---
 .../DML-Data-Manipulation-Language.md              | 39 +++++++++++++++++++++-
 1 file changed, 38 insertions(+), 1 deletion(-)

diff --git a/docs/zh/UserGuide/IoTDB-SQL-Language/DML-Data-Manipulation-Language.md b/docs/zh/UserGuide/IoTDB-SQL-Language/DML-Data-Manipulation-Language.md
index 4795de2..e77fd83 100644
--- a/docs/zh/UserGuide/IoTDB-SQL-Language/DML-Data-Manipulation-Language.md
+++ b/docs/zh/UserGuide/IoTDB-SQL-Language/DML-Data-Manipulation-Language.md
@@ -432,6 +432,43 @@ Total line number = 5
 It costs 0.014s
 ```
 
+#### 常序列生成函数
+
+常序列生成函数用于生成所有数据点的值都相同的时间序列。
+
+常序列生成函数接受一个或者多个时间序列输入,其输出的数据点的时间戳集合是这些输入序列时间戳集合的并集。
+
+目前 IoTDB 支持如下常序列生成函数:
+
+| 函数名 | 输入序列类型                                    | 必要的属性参数                                               | 输出序列类型               | 功能描述                                                     |
+| ------ | ----------------------------------------------- | ------------------------------------------------------------ | -------------------------- | ------------------------------------------------------------ |
+| CONST  | INT32 / INT64 / FLOAT / DOUBLE / BOOLEAN / TEXT | `value`: 输出的数据点的值 <br />`type`: 输出的数据点的类型,只能是 INT32 / INT64 / FLOAT / DOUBLE / BOOLEAN / TEXT | 由输入属性参数 `type` 决定 | 根据输入属性 `value` 和 `type` 输出用户指定的常序列          |
+| PI     | INT32 / INT64 / FLOAT / DOUBLE / BOOLEAN / TEXT | 无                                                           | DOUBLE                     | 常序列的值是比任何其他值都更接近圆周率的双精度值,圆周长与其直径的比率。 |
+| E      | INT32 / INT64 / FLOAT / DOUBLE / BOOLEAN / TEXT | 无                                                           | DOUBLE                     | 常序列的值是比任何其他值都更接近 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
+```
+
 #### 自定义时间序列生成函数
 
 请参考 [UDF (用户定义函数)](../Advanced-Features/UDF-User-Defined-Function.md)。
@@ -442,7 +479,7 @@ It costs 0.014s
 
 ### 嵌套查询(子查询)
 
-“嵌套查询”又称为“子查询,即在一条 SQL 语句中,“内层查询”的计算结果可以作为“外层查询”的计算对象来使用。
+“嵌套查询”又称为“子查询”,即在一条 SQL 语句中,“内层查询”的计算结果可以作为“外层查询”的计算对象来使用。
 
 IoTDB 支持在 `select` 字句中执行由**时间序列、算数运算表达式和时间序列生成函数(包括用户自定义函数)**组成的任意嵌套表达式。