You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@kafka.apache.org by "Guozhang Wang (JIRA)" <ji...@apache.org> on 2016/04/05 01:47:25 UTC
[jira] [Updated] (KAFKA-3337) Extract selector as a separate
groupBy operator for KTable aggregations
[ https://issues.apache.org/jira/browse/KAFKA-3337?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Guozhang Wang updated KAFKA-3337:
---------------------------------
Component/s: kafka streams
> Extract selector as a separate groupBy operator for KTable aggregations
> -----------------------------------------------------------------------
>
> Key: KAFKA-3337
> URL: https://issues.apache.org/jira/browse/KAFKA-3337
> Project: Kafka
> Issue Type: Sub-task
> Components: kafka streams
> Reporter: Guozhang Wang
> Labels: newbie++
> Fix For: 0.10.1.0
>
>
> Currently KTable aggregation takes a selector used for selecting the aggregate key.and an aggregator for aggregating the values with the same selected key, which makes the function a little bit "heavy":
> {code}
> table.groupBy(initializer, adder, substractor, selector, /* optional serde*/);
> {code}
> It is better to extract the selector in a separate groupBy function such that
> {code}
> KTableGrouped KTable#groupBy(selector);
> KTable KTableGrouped#aggregate(initializer, adder, substractor, /* optional serde*/);
> {code}
> Note that "KTableGrouped" only have APIs for aggregate and reduce, and none else. So users have to follow the pattern below:
> {code}
> table.groupBy(...).aggregate(...);
> {code}
> This pattern is more natural for users who are familiar with SQL / Pig or Spark DSL, etc.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)