You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "Chesnay Schepler (JIRA)" <ji...@apache.org> on 2017/04/05 21:43:42 UTC
[jira] [Closed] (FLINK-6203) DataSet Transformations
[ https://issues.apache.org/jira/browse/FLINK-6203?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Chesnay Schepler closed FLINK-6203.
-----------------------------------
Resolution: Fixed
Fix Version/s: (was: 1.2.0)
1.2.1
1.3.0
1.2: f8255880c2bd9fb7e7dd0069319aeb283b523322
1.3: cf28a562159a7a73deb2c214c221bd935250387b
> DataSet Transformations
> -----------------------
>
> Key: FLINK-6203
> URL: https://issues.apache.org/jira/browse/FLINK-6203
> Project: Flink
> Issue Type: Bug
> Components: DataSet API, Documentation
> Affects Versions: 1.2.0, 1.3.0
> Reporter: 苏拓
> Assignee: Chesnay Schepler
> Priority: Minor
> Fix For: 1.3.0, 1.2.1
>
>
> 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 // this line is missing in the example
> }
> }
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)