You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2017/02/23 14:30:45 UTC

[jira] [Commented] (FLINK-5890) GatherSumApply broken when object reuse enabled

    [ https://issues.apache.org/jira/browse/FLINK-5890?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15880533#comment-15880533 ] 

ASF GitHub Bot commented on FLINK-5890:
---------------------------------------

GitHub user greghogan opened a pull request:

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

    [FLINK-5890] [gelly] GatherSumApply broken when object reuse enabled

    GatherSumApplyIteration uses reduce and join for which extra care must be taken when object reuse is enabled. Adds a check for objects returned by the user to prevent system objects from being overwritten.
    
    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)
    
    - [ ] 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/greghogan/flink 5890_gathersumapply_broken_when_object_reuse_enabled

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

    https://github.com/apache/flink/pull/3402.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 #3402
    
----
commit c4a7c5103679c70b471e1003c860325d2a919b03
Author: Greg Hogan <co...@greghogan.com>
Date:   2017-02-23T13:47:48Z

    [FLINK-5890] [gelly] GatherSumApply broken when object reuse enabled
    
    GatherSumApplyIteration uses reduce and join for which extra care must
    be taken when object reuse is enabled. Adds a check for objects returned
    by the user to prevent system objects from being overwritten.

----


> GatherSumApply broken when object reuse enabled
> -----------------------------------------------
>
>                 Key: FLINK-5890
>                 URL: https://issues.apache.org/jira/browse/FLINK-5890
>             Project: Flink
>          Issue Type: Bug
>          Components: Gelly
>    Affects Versions: 1.3.0
>            Reporter: Greg Hogan
>            Assignee: Greg Hogan
>             Fix For: 1.3.0
>
>
> {{GatherSumApplyIteration.SumUdf.reduce}} can store a value from {{arg1}} in the new {{Tuple2}} which can be overwritten in {{ReduceDriver}}. We need to swap {{arg0.f1}} and {{arg1.f1}} when this happens (as done in {{ReduceDriver}} for the returned results).
> {code}
> 	@Override
> 	public Tuple2<K, M> reduce(Tuple2<K, M> arg0, Tuple2<K, M> arg1) throws Exception {
> 		K key = arg0.f0;
> 		M result = this.sumFunction.sum(arg0.f1, arg1.f1);
> 		return new Tuple2<>(key, result);
> 	}
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)