hive-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hive QA (JIRA)" <>
Subject [jira] [Commented] (HIVE-5839) BytesRefArrayWritable compareTo violates contract
Date Fri, 22 Nov 2013 23:27:35 GMT


Hive QA commented on HIVE-5839:

{color:red}Overall{color}: -1 at least one tests failed

Here are the results of testing the latest attachment:

{color:red}ERROR:{color} -1 due to 1 failed/errored test(s), 4652 tests executed
*Failed tests:*

Test results:
Console output:

Executing org.apache.hive.ptest.execution.PrepPhase
Executing org.apache.hive.ptest.execution.ExecutionPhase
Executing org.apache.hive.ptest.execution.ReportingPhase
Tests failed with: TestsFailedException: 1 tests failed

This message is automatically generated.


> BytesRefArrayWritable compareTo violates contract
> -------------------------------------------------
>                 Key: HIVE-5839
>                 URL:
>             Project: Hive
>          Issue Type: Bug
>          Components: Serializers/Deserializers
>    Affects Versions: 0.11.0, 0.12.0
>            Reporter: Ian Robertson
>            Assignee: Xuefu Zhang
>         Attachments: HIVE-5839.patch, HIVE-5839.patch
> BytesRefArrayWritable's compareTo violates the compareTo contract from java.lang.Object.
> * The implementor must ensure sgn(x.compareTo( y )) == -sgn(y.compareTo( x )) for all
x and y.
> The compareTo implementation on BytesRefArrayWritable does a proper comparison of the
sizes of the two instances. However, if the sizes are the same, it proceeds to do a check
if both array's have the same constant. If not, it returns 1. This means that if x and y are
two BytesRefArrayWritable instances with the same size, but different contents, then x.compareTo(
y ) == 1 and y.compareTo( x ) == 1.
> Additionally, the comparison of contents is order agnostic. This seems wrong, since order
of entries should matter. It is also very inefficient, running at O(n^2), where n is the number
of entries.

This message was sent by Atlassian JIRA

View raw message