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

2016-09-08 Thread lion-x
Github user lion-x closed the pull request at:

https://github.com/apache/incubator-carbondata/pull/90


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


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

2016-08-25 Thread manishgupta88
Github user manishgupta88 commented on a diff in the pull request:

https://github.com/apache/incubator-carbondata/pull/90#discussion_r76257293
  
--- 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 ...It is a correct behavior to return null value in this case as 
our validation is strict. If any column which has BigInt datatype is included 
as dimension then also we make decimal value as null because of strict 
validation. 
That is why I suggested that dont change the behavior for Long parsing, 
instead change the parsing logic for Int datatype to keep the strict validation 
behavior.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


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

2016-08-25 Thread lion-x
Github user lion-x commented on a diff in the pull request:

https://github.com/apache/incubator-carbondata/pull/90#discussion_r76195202
  
--- 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 --

@manishgupta88 Hi, in this PR, I want to solve the problem described as 
below:

when the Loding msrValue is decimal like "3.1415926" and the column type is 
Long, the original flow will not work well. It will return us a null value.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


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

2016-08-24 Thread manishgupta88
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---