You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hbase.apache.org by "Bryan Keller (Created) (JIRA)" <ji...@apache.org> on 2011/10/23 11:54:32 UTC

[jira] [Created] (HBASE-4648) Bytes.toBigDecimal() doesn't use offset

Bytes.toBigDecimal() doesn't use offset
---------------------------------------

                 Key: HBASE-4648
                 URL: https://issues.apache.org/jira/browse/HBASE-4648
             Project: HBase
          Issue Type: Bug
          Components: util
    Affects Versions: 0.90.4
         Environment: Java 1.6.0_26, Mac OS X 10.7 and CentOS 6
            Reporter: Bryan Keller


The Bytes.toBigDecimal(byte[], offset, len) method does not use the offset, thus you will get an incorrect result for the BigDecimal unless the BigDecimal's bytes are at the beginning of the byte array.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (HBASE-4648) Bytes.toBigDecimal() doesn't use offset

Posted by "stack (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HBASE-4648?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13136322#comment-13136322 ] 

stack commented on HBASE-4648:
------------------------------

+1 on patch and +1 on 0.92 and TRUNK only. 
                
> Bytes.toBigDecimal() doesn't use offset
> ---------------------------------------
>
>                 Key: HBASE-4648
>                 URL: https://issues.apache.org/jira/browse/HBASE-4648
>             Project: HBase
>          Issue Type: Bug
>          Components: util
>    Affects Versions: 0.90.4
>         Environment: Java 1.6.0_26, Mac OS X 10.7 and CentOS 6
>            Reporter: Bryan Keller
>             Fix For: 0.92.0, 0.94.0
>
>         Attachments: bigdec.patch, bigdec2.patch
>
>
> The Bytes.toBigDecimal(byte[], offset, len) method does not use the offset, thus you will get an incorrect result for the BigDecimal unless the BigDecimal's bytes are at the beginning of the byte array.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Resolved] (HBASE-4648) Bytes.toBigDecimal() doesn't use offset

Posted by "Lars Hofhansl (Resolved) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HBASE-4648?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Lars Hofhansl resolved HBASE-4648.
----------------------------------

       Resolution: Fixed
    Fix Version/s: 0.94.0
                   0.92.0

Committed to 0.92 and trunk. Since this is a (slightly) incompatible change I did not commit it to 0.90... Open again if you feel otherwise.
                
> Bytes.toBigDecimal() doesn't use offset
> ---------------------------------------
>
>                 Key: HBASE-4648
>                 URL: https://issues.apache.org/jira/browse/HBASE-4648
>             Project: HBase
>          Issue Type: Bug
>          Components: util
>    Affects Versions: 0.90.4
>         Environment: Java 1.6.0_26, Mac OS X 10.7 and CentOS 6
>            Reporter: Bryan Keller
>             Fix For: 0.92.0, 0.94.0
>
>         Attachments: bigdec.patch, bigdec2.patch
>
>
> The Bytes.toBigDecimal(byte[], offset, len) method does not use the offset, thus you will get an incorrect result for the BigDecimal unless the BigDecimal's bytes are at the beginning of the byte array.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (HBASE-4648) Bytes.toBigDecimal() doesn't use offset

Posted by "Lars Hofhansl (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HBASE-4648?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13135371#comment-13135371 ] 

Lars Hofhansl commented on HBASE-4648:
--------------------------------------

Patch looks good to me.
I'm find applying to 0.90, 0.92, and trunk. Nobody should use toBigDecimal(byte[], int).

If nobody objects I'll commit this later today.
                
> Bytes.toBigDecimal() doesn't use offset
> ---------------------------------------
>
>                 Key: HBASE-4648
>                 URL: https://issues.apache.org/jira/browse/HBASE-4648
>             Project: HBase
>          Issue Type: Bug
>          Components: util
>    Affects Versions: 0.90.4
>         Environment: Java 1.6.0_26, Mac OS X 10.7 and CentOS 6
>            Reporter: Bryan Keller
>         Attachments: bigdec.patch, bigdec2.patch
>
>
> The Bytes.toBigDecimal(byte[], offset, len) method does not use the offset, thus you will get an incorrect result for the BigDecimal unless the BigDecimal's bytes are at the beginning of the byte array.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (HBASE-4648) Bytes.toBigDecimal() doesn't use offset

Posted by "Hudson (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HBASE-4648?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13136315#comment-13136315 ] 

Hudson commented on HBASE-4648:
-------------------------------

Integrated in HBase-0.92 #82 (See [https://builds.apache.org/job/HBase-0.92/82/])
    HBASE-4648  Bytes.toBigDecimal() doesn't use offset

larsh : 
Files : 
* /hbase/branches/0.92/CHANGES.txt
* /hbase/branches/0.92/src/main/java/org/apache/hadoop/hbase/util/Bytes.java
* /hbase/branches/0.92/src/test/java/org/apache/hadoop/hbase/util/TestBytes.java

                
> Bytes.toBigDecimal() doesn't use offset
> ---------------------------------------
>
>                 Key: HBASE-4648
>                 URL: https://issues.apache.org/jira/browse/HBASE-4648
>             Project: HBase
>          Issue Type: Bug
>          Components: util
>    Affects Versions: 0.90.4
>         Environment: Java 1.6.0_26, Mac OS X 10.7 and CentOS 6
>            Reporter: Bryan Keller
>             Fix For: 0.92.0, 0.94.0
>
>         Attachments: bigdec.patch, bigdec2.patch
>
>
> The Bytes.toBigDecimal(byte[], offset, len) method does not use the offset, thus you will get an incorrect result for the BigDecimal unless the BigDecimal's bytes are at the beginning of the byte array.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (HBASE-4648) Bytes.toBigDecimal() doesn't use offset

Posted by "Bryan Keller (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HBASE-4648?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13134628#comment-13134628 ] 

Bryan Keller commented on HBASE-4648:
-------------------------------------

I was actually thinking that method isn't useful, it seems it should be removed, as the BigDecimal serialization is variable-length. It would only be used if the BigDecimal comes at the end of the byte array.
                
> Bytes.toBigDecimal() doesn't use offset
> ---------------------------------------
>
>                 Key: HBASE-4648
>                 URL: https://issues.apache.org/jira/browse/HBASE-4648
>             Project: HBase
>          Issue Type: Bug
>          Components: util
>    Affects Versions: 0.90.4
>         Environment: Java 1.6.0_26, Mac OS X 10.7 and CentOS 6
>            Reporter: Bryan Keller
>
> The Bytes.toBigDecimal(byte[], offset, len) method does not use the offset, thus you will get an incorrect result for the BigDecimal unless the BigDecimal's bytes are at the beginning of the byte array.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (HBASE-4648) Bytes.toBigDecimal() doesn't use offset

Posted by "Lars Hofhansl (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HBASE-4648?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13134625#comment-13134625 ] 

Lars Hofhansl commented on HBASE-4648:
--------------------------------------

This:
{code}
  public static BigDecimal toBigDecimal(byte[] bytes, int offset) {
    return toBigDecimal(bytes, offset, bytes.length);
  }
{code}

Is also wrong. Should be:
{code}
    return toBigDecimal(bytes, offset, bytes.length-offset);
{code}

                
> Bytes.toBigDecimal() doesn't use offset
> ---------------------------------------
>
>                 Key: HBASE-4648
>                 URL: https://issues.apache.org/jira/browse/HBASE-4648
>             Project: HBase
>          Issue Type: Bug
>          Components: util
>    Affects Versions: 0.90.4
>         Environment: Java 1.6.0_26, Mac OS X 10.7 and CentOS 6
>            Reporter: Bryan Keller
>
> The Bytes.toBigDecimal(byte[], offset, len) method does not use the offset, thus you will get an incorrect result for the BigDecimal unless the BigDecimal's bytes are at the beginning of the byte array.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (HBASE-4648) Bytes.toBigDecimal() doesn't use offset

Posted by "Lars Hofhansl (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HBASE-4648?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Lars Hofhansl updated HBASE-4648:
---------------------------------

    Hadoop Flags: Incompatible change,Reviewed
    
> Bytes.toBigDecimal() doesn't use offset
> ---------------------------------------
>
>                 Key: HBASE-4648
>                 URL: https://issues.apache.org/jira/browse/HBASE-4648
>             Project: HBase
>          Issue Type: Bug
>          Components: util
>    Affects Versions: 0.90.4
>         Environment: Java 1.6.0_26, Mac OS X 10.7 and CentOS 6
>            Reporter: Bryan Keller
>         Attachments: bigdec.patch, bigdec2.patch
>
>
> The Bytes.toBigDecimal(byte[], offset, len) method does not use the offset, thus you will get an incorrect result for the BigDecimal unless the BigDecimal's bytes are at the beginning of the byte array.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (HBASE-4648) Bytes.toBigDecimal() doesn't use offset

Posted by "Bryan Keller (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HBASE-4648?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13134386#comment-13134386 ] 

Bryan Keller commented on HBASE-4648:
-------------------------------------

I'll upload the patch a little later today, sorry for the delay.
                
> Bytes.toBigDecimal() doesn't use offset
> ---------------------------------------
>
>                 Key: HBASE-4648
>                 URL: https://issues.apache.org/jira/browse/HBASE-4648
>             Project: HBase
>          Issue Type: Bug
>          Components: util
>    Affects Versions: 0.90.4
>         Environment: Java 1.6.0_26, Mac OS X 10.7 and CentOS 6
>            Reporter: Bryan Keller
>
> The Bytes.toBigDecimal(byte[], offset, len) method does not use the offset, thus you will get an incorrect result for the BigDecimal unless the BigDecimal's bytes are at the beginning of the byte array.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (HBASE-4648) Bytes.toBigDecimal() doesn't use offset

Posted by "Bryan Keller (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HBASE-4648?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Bryan Keller updated HBASE-4648:
--------------------------------

    Attachment: bigdec2.patch

Sorry bad patch, here's a new one.
                
> Bytes.toBigDecimal() doesn't use offset
> ---------------------------------------
>
>                 Key: HBASE-4648
>                 URL: https://issues.apache.org/jira/browse/HBASE-4648
>             Project: HBase
>          Issue Type: Bug
>          Components: util
>    Affects Versions: 0.90.4
>         Environment: Java 1.6.0_26, Mac OS X 10.7 and CentOS 6
>            Reporter: Bryan Keller
>         Attachments: bigdec.patch, bigdec2.patch
>
>
> The Bytes.toBigDecimal(byte[], offset, len) method does not use the offset, thus you will get an incorrect result for the BigDecimal unless the BigDecimal's bytes are at the beginning of the byte array.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (HBASE-4648) Bytes.toBigDecimal() doesn't use offset

Posted by "Lars Hofhansl (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HBASE-4648?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13136176#comment-13136176 ] 

Lars Hofhansl commented on HBASE-4648:
--------------------------------------

Thanks for the patch Bryan. (and I just realized I misspelled your name in the commit log)
                
> Bytes.toBigDecimal() doesn't use offset
> ---------------------------------------
>
>                 Key: HBASE-4648
>                 URL: https://issues.apache.org/jira/browse/HBASE-4648
>             Project: HBase
>          Issue Type: Bug
>          Components: util
>    Affects Versions: 0.90.4
>         Environment: Java 1.6.0_26, Mac OS X 10.7 and CentOS 6
>            Reporter: Bryan Keller
>             Fix For: 0.92.0, 0.94.0
>
>         Attachments: bigdec.patch, bigdec2.patch
>
>
> The Bytes.toBigDecimal(byte[], offset, len) method does not use the offset, thus you will get an incorrect result for the BigDecimal unless the BigDecimal's bytes are at the beginning of the byte array.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Issue Comment Edited] (HBASE-4648) Bytes.toBigDecimal() doesn't use offset

Posted by "Lars Hofhansl (Issue Comment Edited) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HBASE-4648?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13135371#comment-13135371 ] 

Lars Hofhansl edited comment on HBASE-4648 at 10/25/11 7:56 PM:
----------------------------------------------------------------

Patch looks good to me.
I'm fine applying to 0.90, 0.92, and trunk. Nobody should use toBigDecimal(byte[], int).

If nobody objects I'll commit this later today.
                
      was (Author: lhofhansl):
    Patch looks good to me.
I'm find applying to 0.90, 0.92, and trunk. Nobody should use toBigDecimal(byte[], int).

If nobody objects I'll commit this later today.
                  
> Bytes.toBigDecimal() doesn't use offset
> ---------------------------------------
>
>                 Key: HBASE-4648
>                 URL: https://issues.apache.org/jira/browse/HBASE-4648
>             Project: HBase
>          Issue Type: Bug
>          Components: util
>    Affects Versions: 0.90.4
>         Environment: Java 1.6.0_26, Mac OS X 10.7 and CentOS 6
>            Reporter: Bryan Keller
>         Attachments: bigdec.patch, bigdec2.patch
>
>
> The Bytes.toBigDecimal(byte[], offset, len) method does not use the offset, thus you will get an incorrect result for the BigDecimal unless the BigDecimal's bytes are at the beginning of the byte array.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (HBASE-4648) Bytes.toBigDecimal() doesn't use offset

Posted by "Hudson (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HBASE-4648?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13136504#comment-13136504 ] 

Hudson commented on HBASE-4648:
-------------------------------

Integrated in HBase-TRUNK #2371 (See [https://builds.apache.org/job/HBase-TRUNK/2371/])
    HBASE-4648  Bytes.toBigDecimal() doesn't use offset

larsh : 
Files : 
* /hbase/trunk/CHANGES.txt
* /hbase/trunk/src/main/java/org/apache/hadoop/hbase/util/Bytes.java
* /hbase/trunk/src/test/java/org/apache/hadoop/hbase/util/TestBytes.java

                
> Bytes.toBigDecimal() doesn't use offset
> ---------------------------------------
>
>                 Key: HBASE-4648
>                 URL: https://issues.apache.org/jira/browse/HBASE-4648
>             Project: HBase
>          Issue Type: Bug
>          Components: util
>    Affects Versions: 0.90.4
>         Environment: Java 1.6.0_26, Mac OS X 10.7 and CentOS 6
>            Reporter: Bryan Keller
>             Fix For: 0.92.0, 0.94.0
>
>         Attachments: bigdec.patch, bigdec2.patch
>
>
> The Bytes.toBigDecimal(byte[], offset, len) method does not use the offset, thus you will get an incorrect result for the BigDecimal unless the BigDecimal's bytes are at the beginning of the byte array.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (HBASE-4648) Bytes.toBigDecimal() doesn't use offset

Posted by "Lars Hofhansl (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HBASE-4648?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13134336#comment-13134336 ] 

Lars Hofhansl commented on HBASE-4648:
--------------------------------------

Whoa... Good find Bryan.
                
> Bytes.toBigDecimal() doesn't use offset
> ---------------------------------------
>
>                 Key: HBASE-4648
>                 URL: https://issues.apache.org/jira/browse/HBASE-4648
>             Project: HBase
>          Issue Type: Bug
>          Components: util
>    Affects Versions: 0.90.4
>         Environment: Java 1.6.0_26, Mac OS X 10.7 and CentOS 6
>            Reporter: Bryan Keller
>
> The Bytes.toBigDecimal(byte[], offset, len) method does not use the offset, thus you will get an incorrect result for the BigDecimal unless the BigDecimal's bytes are at the beginning of the byte array.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (HBASE-4648) Bytes.toBigDecimal() doesn't use offset

Posted by "Bryan Keller (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HBASE-4648?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Bryan Keller updated HBASE-4648:
--------------------------------

    Attachment: bigdec.patch

Here is the patch. I also added some tests for testing serialization with offsets for other data types.
                
> Bytes.toBigDecimal() doesn't use offset
> ---------------------------------------
>
>                 Key: HBASE-4648
>                 URL: https://issues.apache.org/jira/browse/HBASE-4648
>             Project: HBase
>          Issue Type: Bug
>          Components: util
>    Affects Versions: 0.90.4
>         Environment: Java 1.6.0_26, Mac OS X 10.7 and CentOS 6
>            Reporter: Bryan Keller
>         Attachments: bigdec.patch
>
>
> The Bytes.toBigDecimal(byte[], offset, len) method does not use the offset, thus you will get an incorrect result for the BigDecimal unless the BigDecimal's bytes are at the beginning of the byte array.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (HBASE-4648) Bytes.toBigDecimal() doesn't use offset

Posted by "stack (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HBASE-4648?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13134179#comment-13134179 ] 

stack commented on HBASE-4648:
------------------------------

You have a patch please Bryan?
                
> Bytes.toBigDecimal() doesn't use offset
> ---------------------------------------
>
>                 Key: HBASE-4648
>                 URL: https://issues.apache.org/jira/browse/HBASE-4648
>             Project: HBase
>          Issue Type: Bug
>          Components: util
>    Affects Versions: 0.90.4
>         Environment: Java 1.6.0_26, Mac OS X 10.7 and CentOS 6
>            Reporter: Bryan Keller
>
> The Bytes.toBigDecimal(byte[], offset, len) method does not use the offset, thus you will get an incorrect result for the BigDecimal unless the BigDecimal's bytes are at the beginning of the byte array.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira