You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kylin.apache.org by li...@apache.org on 2015/03/21 01:28:47 UTC

[14/25] incubator-kylin git commit: KYLIN-640 fix sum of float bug

KYLIN-640 fix sum of float bug


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

Branch: refs/heads/master
Commit: 4f6869e1f1f6b2ed22e6d3b638a4048905d27e49
Parents: 0bc0f16
Author: honma <ho...@ebay.com>
Authored: Fri Mar 13 11:24:29 2015 -0700
Committer: honma <ho...@ebay.com>
Committed: Mon Mar 16 11:27:54 2015 -0700

----------------------------------------------------------------------
 storage/src/main/java/org/apache/kylin/storage/tuple/Tuple.java | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/4f6869e1/storage/src/main/java/org/apache/kylin/storage/tuple/Tuple.java
----------------------------------------------------------------------
diff --git a/storage/src/main/java/org/apache/kylin/storage/tuple/Tuple.java b/storage/src/main/java/org/apache/kylin/storage/tuple/Tuple.java
index dd19e0c..dd904d4 100644
--- a/storage/src/main/java/org/apache/kylin/storage/tuple/Tuple.java
+++ b/storage/src/main/java/org/apache/kylin/storage/tuple/Tuple.java
@@ -100,7 +100,10 @@ public class Tuple implements ITuple {
             fieldValue = ((BigDecimal) fieldValue).doubleValue();
         } else if ("integer".equals(dataType) && !(fieldValue instanceof Integer)) {
             fieldValue = ((Number) fieldValue).intValue();
+        } else if ("float".equals(dataType) && fieldValue instanceof BigDecimal) {
+            fieldValue = ((BigDecimal) fieldValue).floatValue();
         }
+
         setFieldObjectValue(fieldName, fieldValue);
     }
 
@@ -120,7 +123,6 @@ public class Tuple implements ITuple {
         return sb.toString();
     }
 
-
     public static Object convertOptiqCellValue(String strValue, String dataType) {
         if (strValue == null)
             return null;