You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@phoenix.apache.org by "James Taylor (JIRA)" <ji...@apache.org> on 2015/12/21 19:23:46 UTC

[jira] [Updated] (PHOENIX-1223) Support VARBINARY declaration anywhere in the PK constraint

     [ https://issues.apache.org/jira/browse/PHOENIX-1223?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

James Taylor updated PHOENIX-1223:
----------------------------------
    Summary: Support VARBINARY declaration anywhere in the PK constraint  (was: Support VARBINARY ARRAY)

> Support VARBINARY declaration anywhere in the PK constraint
> -----------------------------------------------------------
>
>                 Key: PHOENIX-1223
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-1223
>             Project: Phoenix
>          Issue Type: Bug
>    Affects Versions: 4.1.0
>            Reporter: Jesse Yates
>
> When encoding arrays of byte[]s Phoenix doesn't correctly encode the null-byte (0x00). Phoenix sees that as the terminating character for the element, but when you do something like org.apache.hadoop.hbase.util.Bytes.asBytes(int) it creates a byte[4] and sets bytes from the right to the left (so 1 would be converted to [0,0,0,1]), and then phoenix will see the leading 0-byte as the terminator the element and just return a null element
> Instead, arrays of byte[]s need to include a length (probably prefix) so it knows how many bytes to read in. Its a bigger overhead than any other encoding type, but that may be the overhead if you want to do anything goes byte arrays. 



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)