|
@@ -232,18 +232,19 @@ select lag(Status) as Status, ts - lag(ts, 1, ts) OVER (WHEN had_changed(true, s
|
|
|
```
|
|
|
|
|
|
## Other Functions
|
|
|
-| Function | Example | Description |
|
|
|
-|--------------|--------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
|
|
-| isNull | isNull(col1) | Returns true if the argument is the Null value. |
|
|
|
-| coalesce | coalesce(expr1, expr2, ...) | Return the first non null value. If all expr are null,return nil. |
|
|
|
-| cardinality | cardinality(col1) | The number of members in the group. The null value is 0. |
|
|
|
-| newuuid | newuuid() | Returns a random 16-byte UUID. |
|
|
|
-| tstamp | tstamp() | Returns the current timestamp in milliseconds from 00:00:00 Coordinated Universal Time (UTC), Thursday, 1 January 1970 |
|
|
|
-| rule_id | rule_id() | Returns the ID of the currently matched rule |
|
|
|
-| mqtt | mqtt(topic) | Returns the MQTT meta-data of specified key. The current supported keys<br />- topic: return the topic of message. If there are multiple stream source, then specify the source name in parameter. Such as `mqtt(src1.topic)`<br />- messageid: return the message id of message. If there are multiple stream source, then specify the source name in parameter. Such as `mqtt(src2.messageid)` |
|
|
|
-| meta | meta(topic) | Returns the meta-data of specified key. The key could be:<br/> - a standalone key if there is only one source in the from clause, such as `meta(device)`<br />- A qualified key to specify the stream, such as `meta(src1.device)` <br />- A key with arrow for multi level meta data, such as `meta(src1.reading->device->name)` This assumes reading is a map structure meta data. |
|
|
|
-| window_start | window_start() | Return the window start timestamp in int64 format. If there is no time window, it returns 0. The window time is aligned with the timestamp notion of the rule. If the rule is using processing time, then the window start timestamp is the processing timestamp. If the rule is using event time, then the window start timestamp is the event timestamp. |
|
|
|
-| window_end | window_end() | Return the window end timestamp in int64 format. If there is no time window, it returns 0. The window time is aligned with the timestamp notion of the rule. If the rule is using processing time, then the window start timestamp is the processing timestamp. If the rule is using event time, then the window start timestamp is the event timestamp. |
|
|
|
+| Function | Example | Description |
|
|
|
+|--------------|-----------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
|
|
+| isNull | isNull(col1) | Returns true if the argument is the Null value. |
|
|
|
+| coalesce | coalesce(expr1, expr2, ...) | Return the first non null value. If all expr are null,return nil. |
|
|
|
+| cardinality | cardinality(col1) | The number of members in the group. The null value is 0. |
|
|
|
+| newuuid | newuuid() | Returns a random 16-byte UUID. |
|
|
|
+| tstamp | tstamp() | Returns the current timestamp in milliseconds from 00:00:00 Coordinated Universal Time (UTC), Thursday, 1 January 1970 |
|
|
|
+| rule_id | rule_id() | Returns the ID of the currently matched rule |
|
|
|
+| mqtt | mqtt(topic) | Returns the MQTT meta-data of specified key. The current supported keys<br />- topic: return the topic of message. If there are multiple stream source, then specify the source name in parameter. Such as `mqtt(src1.topic)`<br />- messageid: return the message id of message. If there are multiple stream source, then specify the source name in parameter. Such as `mqtt(src2.messageid)` |
|
|
|
+| meta | meta(topic) | Returns the meta-data of specified key. The key could be:<br/> - a standalone key if there is only one source in the from clause, such as `meta(device)`<br />- A qualified key to specify the stream, such as `meta(src1.device)` <br />- A key with arrow for multi level meta data, such as `meta(src1.reading->device->name)` This assumes reading is a map structure meta data. |
|
|
|
+| window_start | window_start() | Return the window start timestamp in int64 format. If there is no time window, it returns 0. The window time is aligned with the timestamp notion of the rule. If the rule is using processing time, then the window start timestamp is the processing timestamp. If the rule is using event time, then the window start timestamp is the event timestamp. |
|
|
|
+| window_end | window_end() | Return the window end timestamp in int64 format. If there is no time window, it returns 0. The window time is aligned with the timestamp notion of the rule. If the rule is using processing time, then the window start timestamp is the processing timestamp. If the rule is using event time, then the window start timestamp is the event timestamp. |
|
|
|
+| delay | delay(delayTime, returnVal) | Delay the execution of the rule for a specified time and then return the returnVal. |
|
|
|
|
|
|
## Multiple Column Functions
|
|
|
|