hive-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Zoltan Haindrich (JIRA)" <j...@apache.org>
Subject [jira] [Assigned] (HIVE-17555) StatsUtils considers all ranges to be 'long'; and loose precision / introduce bugs in some cases
Date Tue, 19 Sep 2017 15:03:00 GMT

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

Zoltan Haindrich reassigned HIVE-17555:
---------------------------------------

    Assignee: Zoltan Haindrich

> StatsUtils considers all ranges to be 'long'; and loose precision / introduce bugs in
some cases
> ------------------------------------------------------------------------------------------------
>
>                 Key: HIVE-17555
>                 URL: https://issues.apache.org/jira/browse/HIVE-17555
>             Project: Hive
>          Issue Type: Bug
>          Components: Statistics
>            Reporter: Zoltan Haindrich
>            Assignee: Zoltan Haindrich
>
> The following test fails because the combined range is: {{\[0:0\]}}
> This problem is present in other methods of StatsUtil as well
> {code}
> package org.apache.hadoop.hive.ql.stats;
> import static org.junit.Assert.assertTrue;
> import org.apache.hadoop.hive.ql.plan.ColStatistics.Range;
> import org.junit.Test;
> public class TestStatsUtils {
>   @Test
>   public void test1() {
>     Range r1 = new Range(0.1f, 0.4f);
>     Range r2 = new Range(0.3f, 0.9f);
>     assertTrue(rangeContains(r1, 0.2f));
>     Range r3 = StatsUtils.combineRange(r1, r2);
>     System.out.println(r3);
>     assertTrue(rangeContains(r3, 0.2f));
>   }
>   private boolean rangeContains(Range range, Number f) {
>     double m = range.minValue.doubleValue();
>     double M = range.maxValue.doubleValue();
>     double v = f.doubleValue();
>     return m <= v && v <= M;
>   }
> }
> {code}
> https://github.com/apache/hive/blob/32e854ef1c25f21d53f7932723cfc76bf75a71cd/ql/src/java/org/apache/hadoop/hive/ql/stats/StatsUtils.java#L1955



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Mime
View raw message