DRILL-5857: Fix NumberFormatException in Hive unit tests closes #980
Project: http://git-wip-us.apache.org/repos/asf/drill/repo Commit: http://git-wip-us.apache.org/repos/asf/drill/commit/0049f173 Tree: http://git-wip-us.apache.org/repos/asf/drill/tree/0049f173 Diff: http://git-wip-us.apache.org/repos/asf/drill/diff/0049f173 Branch: refs/heads/master Commit: 0049f17331462e0c7940bb5b5b79eab8e75d2a86 Parents: 27b6605 Author: Volodymyr Vysotskyi <vvo...@gmail.com> Authored: Mon Oct 9 14:28:42 2017 +0000 Committer: Paul Rogers <prog...@maprtech.com> Committed: Wed Oct 11 10:23:17 2017 -0700 ---------------------------------------------------------------------- .../apache/drill/exec/store/hive/HiveMetadataProvider.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/drill/blob/0049f173/contrib/storage-hive/core/src/main/java/org/apache/drill/exec/store/hive/HiveMetadataProvider.java ---------------------------------------------------------------------- diff --git a/contrib/storage-hive/core/src/main/java/org/apache/drill/exec/store/hive/HiveMetadataProvider.java b/contrib/storage-hive/core/src/main/java/org/apache/drill/exec/store/hive/HiveMetadataProvider.java index e80b37b..8abc79a 100644 --- a/contrib/storage-hive/core/src/main/java/org/apache/drill/exec/store/hive/HiveMetadataProvider.java +++ b/contrib/storage-hive/core/src/main/java/org/apache/drill/exec/store/hive/HiveMetadataProvider.java @@ -1,4 +1,4 @@ -/** +/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information @@ -194,8 +194,9 @@ public class HiveMetadataProvider { * Get the stats from table properties. If not found -1 is returned for each stats field. * CAUTION: stats may not be up-to-date with the underlying data. It is always good to run the ANALYZE command on * Hive table to have up-to-date stats. - * @param properties - * @return + * + * @param properties the source of table stats + * @return {@link HiveStats} instance with rows number and size in bytes from specified properties */ private HiveStats getStatsFromProps(final Properties properties) { long numRows = -1; @@ -208,7 +209,7 @@ public class HiveMetadataProvider { final String sizeInBytesProp = properties.getProperty(StatsSetupConst.TOTAL_SIZE); if (sizeInBytesProp != null) { - sizeInBytes = Long.valueOf(numRowsProp); + sizeInBytes = Long.valueOf(sizeInBytesProp); } } catch (final NumberFormatException e) { logger.error("Failed to parse Hive stats in metastore.", e);