Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Querying HBase Stargate for a hexadecimal rowkey via Ruby

I have an HBase table that (in part) utilizes hexadecimal bytes to construct its rowkeys. I'm able to query from the Hbase Shell just fine as follows

get 'my_table', "XYZ:\x7F\xFF\xFF\xFF\xFF\xFF\xFF\x82"

However, I want to use the stargate API (or one of the many ruby gems that serve as a wrapper) to query hbase remotely.

If I run the exact same query above, I get a 404 not found. Note that the : and \ characters are URL-encoded.

curl "http://myHbaseServer.domain:8080/my_table/XYZ%3A%5Cx7F%5CxFF%5CxFF%5CxFF%5CxFF%5CxFF%5CxFF%5Cx82/content:raw"
=> 404 Not Found

I know this format is correct as it returns a table list when I simply call the / endpoint. It's also not throwing a connectivity error. Any thoughts on whether these characters are being properly escaped?

Thanks!

like image 711
user2490003 Avatar asked Nov 11 '22 05:11

user2490003


1 Answers

\x do not need to be encoded, this is just a convention used by HBase to represent a non-ASCII byte value. \x7F should be converted to %7F in URL

like image 134
kostya Avatar answered Nov 15 '22 07:11

kostya