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

Nick Allen commented on METRON-626:
-----------------------------------

Either way.  We can close this one as a dup.

> 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)

Reply via email to