You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@iotdb.apache.org by "Yuan Tian (Jira)" <ji...@apache.org> on 2023/01/12 01:31:00 UTC

[jira] [Commented] (IOTDB-4746) Supports function operations on non-fixed child nodes(*)

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

Yuan Tian commented on IOTDB-4746:
----------------------------------

Can you give us a real user case. In which case, you want to use this functionality. I can only think of one case that we want calculate total number of points which we will use another special syntax to achieve that.

If you meet that real user case in Prometheus, you can alse give us the  PromQL you use.

> Supports function operations on non-fixed child nodes(*)
> --------------------------------------------------------
>
>                 Key: IOTDB-4746
>                 URL: https://issues.apache.org/jira/browse/IOTDB-4746
>             Project: Apache IoTDB
>          Issue Type: Improvement
>          Components: Core/Query
>            Reporter: xuan.wang
>            Priority: Major
>
> *Is your feature request related to a problem? Please describe.*
> When I query some of the latest data, such as the latest 10 entries, I can use the:
> 当我要查询一些最新的数据,比如最新的10条,我可以加以下语句:
> {color:#ff0000}order by time desc limit 10{color}
> But sometimes it is necessary to perform operations on the data of each row returned from the query, such as summing, averaging, and so on.
> When the child node is explicit, i can use the
> 但有些时候需要对数据进行计算,比如求和。当子节点是确定的时候我可以使用以下语句:
> {color:#ff0000}select s1+s2+s3 from root.data.g_0.d_0 order by time desc limit 10;{color}
>  
> sometimes, child node not fixed and names are unknown.
> *Describe the solution you'd like*
> Whether some functions can be added to calculate the value of child nodes.
> 有些时候,子节点不是固定的,并且可能是未知的。
> 是否可以添加一些函数来对子节点进行运算?
> For example: add node_sum function
> 比如:添加一个 node_sum 的函数
> {color:#ff0000} {{select node_sum( * ) from root.data.g_0.d_0.* order by time desc limit 10;}}{color}
> ||Time||node_sum(root.data.g_0.d_0.*)||
> |_2022-10-18T16:41:24.195+08:00_|_0.0_|
> |_2022-10-18T16:41:09.195+08:00_|0.0|
> |_2022-10-18T16:40:54.195+08:00_|0.0|
> |_2022-10-18T16:40:39.195+08:00_|0.0|
> |_2022-10-18T16:40:24.195+08:00_|0.0|
> |_2022-10-18T16:40:09.195+08:00_|0.0|
> |_2022-10-18T16:39:54.195+08:00_|_5.36E8_|
> |_2022-10-18T16:39:39.822+08:00_|_5.82E8_|
> |_2022-10-18T16:39:24.195+08:00_|0.0|
> |_2022-10-18T16:39:09.195+08:00_|0.0|
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)