Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/UserGuide/Master/Reference/Function-and-Expression.md
Original file line number Diff line number Diff line change
Expand Up @@ -549,6 +549,7 @@ The aggregate functions supported by IoTDB are as follows:
| COUNT_IF | Find the number of data points that continuously meet a given condition and the number of data points that meet the condition (represented by keep) meet the specified threshold. | BOOLEAN | `[keep >=/>/=/!=/</<=]threshold`:The specified threshold or threshold condition, it is equivalent to `keep >= threshold` if `threshold` is used alone, type of `threshold` is `INT64` `ignoreNull`:Optional, default value is `true`;If the value is `true`, null values are ignored, it means that if there is a null value in the middle, the value is ignored without interrupting the continuity. If the value is `true`, null values are not ignored, it means that if there are null values in the middle, continuity will be broken | INT64 |
| TIME_DURATION | Find the difference between the timestamp of the largest non-null value and the timestamp of the smallest non-null value in a column | All data Types | / | INT64 |
| MODE | Find the mode. Note: 1.Having too many different values in the input series risks a memory exception; 2.If all the elements have the same number of occurrences, that is no Mode, return the value with earliest time; 3.If there are many Modes, return the Mode with earliest time. | All data Types | / | Consistent with the input data type |
| STDDEV | Calculate the overall standard deviation of the data. Note:<br> Missing points, null points and `NaN` in the input series will be ignored.| INT32 INT64 FLOAT DOUBLE | / | DOUBLE |
| COUNT_TIME | The number of timestamps in the query data set. When used with `align by device`, the result is the number of timestamps in the data set per device. | All data Types, the input parameter can only be `*` | / | INT64 |


Expand Down
113 changes: 0 additions & 113 deletions src/UserGuide/Master/Reference/UDF-Libraries.md
Original file line number Diff line number Diff line change
Expand Up @@ -1140,60 +1140,6 @@ Output series:
+-----------------------------+--------------------+
```

### Mode

#### Usage

This function is used to calculate the mode of time series, that is, the value that occurs most frequently.

**Name:** MODE

**Input Series:** Only support a single input series. The type is arbitrary.

**Output Series:** Output a single series. The type is the same as the input. There is only one data point in the series, whose timestamp is the same as which the first mode value has and value is the mode.

**Note:**

+ If there are multiple values with the most occurrences, the arbitrary one will be output.
+ Missing points and null points in the input series will be ignored, but `NaN` will not.

#### Examples

Input series:

```
+-----------------------------+---------------+
| Time|root.test.d2.s2|
+-----------------------------+---------------+
|1970-01-01T08:00:00.001+08:00| Hello|
|1970-01-01T08:00:00.002+08:00| hello|
|1970-01-01T08:00:00.003+08:00| Hello|
|1970-01-01T08:00:00.004+08:00| World|
|1970-01-01T08:00:00.005+08:00| World|
|1970-01-01T08:00:01.600+08:00| World|
|1970-01-15T09:37:34.451+08:00| Hello|
|1970-01-15T09:37:34.452+08:00| hello|
|1970-01-15T09:37:34.453+08:00| Hello|
|1970-01-15T09:37:34.454+08:00| World|
|1970-01-15T09:37:34.455+08:00| World|
+-----------------------------+---------------+
```

SQL for query:

```sql
select mode(s2) from root.test.d2
```

Output series:

```
+-----------------------------+---------------------+
| Time|mode(root.test.d2.s2)|
+-----------------------------+---------------------+
|1970-01-01T08:00:00.004+08:00| World|
+-----------------------------+---------------------+
```

### MvAvg

Expand Down Expand Up @@ -2264,66 +2210,7 @@ Output series:
+-----------------------------+-----------------------+
```

### Stddev

#### Usage

This function is used to calculate the population standard deviation.

**Name:** STDDEV

**Input Series:** Only support a single input series. The type is INT32 / INT64 / FLOAT / DOUBLE.

**Output Series:** Output a single series. The type is DOUBLE. There is only one data point in the series, whose timestamp is 0 and value is the population standard deviation.

**Note:** Missing points, null points and `NaN` in the input series will be ignored.

#### Examples

Input series:

```
+-----------------------------+---------------+
| Time|root.test.d1.s1|
+-----------------------------+---------------+
|2020-01-01T00:00:00.000+08:00| 1.0|
|2020-01-01T00:00:01.000+08:00| 2.0|
|2020-01-01T00:00:02.000+08:00| 3.0|
|2020-01-01T00:00:03.000+08:00| 4.0|
|2020-01-01T00:00:04.000+08:00| 5.0|
|2020-01-01T00:00:05.000+08:00| 6.0|
|2020-01-01T00:00:06.000+08:00| 7.0|
|2020-01-01T00:00:07.000+08:00| 8.0|
|2020-01-01T00:00:08.000+08:00| 9.0|
|2020-01-01T00:00:09.000+08:00| 10.0|
|2020-01-01T00:00:10.000+08:00| 11.0|
|2020-01-01T00:00:11.000+08:00| 12.0|
|2020-01-01T00:00:12.000+08:00| 13.0|
|2020-01-01T00:00:13.000+08:00| 14.0|
|2020-01-01T00:00:14.000+08:00| 15.0|
|2020-01-01T00:00:15.000+08:00| 16.0|
|2020-01-01T00:00:16.000+08:00| 17.0|
|2020-01-01T00:00:17.000+08:00| 18.0|
|2020-01-01T00:00:18.000+08:00| 19.0|
|2020-01-01T00:00:19.000+08:00| 20.0|
+-----------------------------+---------------+
```

SQL for query:

```sql
select stddev(s1) from root.test.d1
```

Output series:

```
+-----------------------------+-----------------------+
| Time|stddev(root.test.d1.s1)|
+-----------------------------+-----------------------+
|1970-01-01T08:00:00.000+08:00| 5.7662812973353965|
+-----------------------------+-----------------------+
```

### ZScore

Expand Down
1 change: 1 addition & 0 deletions src/UserGuide/latest/Reference/Function-and-Expression.md
Original file line number Diff line number Diff line change
Expand Up @@ -549,6 +549,7 @@ The aggregate functions supported by IoTDB are as follows:
| COUNT_IF | Find the number of data points that continuously meet a given condition and the number of data points that meet the condition (represented by keep) meet the specified threshold. | BOOLEAN | `[keep >=/>/=/!=/</<=]threshold`:The specified threshold or threshold condition, it is equivalent to `keep >= threshold` if `threshold` is used alone, type of `threshold` is `INT64` `ignoreNull`:Optional, default value is `true`;If the value is `true`, null values are ignored, it means that if there is a null value in the middle, the value is ignored without interrupting the continuity. If the value is `true`, null values are not ignored, it means that if there are null values in the middle, continuity will be broken | INT64 |
| TIME_DURATION | Find the difference between the timestamp of the largest non-null value and the timestamp of the smallest non-null value in a column | All data Types | / | INT64 |
| MODE | Find the mode. Note: 1.Having too many different values in the input series risks a memory exception; 2.If all the elements have the same number of occurrences, that is no Mode, return the value with earliest time; 3.If there are many Modes, return the Mode with earliest time. | All data Types | / | Consistent with the input data type |
| STDDEV | Calculate the overall standard deviation of the data. Note:<br> Missing points, null points and `NaN` in the input series will be ignored.| INT32 INT64 FLOAT DOUBLE | / | DOUBLE |
| COUNT_TIME | The number of timestamps in the query data set. When used with `align by device`, the result is the number of timestamps in the data set per device. | All data Types, the input parameter can only be `*` | / | INT64 |


Expand Down
113 changes: 0 additions & 113 deletions src/UserGuide/latest/Reference/UDF-Libraries.md
Original file line number Diff line number Diff line change
Expand Up @@ -1140,60 +1140,7 @@ Output series:
+-----------------------------+--------------------+
```

### Mode

#### Usage

This function is used to calculate the mode of time series, that is, the value that occurs most frequently.

**Name:** MODE

**Input Series:** Only support a single input series. The type is arbitrary.

**Output Series:** Output a single series. The type is the same as the input. There is only one data point in the series, whose timestamp is the same as which the first mode value has and value is the mode.

**Note:**

+ If there are multiple values with the most occurrences, the arbitrary one will be output.
+ Missing points and null points in the input series will be ignored, but `NaN` will not.

#### Examples

Input series:

```
+-----------------------------+---------------+
| Time|root.test.d2.s2|
+-----------------------------+---------------+
|1970-01-01T08:00:00.001+08:00| Hello|
|1970-01-01T08:00:00.002+08:00| hello|
|1970-01-01T08:00:00.003+08:00| Hello|
|1970-01-01T08:00:00.004+08:00| World|
|1970-01-01T08:00:00.005+08:00| World|
|1970-01-01T08:00:01.600+08:00| World|
|1970-01-15T09:37:34.451+08:00| Hello|
|1970-01-15T09:37:34.452+08:00| hello|
|1970-01-15T09:37:34.453+08:00| Hello|
|1970-01-15T09:37:34.454+08:00| World|
|1970-01-15T09:37:34.455+08:00| World|
+-----------------------------+---------------+
```

SQL for query:

```sql
select mode(s2) from root.test.d2
```

Output series:

```
+-----------------------------+---------------------+
| Time|mode(root.test.d2.s2)|
+-----------------------------+---------------------+
|1970-01-01T08:00:00.004+08:00| World|
+-----------------------------+---------------------+
```

### MvAvg

Expand Down Expand Up @@ -2264,66 +2211,6 @@ Output series:
+-----------------------------+-----------------------+
```

### Stddev

#### Usage

This function is used to calculate the population standard deviation.

**Name:** STDDEV

**Input Series:** Only support a single input series. The type is INT32 / INT64 / FLOAT / DOUBLE.

**Output Series:** Output a single series. The type is DOUBLE. There is only one data point in the series, whose timestamp is 0 and value is the population standard deviation.

**Note:** Missing points, null points and `NaN` in the input series will be ignored.

#### Examples

Input series:

```
+-----------------------------+---------------+
| Time|root.test.d1.s1|
+-----------------------------+---------------+
|2020-01-01T00:00:00.000+08:00| 1.0|
|2020-01-01T00:00:01.000+08:00| 2.0|
|2020-01-01T00:00:02.000+08:00| 3.0|
|2020-01-01T00:00:03.000+08:00| 4.0|
|2020-01-01T00:00:04.000+08:00| 5.0|
|2020-01-01T00:00:05.000+08:00| 6.0|
|2020-01-01T00:00:06.000+08:00| 7.0|
|2020-01-01T00:00:07.000+08:00| 8.0|
|2020-01-01T00:00:08.000+08:00| 9.0|
|2020-01-01T00:00:09.000+08:00| 10.0|
|2020-01-01T00:00:10.000+08:00| 11.0|
|2020-01-01T00:00:11.000+08:00| 12.0|
|2020-01-01T00:00:12.000+08:00| 13.0|
|2020-01-01T00:00:13.000+08:00| 14.0|
|2020-01-01T00:00:14.000+08:00| 15.0|
|2020-01-01T00:00:15.000+08:00| 16.0|
|2020-01-01T00:00:16.000+08:00| 17.0|
|2020-01-01T00:00:17.000+08:00| 18.0|
|2020-01-01T00:00:18.000+08:00| 19.0|
|2020-01-01T00:00:19.000+08:00| 20.0|
+-----------------------------+---------------+
```

SQL for query:

```sql
select stddev(s1) from root.test.d1
```

Output series:

```
+-----------------------------+-----------------------+
| Time|stddev(root.test.d1.s1)|
+-----------------------------+-----------------------+
|1970-01-01T08:00:00.000+08:00| 5.7662812973353965|
+-----------------------------+-----------------------+
```

### ZScore

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ IoTDB 支持的聚合函数如下:
| COUNT_IF | 求数据点连续满足某一给定条件,且满足条件的数据点个数(用keep表示)满足指定阈值的次数。 | BOOLEAN | `[keep >=/>/=/!=/</<=]threshold`:被指定的阈值或阈值条件,若只使用`threshold`则等价于`keep >= threshold`,`threshold`类型为`INT64` <br> `ignoreNull`:可选,默认为`true`;为`true`表示忽略null值,即如果中间出现null值,直接忽略,不会打断连续性;为`false`表示不忽略null值,即如果中间出现null值,会打断连续性 | INT64 |
| TIME_DURATION | 求某一列最大一个不为NULL的值所在时间戳与最小一个不为NULL的值所在时间戳的时间戳差 | 所有类型 | 无 | INT64 |
| MODE | 求众数。注意:<br>1.输入序列的不同值个数过多时会有内存异常风险; <br>2.如果所有元素出现的频次相同,即没有众数,则返回对应时间戳最小的值; <br>3.如果有多个众数,则返回对应时间戳最小的众数。 | 所有类型 | 无 | 与输入类型一致 |
| STDDEV | 求数据的总体标准差。注意:<br> 数据中的空值、缺失值和`NaN`将会被忽略。 | INT32 INT64 FLOAT DOUBLE | 无 | DOUBLE |
| COUNT_TIME | 查询结果集的时间戳的数量。与 align by device 搭配使用时,得到的结果是每个设备的结果集的时间戳的数量。 | 所有类型,输入参数只能为* | 无 | INT64 |
| MAX_BY | MAX_BY(x, y) 求二元输入 x 和 y 在 y 最大时对应的 x 的值。MAX_BY(time, x) 返回 x 取最大值时对应的时间戳。 | 第一个输入 x 可以是任意类型,第二个输入 y 只能是 INT32 INT64 FLOAT DOUBLE | 无 | 与第一个输入 x 的数据类型一致 |
| MIN_BY | MIN_BY(x, y) 求二元输入 x 和 y 在 y 最小时对应的 x 的值。MIN_BY(time, x) 返回 x 取最小值时对应的时间戳。 | 第一个输入 x 可以是任意类型,第二个输入 y 只能是 INT32 INT64 FLOAT DOUBLE | 无 | 与第一个输入 x 的数据类型一致 |
Expand Down
Loading