You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@kylin.apache.org by GitBox <gi...@apache.org> on 2018/06/20 02:53:03 UTC

[GitHub] shaofengshi closed pull request #136: KYLIN-3349 : Spark Numberformat Exception solved

shaofengshi closed pull request #136: KYLIN-3349 : Spark Numberformat Exception solved
URL: https://github.com/apache/kylin/pull/136
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/core-metadata/src/main/java/org/apache/kylin/measure/basic/DoubleIngester.java b/core-metadata/src/main/java/org/apache/kylin/measure/basic/DoubleIngester.java
index 90ecb0d583..3707fdcc5d 100644
--- a/core-metadata/src/main/java/org/apache/kylin/measure/basic/DoubleIngester.java
+++ b/core-metadata/src/main/java/org/apache/kylin/measure/basic/DoubleIngester.java
@@ -18,6 +18,7 @@
 
 package org.apache.kylin.measure.basic;
 
+import java.math.BigDecimal;
 import java.util.Map;
 
 import org.apache.kylin.common.util.Dictionary;
@@ -35,7 +36,7 @@ public Double valueOf(String[] values, MeasureDesc measureDesc, Map<TblColRef, D
         if (values[0] == null || values[0].length() == 0)
             return new Double(0);
         else
-            return Double.parseDouble(values[0]);
+            return new BigDecimal(values[0]).doubleValue();
     }
 
     @Override
diff --git a/core-metadata/src/main/java/org/apache/kylin/measure/basic/LongIngester.java b/core-metadata/src/main/java/org/apache/kylin/measure/basic/LongIngester.java
index 793acf2f78..990adfa373 100644
--- a/core-metadata/src/main/java/org/apache/kylin/measure/basic/LongIngester.java
+++ b/core-metadata/src/main/java/org/apache/kylin/measure/basic/LongIngester.java
@@ -18,6 +18,7 @@
 
 package org.apache.kylin.measure.basic;
 
+import java.math.BigDecimal;
 import java.util.Map;
 
 import org.apache.kylin.common.util.Dictionary;
@@ -35,7 +36,7 @@ public Long valueOf(String[] values, MeasureDesc measureDesc, Map<TblColRef, Dic
         if (values[0] == null || values[0].length() == 0)
             return new Long(0L);
         else
-            return Long.valueOf(values[0]);
+            return new BigDecimal(values[0]).longValue();
     }
 
     @Override


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services