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 0efae60379eece459a1c4268a9aa7a2d59604d0d Author: Steve Yurong Su <[email protected]> AuthorDate: Sun Sep 26 11:05:19 2021 +0800 en docs --- .../DML-Data-Manipulation-Language.md | 37 ++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/docs/UserGuide/IoTDB-SQL-Language/DML-Data-Manipulation-Language.md b/docs/UserGuide/IoTDB-SQL-Language/DML-Data-Manipulation-Language.md index 76e1bc9..236f4a2 100644 --- a/docs/UserGuide/IoTDB-SQL-Language/DML-Data-Manipulation-Language.md +++ b/docs/UserGuide/IoTDB-SQL-Language/DML-Data-Manipulation-Language.md @@ -423,6 +423,43 @@ Total line number = 5 It costs 0.014s ``` +#### Constant Timeseries Generation Functions + +The constant timeseries generating function is used to generate a timeseries in which the values of all data points are the same. + +The constant timeseries generation function accepts one or more timeseries inputs, and the timestamp set of the output data points is the union of the timestamp sets of the input timeseries. + +Currently, IoTDB supports the following constant timeseries generating functions: + +| Function Name | Allowed Input Series Data Types | Required Attributes | Output Series Data Type | Description | +| ------------- | ----------------------------------------------- | ------------------------------------------------------------ | -------------------------------------------- | ------------------------------------------------------------ | +| CONST | INT32 / INT64 / FLOAT / DOUBLE / BOOLEAN / TEXT | `value`: the value of the output data point <br />`type`: the type of the output data point, it can only be INT32 / INT64 / FLOAT / DOUBLE / BOOLEAN / TEXT | Determined by the required attribute `type` | Output the user-specified constant timeseries according to the attributes `value` and `type`. | +| PI | INT32 / INT64 / FLOAT / DOUBLE / BOOLEAN / TEXT | None | DOUBLE | Data point value: a double value that is closer than any other to `pi`, the ratio of the circumference of a circle to its diameter. | +| E | INT32 / INT64 / FLOAT / DOUBLE / BOOLEAN / TEXT | None | DOUBLE | Data point value: a double value that is closer than any other to `e`, the base of the natural logarithms. | + +Example: + +``` sql +select s1, s2, const(s1, 'value'='1024', 'type'='INT64'), pi(s2), e(s1, s2) from root.sg1.d1; +``` + +Result: + +``` +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 +``` + #### User Defined Timeseries Generating Functions Please refer to [UDF (User Defined Function)](../Advanced-Features/UDF-User-Defined-Function.md).
