drill-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From amansi...@apache.org
Subject [3/5] drill git commit: DRILL-5086: Fix conversion of min and max values to appropriate data type.
Date Sun, 04 Dec 2016 19:21:15 GMT
DRILL-5086: Fix conversion of min and max values to appropriate data type.

close apache/drill#674


Project: http://git-wip-us.apache.org/repos/asf/drill/repo
Commit: http://git-wip-us.apache.org/repos/asf/drill/commit/9062901f
Tree: http://git-wip-us.apache.org/repos/asf/drill/tree/9062901f
Diff: http://git-wip-us.apache.org/repos/asf/drill/diff/9062901f

Branch: refs/heads/master
Commit: 9062901fd1656ffacbd55a2b5cc7de6a03982590
Parents: db9d1b1
Author: Aman Sinha <asinha@maprtech.com>
Authored: Wed Nov 30 15:19:36 2016 -0800
Committer: Aman Sinha <asinha@maprtech.com>
Committed: Sun Dec 4 07:25:13 2016 -0800

----------------------------------------------------------------------
 .../store/parquet/stat/ParquetMetaStatCollector.java    | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/drill/blob/9062901f/exec/java-exec/src/main/java/org/apache/drill/exec/store/parquet/stat/ParquetMetaStatCollector.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/store/parquet/stat/ParquetMetaStatCollector.java
b/exec/java-exec/src/main/java/org/apache/drill/exec/store/parquet/stat/ParquetMetaStatCollector.java
index 3fe10c8..d86f863 100644
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/store/parquet/stat/ParquetMetaStatCollector.java
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/store/parquet/stat/ParquetMetaStatCollector.java
@@ -137,23 +137,23 @@ public class ParquetMetaStatCollector implements  ColumnStatCollector{
       switch (type.getMinorType()) {
       case INT :
       case TIME:
-        ((IntStatistics) stat).setMinMax(((Integer) min).intValue(), ((Integer) max).intValue());
+        ((IntStatistics) stat).setMinMax(Integer.parseInt(min.toString()), Integer.parseInt(max.toString()));
         break;
       case BIGINT:
       case TIMESTAMP:
-        ((LongStatistics) stat).setMinMax(((Long) min).longValue(), ((Long) max).longValue());
+        ((LongStatistics) stat).setMinMax(Long.parseLong(min.toString()), Long.parseLong(max.toString()));
         break;
       case FLOAT4:
-        ((FloatStatistics) stat).setMinMax(((Float) min).floatValue(), ((Float) max).floatValue());
+        ((FloatStatistics) stat).setMinMax(Float.parseFloat(min.toString()), Float.parseFloat(max.toString()));
         break;
       case FLOAT8:
-        ((DoubleStatistics) stat).setMinMax(((Double) min).doubleValue(), ((Double) max).doubleValue());
+        ((DoubleStatistics) stat).setMinMax(Double.parseDouble(min.toString()), Double.parseDouble(max.toString()));
         break;
       case DATE:
         convertedStat = new LongStatistics();
         convertedStat.setNumNulls(stat.getNumNulls());
-        final long minMS = convertToDrillDateValue(((Integer) min).intValue());
-        final long maxMS = convertToDrillDateValue(((Integer) max).intValue());
+        final long minMS = convertToDrillDateValue(Integer.parseInt(min.toString()));
+        final long maxMS = convertToDrillDateValue(Integer.parseInt(max.toString()));
         ((LongStatistics) convertedStat ).setMinMax(minMS, maxMS);
         break;
       default:


Mime
View raw message