You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by StefanRRichter <gi...@git.apache.org> on 2016/06/16 13:38:30 UTC

[GitHub] flink pull request #2116: [FLINK-4078] [java, DataSet] Introduce missing cal...

GitHub user StefanRRichter opened a pull request:

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

    [FLINK-4078] [java, DataSet] Introduce missing calls to closure cleaner

    Thanks for contributing to Apache Flink. Before you open your pull request, please take the following check list into consideration.
    If your changes take all of the items into account, feel free to open your pull request. For more information and/or questions please refer to the [How To Contribute guide](http://flink.apache.org/how-to-contribute.html).
    In addition to going through the list, please provide a meaningful description of your changes.
    
    - [ x] General
      - The pull request references the related JIRA issue ("[FLINK-XXX] Jira title text")
      - The pull request addresses only one issue
      - Each commit in the PR has a meaningful commit message (including the JIRA id)
    
    - [ x] Documentation
      - Documentation has been added for new functionality
      - Old documentation affected by the pull request has been updated
      - JavaDoc for public methods has been added
    
    - [ x] Tests & Build
      - Functionality added by the pull request is covered by tests
      - `mvn clean verify` has been executed successfully locally or a Travis build has passed
    


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

    $ git pull https://github.com/StefanRRichter/flink 4024-closure_cleaner

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

    https://github.com/apache/flink/pull/2116.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 #2116
    
----
commit 90ccdccfaab8b3261716e2f0cbf8deb846f86f08
Author: Stefan Richter <st...@gmail.com>
Date:   2016-06-16T10:11:32Z

    [FLINK-4078] [java, DataSet] Introduce missing calls to closure cleaner

----


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] flink issue #2116: [FLINK-4078] [java, DataSet] Introduce missing calls to c...

Posted by uce <gi...@git.apache.org>.
Github user uce commented on the issue:

    https://github.com/apache/flink/pull/2116
  
    Looks very good! Thanks. The build failure is unrelated. I'll merge this after you address the inline comments.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] flink issue #2116: [FLINK-4078] [java, DataSet] Introduce missing calls to c...

Posted by zentol <gi...@git.apache.org>.
Github user zentol commented on the issue:

    https://github.com/apache/flink/pull/2116
  
    note that the commit author is not properly set and will thus not be attributed to your github account.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] flink pull request #2116: [FLINK-4078] [java, DataSet] Introduce missing cal...

Posted by uce <gi...@git.apache.org>.
Github user uce commented on a diff in the pull request:

    https://github.com/apache/flink/pull/2116#discussion_r67514396
  
    --- Diff: flink-tests/src/test/java/org/apache/flink/test/javaApiOperators/CoGroupITCase.java ---
    @@ -334,6 +335,124 @@ public void testCoGroupWithMultipleKeyFieldsWithKeyExtractor() throws Exception
     		compareResultAsTuples(result, expected);
     	}
     
    +	@Test
    +	public void testCoGroupWithMultipleKeyFieldsWithInnerClassKeyExtractorWithClosureCleaner() throws Exception {
    +		/*
    --- End diff --
    
    We usually do inline multi line comments via `// ...`.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] flink pull request #2116: [FLINK-4078] [java, DataSet] Introduce missing cal...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

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


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] flink pull request #2116: [FLINK-4078] [java, DataSet] Introduce missing cal...

Posted by uce <gi...@git.apache.org>.
Github user uce commented on a diff in the pull request:

    https://github.com/apache/flink/pull/2116#discussion_r67514718
  
    --- Diff: flink-tests/src/test/java/org/apache/flink/test/javaApiOperators/CoGroupITCase.java ---
    @@ -334,6 +335,124 @@ public void testCoGroupWithMultipleKeyFieldsWithKeyExtractor() throws Exception
     		compareResultAsTuples(result, expected);
     	}
     
    +	@Test
    +	public void testCoGroupWithMultipleKeyFieldsWithInnerClassKeyExtractorWithClosureCleaner() throws Exception {
    +		/*
    +		 * CoGroup with multiple key fields, test working closure cleaner for inner classes
    +		 */
    +
    +		final ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();
    +
    +		DataSet<Tuple5<Integer, Long, Integer, String, Long>> ds1 = CollectionDataSets.get5TupleDataSet(env);
    +		DataSet<Tuple3<Integer, Long, String>> ds2 = CollectionDataSets.get3TupleDataSet(env);
    +
    +		DataSet<Tuple3<Integer, Long, String>> coGrouped = ds1.coGroup(ds2).
    +				where(new KeySelector<Tuple5<Integer, Long, Integer, String, Long>,
    +						Tuple2<Integer, Long>>() {
    +					@Override
    +					public Tuple2<Integer, Long> getKey(Tuple5<Integer, Long, Integer, String, Long> t) throws Exception {
    +						return new Tuple2<Integer, Long>(t.f0, t.f4);
    +					}
    +				}).
    +				equalTo(new KeySelector<Tuple3<Integer,Long,String>, Tuple2<Integer, Long>>() {
    +
    +					@Override
    +					public Tuple2<Integer, Long> getKey(Tuple3<Integer,Long,String> t) {
    +						return new Tuple2<Integer, Long>(t.f0, t.f1);
    +					}
    +				}).
    +				with(new CoGroupFunction<Tuple5<Integer, Long, Integer, String, Long>, Tuple3<Integer, Long, String>, Tuple3<Integer, Long, String>>() {
    +					@Override
    +					public void coGroup(Iterable<Tuple5<Integer, Long, Integer, String, Long>> first,
    +					                    Iterable<Tuple3<Integer, Long, String>> second,
    +					                    Collector<Tuple3<Integer, Long, String>> out)
    +					{
    +						List<String> strs = new ArrayList<String>();
    +
    +						for (Tuple5<Integer, Long, Integer, String, Long> t : first) {
    +							strs.add(t.f3);
    +						}
    +
    +						for(Tuple3<Integer, Long, String> t : second) {
    +							for(String s : strs) {
    +								out.collect(new Tuple3<Integer, Long, String>(t.f0, t.f1, s));
    +							}
    +						}
    +					}
    +				});
    +
    +		List<Tuple3<Integer, Long, String>> result = coGrouped.collect();
    +
    +		String expected = "1,1,Hallo\n" +
    +				"2,2,Hallo Welt\n" +
    +				"3,2,Hallo Welt wie gehts?\n" +
    +				"3,2,ABC\n" +
    +				"5,3,HIJ\n" +
    +				"5,3,IJK\n";
    +
    +		compareResultAsTuples(result, expected);
    +	}
    +
    +	@Test(expected = InvalidProgramException.class)
    --- End diff --
    
    Would make sense to test this in a more specific way, e.g. wrap in `try { ... } catch (InvalidProgramException e) { }` and check that the root cause of `e` is `NotSerializableException`. Otherwise, a not respected closure cleaner usage flag might be hidden by another exception. 


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---