[ https://issues.apache.org/jira/browse/FLINK-6203?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Chesnay Schepler updated FLINK-6203: ------------------------------------ Description: the example of GroupReduce on sorted groups can't remove duplicate Strings in a DataSet. need to add "prev=t" such as: {code} 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 } } {code} was: 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 } } > DataSet Transformations > ----------------------- > > Key: FLINK-6203 > URL: https://issues.apache.org/jira/browse/FLINK-6203 > Project: Flink > Issue Type: Bug > Components: DataSet API > Affects Versions: 1.2.0 > Reporter: 苏拓 > Priority: Minor > Fix For: 1.2.0 > > > the example of GroupReduce on sorted groups can't remove duplicate Strings in > a DataSet. > need to add "prev=t" > such as: > {code} > 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 > } > } > {code} -- This message was sent by Atlassian JIRA (v6.3.15#6346)