[
https://issues.apache.org/jira/browse/HBASE-7621?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15421936#comment-15421936
]
Keith David Winkler edited comment on HBASE-7621 at 8/16/16 12:17 AM:
----------------------------------------------------------------------
A more concise and complete description of the problem I hope:
org.apache.hadoop.hbase.util.Bytes.toStringBinary does not work for encoding
row keys in URLs for two reasons.
(1) It escapes characters with a backslash x instead of % (\x02 instead of %02)
and backslash is NOT a valid URL character.
(2) It escapes a SUBSET of the characters which must be escaped. For example
it does not escape "|", which is not a valid URL character and must be escaped.
This problem makes RemoteHTable unusable for tables with arbitrary binary keys.
Users cannot do the URI escape before calling RemoteHTable methods in all
cases because, in the put methods, for example, the passed row key
(pre-escaped) is also added to the request body, where it should NOT be
escaped.
was (Author: kdwinkler):
A more concise and complete description of the problem I hope:
org.apache.hadoop.hbase.util.Bytes.toStringBinary does not work for encoding
row keys in URLs for two reasons.
(1) It escapes characters with a backslash x instead of % (\x02 instead of %02)
and backslash is NOT a valid URL character.
(2) It escapes a SUBSET of the characters which must be escaped. For example
it does not escape "|", which is not a valid URL character and must be escaped.
This problem makes RemoteHTable generally unusable for tables with arbitrary
binary keys. Users cannot do the URI escape before calling RemoteHTable
methods in all cases because, in the put methods, for example, the passed row
key (pre-escaped) is also added to the request body, where it should NOT be
escaped.
> REST server doesn't support binary row keys
> -------------------------------------------
>
> Key: HBASE-7621
> URL: https://issues.apache.org/jira/browse/HBASE-7621
> Project: HBase
> Issue Type: Bug
> Components: REST
> Affects Versions: 0.94.0, 0.95.2, 0.98.4
> Reporter: Craig Muchinsky
>
> The REST server doesn't seem to support using binary (MD5 for example) row
> keys. I believe the root cause of this is the use of Bytes.toBytes() in the
> RowSpec.parseRowKeys() method. Based on the use of Bytes.toStringBinary()
> within RemoteHTable.buildRowSpec(), I believe the converse function
> Bytes.toBytesBinary() should be used for row key parsing in
> RowSpec.parseRowKeys().
> I also noticed that the RemoteHTable.buildRowSpec() method isn't URL encoding
> the row key, which is a mismatch to the logic in RowSpec.parseRowKeys() which
> performs URL decoding for both the start and stop row keys.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)