Uploaded image for project: 'Beam'
  1. Beam
  2. BEAM-7682

Combine.GroupedValues javadoc code snippet does not work

    XMLWordPrintableJSON

    Details

      Description

      The snippet in the javadoc of GroupedValues says:

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

      but should be:

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

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                iemejia Ismaël Mejía
                Reporter:
                iemejia Ismaël Mejía
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 40m
                  40m