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

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

GitHub user twalthr opened a pull request:

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

    [FLINK-5011] [types] TraversableSerializer does not perform a deep co…

    This pull requests fixes a bug in the `TraverableSerializer` and in the 
tests itself. It adds a special test to check if immutable types are deep 
copied. I also noticed that `Traversable`s were marked as always immutable, 
which is not true. I corrected that.

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

    $ git pull https://github.com/twalthr/flink FLINK-5011

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

    https://github.com/apache/flink/pull/2952.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 #2952
    
----
commit e64ff9e445a4b3c36e80fadd8e710a867c360efa
Author: twalthr <[email protected]>
Date:   2016-12-06T14:07:45Z

    [FLINK-5011] [types] TraversableSerializer does not perform a deep copy of 
the elements it is traversing

----


> TraversableSerializer does not perform a deep copy of the elements it is 
> traversing
> -----------------------------------------------------------------------------------
>
>                 Key: FLINK-5011
>                 URL: https://issues.apache.org/jira/browse/FLINK-5011
>             Project: Flink
>          Issue Type: Bug
>          Components: Core, Scala API
>    Affects Versions: 1.1.3
>            Reporter: Dan Bress
>            Assignee: Timo Walther
>            Priority: Blocker
>              Labels: serialization
>             Fix For: 1.2.0
>
>
> I had an issue where the state in my rolling window was incorrectly being 
> maintained from window to window.  
> *The initial state of my window looked like this:*
> {code}
> Map[Key, MutableValue] = {("A", Value(0)}, ("B", Value(0)}
> {code}
> *Then in Window 0 I update the state so it looks like this at the close of 
> the window:*
> {code}
> Map[Key, MutableValue] = {("A", Value(1)}, ("B", Value(3)}
> {code}
> *Then at the start of Window 1 the state looks like it did at the end of 
> Window 0:*
> {code}
> Map[Key, MutableValue] = {("A", Value(1)}, ("B", Value(3)}
> {code}
> *when I expected it to look like the initial state:*
> {code}
> Map[Key, MutableValue] = {("A", Value(0)}, ("B", Value(0)}
> {code}
> It looks like 
> [TraversableSerializer|https://github.com/apache/flink/blob/master/flink-scala/src/main/scala/org/apache/flink/api/scala/typeutils/TraversableSerializer.scala#L65-L69]
>  is doing a shallow copy of the elements in the traversable instead of a deep 
> copy



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to