You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@iotdb.apache.org by "Eric Pai (Jira)" <ji...@apache.org> on 2022/02/24 03:13:00 UTC

[jira] [Commented] (IOTDB-2597) UDF: ZERO_DURATION / NON_ZERO_DURATION

    [ https://issues.apache.org/jira/browse/IOTDB-2597?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17497141#comment-17497141 ] 

Eric Pai commented on IOTDB-2597:
---------------------------------

Maybe ZERO_INTERVAL or NON_ZERO_INTERVAL are more suitable than 'DURATION', as it outputs intervals.

> UDF: ZERO_DURATION / NON_ZERO_DURATION
> --------------------------------------
>
>                 Key: IOTDB-2597
>                 URL: https://issues.apache.org/jira/browse/IOTDB-2597
>             Project: Apache IoTDB
>          Issue Type: Wish
>            Reporter: Steve Yurong Su
>            Assignee: Xi Zhang
>            Priority: Major
>
> input: a time series (type: INT32, INT64, FLOAT or DOUBLE, BOOLEAN)
> output: a time series (type: INT64)
> parameter:
>   min_duration: INT64
>   max_duration: INT64
>   min_duration <= max_duration
>  
> description:
> Find all time intervals whose values are always 0 (false), output the start time and the length of each interval.
> Discard the interval if its length > max_duration or < min_duration. 
> min_duration and max_duration are optional.
>  
> usage:
> select s1, f(s1, 'min_duration'='3') from root.sg.d
> ||Time||root.sg.d.s1||f(root.sg.d.s1)||
> |1|0.2|null|
> |2|0.0|null|
> |3|0.0|null|
> |4|0.3|3|
> |5|0.0|null|
> |6|0.0|null|
> |7|0.0|null|
> |8|3.33|null|
>  



--
This message was sent by Atlassian Jira
(v8.20.1#820001)