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

Congxian Qiu(klion26) commented on FLINK-16916:
-----------------------------------------------

[~aljoscha] , what do you think about this, please assign this to me if it is 
reasonable.
As this can lead to wrong answer when using this serializer, so mark it as 
BLOCKer, please downgrade if the priority set wrong.

> The logic of NullableSerializer#copy is wrong
> ---------------------------------------------
>
>                 Key: FLINK-16916
>                 URL: https://issues.apache.org/jira/browse/FLINK-16916
>             Project: Flink
>          Issue Type: Bug
>          Components: API / Type Serialization System
>    Affects Versions: 1.8.3, 1.9.2, 1.10.0
>            Reporter: Congxian Qiu(klion26)
>            Priority: Blocker
>             Fix For: 1.11.0
>
>
> When debugging the problem reported by FLINK-16724, Found that the logic of 
> {{NullableSerializer#copy}} is wrong. currently, the logic is such as below:
> {code:java}
> public void copy(DataInputView source, DataOutputView target) throws 
> IOException {
>    boolean isNull = source.readBoolean();
>    target.writeBoolean(isNull);
>    if (isNull) {
>       target.write(padding);
>    }
>    else {
>       originalSerializer.copy(source, target);
>    }
> }
> {code}
> we forgot to skip {{paddings.length}} bytes when if the {{padding}}'s length 
> is not 0.
> We can correct the logic such as below 
> {code:java}
> public void copy(DataInputView source, DataOutputView target) throws 
> IOException {
>    boolean isNull = deserializeNull(source); // this will skip the padding 
> values.
>    target.writeBoolean(isNull);
>    if (isNull) {
>       target.write(padding);
>    }
>    else {
>       originalSerializer.copy(source, target);
>    }
> }
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to