You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@carbondata.apache.org by manishgupta88 <gi...@git.apache.org> on 2016/08/24 09:58:34 UTC

[GitHub] incubator-carbondata pull request #90: [CARBONDATA-175]Fix Bug: Load Decimal...

Github user manishgupta88 commented on a diff in the pull request:

    https://github.com/apache/incubator-carbondata/pull/90#discussion_r76028231
  
    --- Diff: core/src/main/java/org/apache/carbondata/core/util/DataTypeUtil.java ---
    @@ -62,7 +62,12 @@ public static Object getMeasureValueBasedOnDataType(String msrValue, DataType da
           case INT:
             return Double.valueOf(msrValue).longValue();
           case LONG:
    -        return Long.valueOf(msrValue);
    +        int index = msrValue.indexOf(".");
    +        if (index != -1) {
    +          return Long.valueOf(msrValue.substring(0,index));
    +        } else {
    +          return Long.valueOf(msrValue);
    +        }
    --- End diff --
    
    @lion-x ...keep the code same for INT and LONG datatype case...i think instead of writing this code, that would be better. Sample code as below
    case INT:
    case LONG:
      return Double.valueOf(msrValue).longValue();


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---