GitHub user aalexandrov opened a pull request:

    https://github.com/apache/flink/pull/559

    Fixup ReusingKeyGroupedIterator value iterators in 
NonReusingSortMergeCoGroupIterator.

    Correct me if I'm wrong, but I think that the 
NonReusingSortMergeCoGroupIterator should construct value iterators which are 
non-reusing as well, otherwise you have unexpected behavior like this:
    
    ```java
    
    public static void main(String[] args) throws Exception{
        ExecutionEnvironment env = 
ExecutionEnvironment.getExecutionEnvironment();
        env.getConfig().disableObjectReuse();
    
        in1.coGroup(in2).where("name").equalTo("name").with(new 
SampleCoGroup());
    
        env.execute()
    }
    
    public static class SampleCoGroup implements 
CoGroupFunction<Person,StudentInfo,Tuple3<String,String,String>>{
        @Override
        public void coGroup(Iterable<Person> iterable, Iterable<StudentInfo> 
iterable1, Collector<Tuple3<String, String, String>> collector) throws 
Exception {
            for(StudentInfo info : iterable1) {
                infos.add(info); // faulty behavior
            }
            // ...
        }
    }
    
    ```

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/aalexandrov/flink fix_reusing_iterator

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/flink/pull/559.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #559
    
----
commit c90d15cbedb1e5b587ac527e65659a9b85710d9f
Author: Alexander Alexandrov <[email protected]>
Date:   2015-04-01T16:08:26Z

    Fixup ReusingKeyGroupedIterator value iterators in 
NonReusingSortMergeCoGroupIterator.

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to