Ismaël Mejía created BEAM-7682:
----------------------------------

             Summary: 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


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)

Reply via email to