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

ASF GitHub Bot commented on DRILL-5094:
---------------------------------------

Github user amansinha100 commented on the issue:

    https://github.com/apache/drill/pull/675
  
    To clarify, I decided to accept the fix because in the context of the 
comparator call, the o2.getValue() should never be negative (since it is the 
#bytes of data used for affinity).  Strictly speaking, @laurentgo is right 
about potential for overflow for the subtraction, so I would suggest 
@chunhui-shi keep that in mind for future, particularly since it doesn't make 
sense to try and optimize this particular code path given that it is a one-time 
planner decision, not run-time code :)  Let's move on to more complex problems 
:)


> Assure Comparator to be transitive
> ----------------------------------
>
>                 Key: DRILL-5094
>                 URL: https://issues.apache.org/jira/browse/DRILL-5094
>             Project: Apache Drill
>          Issue Type: Bug
>            Reporter: Chunhui Shi
>            Assignee: Chunhui Shi
>            Priority: Critical
>              Labels: ready-to-commit
>
> In AssignmentCreator.java, one Comparator could break transitive attribute 
> required for a Comparator implementation and the result is not correct.
> E.g. for:
> long IntPlusOne = 0x80000000L;
> [0]=2 * IntPlusOne + 5, [1] = 2* IntPlusOne + 8, [2] = 4 * IntPlusOne + 4,
> the compare results will be like:
> compare([0],[1]) = -3,
> compare([1],[2]) = 4,
> compare([0],[2]) = 1 



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

Reply via email to