You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@metron.apache.org by "Otto Fowler (JIRA)" <ji...@apache.org> on 2017/02/11 03:19:41 UTC

[jira] [Commented] (METRON-626) Add Higher-Order Map Function to Stellar

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

Otto Fowler commented on METRON-626:
------------------------------------

I wonder if we can find a way to use java streams for this?

> Add Higher-Order Map Function to Stellar
> ----------------------------------------
>
>                 Key: METRON-626
>                 URL: https://issues.apache.org/jira/browse/METRON-626
>             Project: Metron
>          Issue Type: Improvement
>            Reporter: Nick Allen
>
> It would be extremely useful to have a 'map' higher-order function in Stellar. A 'flat map' might also be needed.
> [https://en.wikipedia.org/wiki/Map_(higher-order_function)]
> A few examples that I am thinking of.  Ignore my choice of syntax.  I am just trying to express the use cases here.
> Fetch all of the profile measurements over the past 2 hours.  There may be many.  What is the mean of each of those measurements?  
> {code}
> stats := PROFILE_GET('p1', 'e1', 2, "HOURS")
> stats.MAP( s -> STATS_MEAN(s))
> {code}
> Get profile measurements taken 1 week ago, 2 weeks ago, and 3 weeks ago, so that I can then compare them.
> {code}
> { "1 week", "2 weeks", "3 weeks" }.MAP( lookback -> PROFILE_GET('p1','e1', lookback)
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)