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

Zoltan Haindrich commented on HIVE-19131:
-----------------------------------------

We've just take a closer look at the comparison itself with [~abstractdog]; and 
it seems like even the compareTo is problematic...

the compareTo method belongs to {{Decimal}} ; but it seems it [compares the 
unscaled value before the 
scale|https://github.com/apache/hive/blob/2e027cff7a064b64019b2a2df54a614b018be15f/standalone-metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/Decimal.java#L329];
 which could probably lead to interesting results...

 

> DecimalColumnStatsMergerTest comparison review
> ----------------------------------------------
>
>                 Key: HIVE-19131
>                 URL: https://issues.apache.org/jira/browse/HIVE-19131
>             Project: Hive
>          Issue Type: Bug
>            Reporter: Laszlo Bodor
>            Assignee: Laszlo Bodor
>            Priority: Major
>
> DecimalColumnStatsMergerTest has a strange comparison logic, which needs to 
> be reviewed.
> Regarding low and high values, it uses compareTo with the same direction, 
> which seems to be incorrect: old.compareTo(new) > 0 -> pick old value in both 
> cases
> {code:java}
> Decimal lowValue = aggregateData.getLowValue() != null && 
> (aggregateData.getLowValue().compareTo(newData.getLowValue()) > 0) ? 
> aggregateData .getLowValue() : newData.getLowValue(); 
> aggregateData.setLowValue(lowValue); 
> Decimal highValue = aggregateData.getHighValue() != null && 
> (aggregateData.getHighValue().compareTo(newData.getHighValue()) > 0) ? 
> aggregateData .getHighValue() : newData.getHighValue();
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to