carbondata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jack...@apache.org
Subject [1/2] incubator-carbondata git commit: CARBONDATA-843 problem: null pointer exception was thrown when floor operation is done on decimal column. analysis: when floor operation was done on decimal column, scale was greater than precision.During floor oper
Date Wed, 05 Apr 2017 01:48:47 GMT
Repository: incubator-carbondata
Updated Branches:
  refs/heads/master 9e721a81b -> c62b29979


CARBONDATA-843
problem: null pointer exception was thrown when floor operation is done on decimal column.
analysis: when floor operation was done on decimal column, scale was greater than precision.During
floor operation , we tried to change the precision of the data.
solution: When sending to the spark layer for performing floor operation, we need to send
the precision and scale to the spark layer which are taken from the CarbonMeasure


Project: http://git-wip-us.apache.org/repos/asf/incubator-carbondata/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-carbondata/commit/43319298
Tree: http://git-wip-us.apache.org/repos/asf/incubator-carbondata/tree/43319298
Diff: http://git-wip-us.apache.org/repos/asf/incubator-carbondata/diff/43319298

Branch: refs/heads/master
Commit: 43319298eb122846286e16fdbd145594e4633aa4
Parents: 9e721a8
Author: akash <akash.r.nilugal@huawei.com>
Authored: Fri Mar 31 18:10:31 2017 +0530
Committer: jackylk <jacky.likun@huawei.com>
Committed: Wed Apr 5 09:46:56 2017 +0800

----------------------------------------------------------------------
 .../core/scan/collector/impl/AbstractScannedResultCollector.java  | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/43319298/core/src/main/java/org/apache/carbondata/core/scan/collector/impl/AbstractScannedResultCollector.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/carbondata/core/scan/collector/impl/AbstractScannedResultCollector.java
b/core/src/main/java/org/apache/carbondata/core/scan/collector/impl/AbstractScannedResultCollector.java
index c46d46c..1ecfbc8 100644
--- a/core/src/main/java/org/apache/carbondata/core/scan/collector/impl/AbstractScannedResultCollector.java
+++ b/core/src/main/java/org/apache/carbondata/core/scan/collector/impl/AbstractScannedResultCollector.java
@@ -106,7 +106,8 @@ public abstract class AbstractScannedResultCollector implements ScannedResultCol
             bigDecimalMsrValue =
                 bigDecimalMsrValue.setScale(carbonMeasure.getScale(), RoundingMode.HALF_UP);
           }
-          return org.apache.spark.sql.types.Decimal.apply(bigDecimalMsrValue);
+          return org.apache.spark.sql.types.Decimal
+              .apply(bigDecimalMsrValue, carbonMeasure.getPrecision(), carbonMeasure.getScale());
         default:
           return dataChunk.getMeasureDataHolder().getReadableDoubleValueByIndex(index);
       }


Mime
View raw message