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

DataSet Transformations

    XMLWordPrintableJSON

Details

    Description

      the example of GroupReduce on sorted groups can't remove duplicate Strings in a DataSet.
      need to add "prev=t"
      such as:

      val output = input.groupBy(0).sortGroup(1, Order.ASCENDING).reduceGroup {
            (in, out: Collector[(Int, String)]) =>
              var prev: (Int, String) = null
              for (t <- in) {
                if (prev == null || prev != t)
                  out.collect(t)
                  prev=t // this line is missing in the example
              }
          }
      

      Attachments

        Activity

          People

            chesnay Chesnay Schepler
            toby1992 苏拓
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: