You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@phoenix.apache.org by "Jesse Yates (JIRA)" <ji...@apache.org> on 2014/08/30 03:05:52 UTC
[jira] [Created] (PHOENIX-1223) arrays of byte[]s don't encode for
null bytes
Jesse Yates created PHOENIX-1223:
------------------------------------
Summary: arrays of byte[]s don't encode for null bytes
Key: PHOENIX-1223
URL: https://issues.apache.org/jira/browse/PHOENIX-1223
Project: Phoenix
Issue Type: Bug
Affects Versions: 5.0.0, 4.1
Reporter: Jesse Yates
Fix For: 5.0.0, 4.2
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.2#6252)