[
https://issues.apache.org/jira/browse/KAFKA-3511?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15235723#comment-15235723
]
Guozhang Wang commented on KAFKA-3511:
--------------------------------------
One thing about providing built-in operators, like Michael has pointed out, is
that because of Java type erasure, we would likely to provide one function for
each data type. For example:
{code}
sumInt(..) /* assume value type is Integer */
sumLong(..) /* check value type is Long */
sumDouble(..) /* check value type is Double */
sumFloat(..) /* check value type is Float */
...
{code}
whereas for built-in aggregator functions we need to do
{code}
stream.aggregate(new MaxInt());
stream.aggregate(new MaxLong());
stream.aggregate(new MaxDouble());
stream.aggregate(new MaxFloat());
{code}
> Provide built-in aggregators sum() and avg() in Kafka Streams DSL
> -----------------------------------------------------------------
>
> Key: KAFKA-3511
> URL: https://issues.apache.org/jira/browse/KAFKA-3511
> Project: Kafka
> Issue Type: Bug
> Components: streams
> Reporter: Guozhang Wang
> Labels: api, newbie
> Fix For: 0.10.0.0
>
>
> Currently we only have one built-in aggregate function count() in the Kafka
> Streams DSL, but we want to add more aggregation functions like sum() and
> avg().
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)