FAQ
Repository: hive
Updated Branches:
   refs/heads/master d0c68b29e -> 4757302cf


HIVE-10966 : direct SQL for stats has a cast exception on some databases (Sergey Shelukhin, reviewed by Ashutosh Chauhan)


Project: http://git-wip-us.apache.org/repos/asf/hive/repo
Commit: http://git-wip-us.apache.org/repos/asf/hive/commit/4757302c
Tree: http://git-wip-us.apache.org/repos/asf/hive/tree/4757302c
Diff: http://git-wip-us.apache.org/repos/asf/hive/diff/4757302c

Branch: refs/heads/master
Commit: 4757302cf13854a29e8487b9124c72c57a16f52f
Parents: d0c68b2
Author: Thejas Nair <thejas@hortonworks.com>
Authored: Tue Jun 9 17:59:43 2015 -0700
Committer: Thejas Nair <thejas@hortonworks.com>
Committed: Tue Jun 9 17:59:49 2015 -0700

----------------------------------------------------------------------
  .../hadoop/hive/metastore/StatObjectConverter.java | 16 ++++++++--------
  1 file changed, 8 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hive/blob/4757302c/metastore/src/java/org/apache/hadoop/hive/metastore/StatObjectConverter.java
----------------------------------------------------------------------
diff --git a/metastore/src/java/org/apache/hadoop/hive/metastore/StatObjectConverter.java b/metastore/src/java/org/apache/hadoop/hive/metastore/StatObjectConverter.java
index 230d9a2..b3ceff1 100644
--- a/metastore/src/java/org/apache/hadoop/hive/metastore/StatObjectConverter.java
+++ b/metastore/src/java/org/apache/hadoop/hive/metastore/StatObjectConverter.java
@@ -464,14 +464,14 @@ public class StatObjectConverter {
          colType.startsWith("varchar") || colType.startsWith("char")) {
        StringColumnStatsData stringStats = new StringColumnStatsData();
        stringStats.setNumNulls(MetaStoreDirectSql.extractSqlLong(nulls));
- stringStats.setAvgColLen((Double)avglen);
+ stringStats.setAvgColLen(MetaStoreDirectSql.extractSqlDouble(avglen));
        stringStats.setMaxColLen(MetaStoreDirectSql.extractSqlLong(maxlen));
        stringStats.setNumDVs(MetaStoreDirectSql.extractSqlLong(dist));
        data.setStringStats(stringStats);
      } else if (colType.equals("binary")) {
        BinaryColumnStatsData binaryStats = new BinaryColumnStatsData();
        binaryStats.setNumNulls(MetaStoreDirectSql.extractSqlLong(nulls));
- binaryStats.setAvgColLen((Double)avglen);
+ binaryStats.setAvgColLen(MetaStoreDirectSql.extractSqlDouble(avglen));
        binaryStats.setMaxColLen(MetaStoreDirectSql.extractSqlLong(maxlen));
        data.setBinaryStats(binaryStats);
      } else if (colType.equals("bigint") || colType.equals("int") ||
@@ -491,10 +491,10 @@ public class StatObjectConverter {
        DoubleColumnStatsData doubleStats = new DoubleColumnStatsData();
        doubleStats.setNumNulls(MetaStoreDirectSql.extractSqlLong(nulls));
        if (dhigh != null) {
- doubleStats.setHighValue((Double)dhigh);
+ doubleStats.setHighValue(MetaStoreDirectSql.extractSqlDouble(dhigh));
        }
        if (dlow != null) {
- doubleStats.setLowValue((Double)dlow);
+ doubleStats.setLowValue(MetaStoreDirectSql.extractSqlDouble(dlow));
        }
        doubleStats.setNumDVs(MetaStoreDirectSql.extractSqlLong(dist));
        data.setDoubleStats(doubleStats);
@@ -539,14 +539,14 @@ public class StatObjectConverter {
colType.startsWith("char")) {
        StringColumnStatsData stringStats = new StringColumnStatsData();
        stringStats.setNumNulls(MetaStoreDirectSql.extractSqlLong(nulls));
- stringStats.setAvgColLen((Double) avglen);
+ stringStats.setAvgColLen(MetaStoreDirectSql.extractSqlDouble(avglen));
        stringStats.setMaxColLen(MetaStoreDirectSql.extractSqlLong(maxlen));
        stringStats.setNumDVs(MetaStoreDirectSql.extractSqlLong(dist));
        data.setStringStats(stringStats);
      } else if (colType.equals("binary")) {
        BinaryColumnStatsData binaryStats = new BinaryColumnStatsData();
        binaryStats.setNumNulls(MetaStoreDirectSql.extractSqlLong(nulls));
- binaryStats.setAvgColLen((Double) avglen);
+ binaryStats.setAvgColLen(MetaStoreDirectSql.extractSqlDouble(avglen));
        binaryStats.setMaxColLen(MetaStoreDirectSql.extractSqlLong(maxlen));
        data.setBinaryStats(binaryStats);
      } else if (colType.equals("bigint") || colType.equals("int") || colType.equals("smallint")
@@ -583,10 +583,10 @@ public class StatObjectConverter {
        DoubleColumnStatsData doubleStats = new DoubleColumnStatsData();
        doubleStats.setNumNulls(MetaStoreDirectSql.extractSqlLong(nulls));
        if (dhigh != null) {
- doubleStats.setHighValue((Double) dhigh);
+ doubleStats.setHighValue(MetaStoreDirectSql.extractSqlDouble(dhigh));
        }
        if (dlow != null) {
- doubleStats.setLowValue((Double) dlow);
+ doubleStats.setLowValue(MetaStoreDirectSql.extractSqlDouble(dlow));
        }
        long lowerBound = MetaStoreDirectSql.extractSqlLong(dist);
        long higherBound = MetaStoreDirectSql.extractSqlLong(sumDist);

Search Discussions

  • Thejas at Jun 10, 2015 at 1:00 am
    Repository: hive
    Updated Branches:
       refs/heads/branch-1 2fb6d087f -> 0e97419cf


    HIVE-10966 : direct SQL for stats has a cast exception on some databases (Sergey Shelukhin, reviewed by Ashutosh Chauhan)


    Project: http://git-wip-us.apache.org/repos/asf/hive/repo
    Commit: http://git-wip-us.apache.org/repos/asf/hive/commit/0e97419c
    Tree: http://git-wip-us.apache.org/repos/asf/hive/tree/0e97419c
    Diff: http://git-wip-us.apache.org/repos/asf/hive/diff/0e97419c

    Branch: refs/heads/branch-1
    Commit: 0e97419cfc08302a6f7ec096afecc55307442baa
    Parents: 2fb6d08
    Author: Thejas Nair <thejas@hortonworks.com>
    Authored: Tue Jun 9 17:59:43 2015 -0700
    Committer: Thejas Nair <thejas@hortonworks.com>
    Committed: Tue Jun 9 18:00:01 2015 -0700

    ----------------------------------------------------------------------
      .../hadoop/hive/metastore/StatObjectConverter.java | 16 ++++++++--------
      1 file changed, 8 insertions(+), 8 deletions(-)
    ----------------------------------------------------------------------


    http://git-wip-us.apache.org/repos/asf/hive/blob/0e97419c/metastore/src/java/org/apache/hadoop/hive/metastore/StatObjectConverter.java
    ----------------------------------------------------------------------
    diff --git a/metastore/src/java/org/apache/hadoop/hive/metastore/StatObjectConverter.java b/metastore/src/java/org/apache/hadoop/hive/metastore/StatObjectConverter.java
    index 230d9a2..b3ceff1 100644
    --- a/metastore/src/java/org/apache/hadoop/hive/metastore/StatObjectConverter.java
    +++ b/metastore/src/java/org/apache/hadoop/hive/metastore/StatObjectConverter.java
    @@ -464,14 +464,14 @@ public class StatObjectConverter {
              colType.startsWith("varchar") || colType.startsWith("char")) {
            StringColumnStatsData stringStats = new StringColumnStatsData();
            stringStats.setNumNulls(MetaStoreDirectSql.extractSqlLong(nulls));
    - stringStats.setAvgColLen((Double)avglen);
    + stringStats.setAvgColLen(MetaStoreDirectSql.extractSqlDouble(avglen));
            stringStats.setMaxColLen(MetaStoreDirectSql.extractSqlLong(maxlen));
            stringStats.setNumDVs(MetaStoreDirectSql.extractSqlLong(dist));
            data.setStringStats(stringStats);
          } else if (colType.equals("binary")) {
            BinaryColumnStatsData binaryStats = new BinaryColumnStatsData();
            binaryStats.setNumNulls(MetaStoreDirectSql.extractSqlLong(nulls));
    - binaryStats.setAvgColLen((Double)avglen);
    + binaryStats.setAvgColLen(MetaStoreDirectSql.extractSqlDouble(avglen));
            binaryStats.setMaxColLen(MetaStoreDirectSql.extractSqlLong(maxlen));
            data.setBinaryStats(binaryStats);
          } else if (colType.equals("bigint") || colType.equals("int") ||
    @@ -491,10 +491,10 @@ public class StatObjectConverter {
            DoubleColumnStatsData doubleStats = new DoubleColumnStatsData();
            doubleStats.setNumNulls(MetaStoreDirectSql.extractSqlLong(nulls));
            if (dhigh != null) {
    - doubleStats.setHighValue((Double)dhigh);
    + doubleStats.setHighValue(MetaStoreDirectSql.extractSqlDouble(dhigh));
            }
            if (dlow != null) {
    - doubleStats.setLowValue((Double)dlow);
    + doubleStats.setLowValue(MetaStoreDirectSql.extractSqlDouble(dlow));
            }
            doubleStats.setNumDVs(MetaStoreDirectSql.extractSqlLong(dist));
            data.setDoubleStats(doubleStats);
    @@ -539,14 +539,14 @@ public class StatObjectConverter {
    colType.startsWith("char")) {
            StringColumnStatsData stringStats = new StringColumnStatsData();
            stringStats.setNumNulls(MetaStoreDirectSql.extractSqlLong(nulls));
    - stringStats.setAvgColLen((Double) avglen);
    + stringStats.setAvgColLen(MetaStoreDirectSql.extractSqlDouble(avglen));
            stringStats.setMaxColLen(MetaStoreDirectSql.extractSqlLong(maxlen));
            stringStats.setNumDVs(MetaStoreDirectSql.extractSqlLong(dist));
            data.setStringStats(stringStats);
          } else if (colType.equals("binary")) {
            BinaryColumnStatsData binaryStats = new BinaryColumnStatsData();
            binaryStats.setNumNulls(MetaStoreDirectSql.extractSqlLong(nulls));
    - binaryStats.setAvgColLen((Double) avglen);
    + binaryStats.setAvgColLen(MetaStoreDirectSql.extractSqlDouble(avglen));
            binaryStats.setMaxColLen(MetaStoreDirectSql.extractSqlLong(maxlen));
            data.setBinaryStats(binaryStats);
          } else if (colType.equals("bigint") || colType.equals("int") || colType.equals("smallint")
    @@ -583,10 +583,10 @@ public class StatObjectConverter {
            DoubleColumnStatsData doubleStats = new DoubleColumnStatsData();
            doubleStats.setNumNulls(MetaStoreDirectSql.extractSqlLong(nulls));
            if (dhigh != null) {
    - doubleStats.setHighValue((Double) dhigh);
    + doubleStats.setHighValue(MetaStoreDirectSql.extractSqlDouble(dhigh));
            }
            if (dlow != null) {
    - doubleStats.setLowValue((Double) dlow);
    + doubleStats.setLowValue(MetaStoreDirectSql.extractSqlDouble(dlow));
            }
            long lowerBound = MetaStoreDirectSql.extractSqlLong(dist);
            long higherBound = MetaStoreDirectSql.extractSqlLong(sumDist);
  • Thejas at Jun 10, 2015 at 1:00 am
    Repository: hive
    Updated Branches:
       refs/heads/branch-1.2 f5b158acf -> 8c2a4de6f


    HIVE-10966 : direct SQL for stats has a cast exception on some databases (Sergey Shelukhin, reviewed by Ashutosh Chauhan)


    Project: http://git-wip-us.apache.org/repos/asf/hive/repo
    Commit: http://git-wip-us.apache.org/repos/asf/hive/commit/8c2a4de6
    Tree: http://git-wip-us.apache.org/repos/asf/hive/tree/8c2a4de6
    Diff: http://git-wip-us.apache.org/repos/asf/hive/diff/8c2a4de6

    Branch: refs/heads/branch-1.2
    Commit: 8c2a4de6fbd537d9b260cd6e65307101c107c737
    Parents: f5b158a
    Author: Thejas Nair <thejas@hortonworks.com>
    Authored: Tue Jun 9 17:59:43 2015 -0700
    Committer: Thejas Nair <thejas@hortonworks.com>
    Committed: Tue Jun 9 18:00:20 2015 -0700

    ----------------------------------------------------------------------
      .../hadoop/hive/metastore/StatObjectConverter.java | 16 ++++++++--------
      1 file changed, 8 insertions(+), 8 deletions(-)
    ----------------------------------------------------------------------


    http://git-wip-us.apache.org/repos/asf/hive/blob/8c2a4de6/metastore/src/java/org/apache/hadoop/hive/metastore/StatObjectConverter.java
    ----------------------------------------------------------------------
    diff --git a/metastore/src/java/org/apache/hadoop/hive/metastore/StatObjectConverter.java b/metastore/src/java/org/apache/hadoop/hive/metastore/StatObjectConverter.java
    index 230d9a2..b3ceff1 100644
    --- a/metastore/src/java/org/apache/hadoop/hive/metastore/StatObjectConverter.java
    +++ b/metastore/src/java/org/apache/hadoop/hive/metastore/StatObjectConverter.java
    @@ -464,14 +464,14 @@ public class StatObjectConverter {
              colType.startsWith("varchar") || colType.startsWith("char")) {
            StringColumnStatsData stringStats = new StringColumnStatsData();
            stringStats.setNumNulls(MetaStoreDirectSql.extractSqlLong(nulls));
    - stringStats.setAvgColLen((Double)avglen);
    + stringStats.setAvgColLen(MetaStoreDirectSql.extractSqlDouble(avglen));
            stringStats.setMaxColLen(MetaStoreDirectSql.extractSqlLong(maxlen));
            stringStats.setNumDVs(MetaStoreDirectSql.extractSqlLong(dist));
            data.setStringStats(stringStats);
          } else if (colType.equals("binary")) {
            BinaryColumnStatsData binaryStats = new BinaryColumnStatsData();
            binaryStats.setNumNulls(MetaStoreDirectSql.extractSqlLong(nulls));
    - binaryStats.setAvgColLen((Double)avglen);
    + binaryStats.setAvgColLen(MetaStoreDirectSql.extractSqlDouble(avglen));
            binaryStats.setMaxColLen(MetaStoreDirectSql.extractSqlLong(maxlen));
            data.setBinaryStats(binaryStats);
          } else if (colType.equals("bigint") || colType.equals("int") ||
    @@ -491,10 +491,10 @@ public class StatObjectConverter {
            DoubleColumnStatsData doubleStats = new DoubleColumnStatsData();
            doubleStats.setNumNulls(MetaStoreDirectSql.extractSqlLong(nulls));
            if (dhigh != null) {
    - doubleStats.setHighValue((Double)dhigh);
    + doubleStats.setHighValue(MetaStoreDirectSql.extractSqlDouble(dhigh));
            }
            if (dlow != null) {
    - doubleStats.setLowValue((Double)dlow);
    + doubleStats.setLowValue(MetaStoreDirectSql.extractSqlDouble(dlow));
            }
            doubleStats.setNumDVs(MetaStoreDirectSql.extractSqlLong(dist));
            data.setDoubleStats(doubleStats);
    @@ -539,14 +539,14 @@ public class StatObjectConverter {
    colType.startsWith("char")) {
            StringColumnStatsData stringStats = new StringColumnStatsData();
            stringStats.setNumNulls(MetaStoreDirectSql.extractSqlLong(nulls));
    - stringStats.setAvgColLen((Double) avglen);
    + stringStats.setAvgColLen(MetaStoreDirectSql.extractSqlDouble(avglen));
            stringStats.setMaxColLen(MetaStoreDirectSql.extractSqlLong(maxlen));
            stringStats.setNumDVs(MetaStoreDirectSql.extractSqlLong(dist));
            data.setStringStats(stringStats);
          } else if (colType.equals("binary")) {
            BinaryColumnStatsData binaryStats = new BinaryColumnStatsData();
            binaryStats.setNumNulls(MetaStoreDirectSql.extractSqlLong(nulls));
    - binaryStats.setAvgColLen((Double) avglen);
    + binaryStats.setAvgColLen(MetaStoreDirectSql.extractSqlDouble(avglen));
            binaryStats.setMaxColLen(MetaStoreDirectSql.extractSqlLong(maxlen));
            data.setBinaryStats(binaryStats);
          } else if (colType.equals("bigint") || colType.equals("int") || colType.equals("smallint")
    @@ -583,10 +583,10 @@ public class StatObjectConverter {
            DoubleColumnStatsData doubleStats = new DoubleColumnStatsData();
            doubleStats.setNumNulls(MetaStoreDirectSql.extractSqlLong(nulls));
            if (dhigh != null) {
    - doubleStats.setHighValue((Double) dhigh);
    + doubleStats.setHighValue(MetaStoreDirectSql.extractSqlDouble(dhigh));
            }
            if (dlow != null) {
    - doubleStats.setLowValue((Double) dlow);
    + doubleStats.setLowValue(MetaStoreDirectSql.extractSqlDouble(dlow));
            }
            long lowerBound = MetaStoreDirectSql.extractSqlLong(dist);
            long higherBound = MetaStoreDirectSql.extractSqlLong(sumDist);

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupcommits @
categorieshive, hadoop
postedJun 10, '15 at 12:59a
activeJun 10, '15 at 1:00a
posts3
users1
websitehive.apache.org

1 user in discussion

Thejas: 3 posts

People

Translate

site design / logo © 2021 Grokbase