You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hive.apache.org by se...@apache.org on 2018/07/11 02:04:47 UTC
[15/32] hive git commit: HIVE-20098 : Statistics: NPE when getting
Date column partition statistics (Andrii via Gopal V)
HIVE-20098 : Statistics: NPE when getting Date column partition statistics (Andrii via Gopal V)
Signed-off-by: Ashutosh Chauhan <ha...@apache.org>
Project: http://git-wip-us.apache.org/repos/asf/hive/repo
Commit: http://git-wip-us.apache.org/repos/asf/hive/commit/8494522d
Tree: http://git-wip-us.apache.org/repos/asf/hive/tree/8494522d
Diff: http://git-wip-us.apache.org/repos/asf/hive/diff/8494522d
Branch: refs/heads/master-txnstats
Commit: 8494522d810b8a31764729a8dd814f1e6ceab10e
Parents: eae5225
Author: Andrii Rosa <an...@fb.com>
Authored: Fri Jul 6 16:02:57 2018 -0700
Committer: Ashutosh Chauhan <ha...@apache.org>
Committed: Fri Jul 6 16:02:57 2018 -0700
----------------------------------------------------------------------
.../apache/hadoop/hive/metastore/StatObjectConverter.java | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/hive/blob/8494522d/standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/StatObjectConverter.java
----------------------------------------------------------------------
diff --git a/standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/StatObjectConverter.java b/standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/StatObjectConverter.java
index ef2d670..7a0b21b 100644
--- a/standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/StatObjectConverter.java
+++ b/standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/StatObjectConverter.java
@@ -466,8 +466,14 @@ public class StatObjectConverter {
} else if (colType.equals("date")) {
DateColumnStatsDataInspector dateStats = new DateColumnStatsDataInspector();
dateStats.setNumNulls(mStatsObj.getNumNulls());
- dateStats.setHighValue(new Date(mStatsObj.getLongHighValue()));
- dateStats.setLowValue(new Date(mStatsObj.getLongLowValue()));
+ Long highValue = mStatsObj.getLongHighValue();
+ if (highValue != null) {
+ dateStats.setHighValue(new Date(highValue));
+ }
+ Long lowValue = mStatsObj.getLongLowValue();
+ if (lowValue != null) {
+ dateStats.setLowValue(new Date(lowValue));
+ }
dateStats.setNumDVs(mStatsObj.getNumDVs());
dateStats.setBitVectors((mStatsObj.getBitVector()==null||!enableBitVector)? null : mStatsObj.getBitVector());
colStatsData.setDateStats(dateStats);