You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "Fabian Hueske (JIRA)" <ji...@apache.org> on 2016/11/29 14:52:59 UTC

[jira] [Closed] (FLINK-5184) Error result of compareSerialized in RowComparator class

     [ https://issues.apache.org/jira/browse/FLINK-5184?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Fabian Hueske closed FLINK-5184.
--------------------------------
       Resolution: Fixed
    Fix Version/s: 1.1.4
                   1.2.0

Fixed for 1.2.0 with ecfb5b5f6fd6bf1555c7240d77dd9aca982f4416
Fixed for 1.1.4 with 0758d0be60647f09f0254092c05601d6698ae90f

> Error result of compareSerialized in RowComparator class
> --------------------------------------------------------
>
>                 Key: FLINK-5184
>                 URL: https://issues.apache.org/jira/browse/FLINK-5184
>             Project: Flink
>          Issue Type: Bug
>          Components: Table API & SQL
>    Affects Versions: 1.2.0
>            Reporter: godfrey he
>            Assignee: godfrey he
>             Fix For: 1.2.0, 1.1.4
>
>
> RowSerializer will write null mask for all fields in a row before serialize row data to  DataOutputView. 
> {code:title=RowSerializer.scala|borderStyle=solid}
> override def serialize(value: Row, target: DataOutputView) {
>     val len = fieldSerializers.length
>     if (value.productArity != len) {
>       throw new RuntimeException("Row arity of value does not match serializers.")
>     }
>     // write a null mask
>     writeNullMask(len, value, target)
> ......
> }
> {code}
> RowComparator will deserialize a row data from DataInputView when call compareSerialized method. However, the first parameter value of readIntoNullMask method is wrong, which should be the count of all fields, rather than the length of serializers (to deserialize the first n fields for comparison).
> {code:title=RowComparator.scala|borderStyle=solid}
> override def compareSerialized(firstSource: DataInputView, secondSource: DataInputView): Int = {
>     val len = serializers.length
>     val keyLen = keyPositions.length
>     readIntoNullMask(len, firstSource, nullMask1)
>     readIntoNullMask(len, secondSource, nullMask2)
> ......
> }
> {code}



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