[
https://issues.apache.org/jira/browse/FLINK-5184?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15705021#comment-15705021
]
ASF GitHub Bot commented on FLINK-5184:
---------------------------------------
GitHub user godfreyhe opened a pull request:
https://github.com/apache/flink/pull/2894
[FLINK-5184] fix bug: Error result of compareSerialized in RowComparator
class
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/godfreyhe/flink master
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/flink/pull/2894.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 #2894
----
commit e6c728025ec7bcfefe62a7130c2ce8c1716ffdd6
Author: godfreyhe <[email protected]>
Date: 2016-11-29T11:27:58Z
fix bug: Error result of compareSerialized in RowComparator class
----
> 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
>
> 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)