You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@carbondata.apache.org by Zhangshunyu <gi...@git.apache.org> on 2016/08/31 01:42:30 UTC

[GitHub] incubator-carbondata pull request #110: [wip][CARBONDATA-193]Fix the bug tha...

GitHub user Zhangshunyu opened a pull request:

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

    [wip][CARBONDATA-193]Fix the bug that negative data compress is not properly when datatype is Double

    ## Why raise this pr?
    **Fix bug: negative data compress is not properly when datatype is Double.**
    For example, If the column datatype is double and it data is like this:
    -7489.7976
    -11234567490
    -11234567490
    -1.2
    -2
    -11234567490
    -11234567490
    -11234567490
    -11234567490
    **the query result would be all 0, this is a bug.**
    ## How to solve?
    This bug is becasue we only consider the MAX value of this column is +values, and conpare it wll Byte.MAXCVALUE, here is 127. But when the values is -12343554634645, it also < Byte.MAXVALUE, but we can not use byte, becasue it < -127, so we should consider both Byte.MAXVALUE and Byte.MINVALUE, the same to other datatype.
    How to test?
    Added test case: test("When the values of Double datatype are negative values"), should pass all the exist cases and this new testcase.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/Zhangshunyu/incubator-carbondata double92

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/incubator-carbondata/pull/110.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #110
    
----
commit 5773928ff7c7867a1925ce258fb2b57bc49513b6
Author: Zhangshunyu <zh...@huawei.com>
Date:   2016-08-31T01:34:12Z

    Fix the bug that negtive data compress is not properly when datatype is Double

----


---
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.
---

[GitHub] incubator-carbondata pull request #110: [CARBONDATA-193]Fix the bug that neg...

Posted by Zhangshunyu <gi...@git.apache.org>.
Github user Zhangshunyu commented on a diff in the pull request:

    https://github.com/apache/incubator-carbondata/pull/110#discussion_r76929947
  
    --- Diff: core/src/main/java/org/apache/carbondata/core/util/ValueCompressionUtil.java ---
    @@ -78,26 +78,26 @@ private ValueCompressionUtil() {
       private static DataType getDataType(double value, int decimal, byte dataTypeSelected) {
         DataType dataType = DataType.DATA_DOUBLE;
         if (decimal == 0) {
    -      if (value < Byte.MAX_VALUE) {
    +      if (value < Byte.MAX_VALUE && value > Byte.MIN_VALUE) {
    --- End diff --
    
    Before i modified to use new "absMaxValue", it is needed, but now i can detele this code. 


---
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.
---

[GitHub] incubator-carbondata pull request #110: [CARBONDATA-193]Fix the bug that neg...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

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


---
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.
---

[GitHub] incubator-carbondata pull request #110: [CARBONDATA-193]Fix the bug that neg...

Posted by Vimal-Das <gi...@git.apache.org>.
Github user Vimal-Das commented on a diff in the pull request:

    https://github.com/apache/incubator-carbondata/pull/110#discussion_r76929816
  
    --- Diff: core/src/main/java/org/apache/carbondata/core/util/ValueCompressionUtil.java ---
    @@ -78,26 +78,26 @@ private ValueCompressionUtil() {
       private static DataType getDataType(double value, int decimal, byte dataTypeSelected) {
         DataType dataType = DataType.DATA_DOUBLE;
         if (decimal == 0) {
    -      if (value < Byte.MAX_VALUE) {
    +      if (value < Byte.MAX_VALUE && value > Byte.MIN_VALUE) {
    --- End diff --
    
    should we change to value <= Byte.MAX_VALUE && value >= Byte.MIN_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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---