[
https://issues.apache.org/jira/browse/BEAM-7682?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Alexey Romanenko resolved BEAM-7682.
------------------------------------
Resolution: Fixed
Fix Version/s: 2.15.0
> Combine.GroupedValues javadoc code snippet does not work
> --------------------------------------------------------
>
> Key: BEAM-7682
> URL: https://issues.apache.org/jira/browse/BEAM-7682
> Project: Beam
> Issue Type: Bug
> Components: sdk-java-core
> Reporter: Ismaël Mejía
> Assignee: Ismaël Mejía
> Priority: Minor
> Labels: documentation, javadoc
> Fix For: 2.15.0
>
> Time Spent: 40m
> Remaining Estimate: 0h
>
> The snippet in the javadoc of GroupedValues says:
> {code:java}
> PCollection<KV<String, Integer>> pc = ...;
> PCollection<KV<String, Iterable<Integer>>> groupedByKey = pc.apply( new
> GroupByKey<String, Integer>());
> PCollection<KV<String, Integer>> sumByKey = groupedByKey.apply(
> Combine.<String, Integer>groupedValues( new Sum.SumIntegerFn()));
> {code}
> but should be:
> {code:java}
> PCollection<KV<String, Integer>> pc = ...;
> PCollection<KV<String, Iterable<Integer>>> groupedByKey =
> pc.apply(GroupByKey.create());
> PCollection<KV<String, Integer>> sumByKey =
> groupedByKey.apply(Combine.groupedValues(Sum.ofIntegers()));
> {code}
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)