Uploaded image for project: 'Flink'
  1. Flink
  2. FLINK-3630

Little mistake in documentation

    XMLWordPrintableJSON

Details

    Description

      in section "GroupCombine on a Grouped DataSet" of the following link: https://ci.apache.org/projects/flink/flink-docs-release-1.0/apis/batch/dataset_transformations.html#groupreduce-on-grouped-dataset
      there is a little mistake in java code in both combine and reduce method(it's the same mistake). The variable "word" is defined in the scope of the for loop so it cannot be used in collect method.
      Possible solution could be to initialise the variable before the for and assign a value inside the for.
      Something like:

      int count = 0;
      String word;
      for (String record : words) {
      word = record;
      count++;
      }
      out.collect(new Tuple2(word, count));

      Attachments

        Issue Links

          Activity

            People

              greghogan Greg Hogan
              riccardo_91 Riccardo Diomedi
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: