Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I specify a row key in hbase shell that has a tab in it?

In our infinite wisdom, we decided our rows would be keyed with a tab in the middle:

item_id <tab> location

For example:

000001  http://www.url.com/page

Using Hbase Shell, we cannot perform a get command because the tab character doesn't get written properly in the input line. We tried

get 'tableName', '000001\thttp://www.url.com/page'

without success. What should we do?

like image 426
whiterook6 Avatar asked Apr 04 '12 21:04

whiterook6


1 Answers

I had the same issue for binary values: \x00. This was my separator.

For the shell to accept your binary values, you need to provide them in double quote (") instead of single quote (').

put 'MyTable', "MyKey", 'Family:Qualifier', "\x00\x00\x00\x00\x00\x00\x00\x06Hello from shell"

Check how your tab is being encoded, my best bet would be that it is UTF8 encoded so from the ASCII table, this would be "000001\x09http://www.url.com/page".

On a side note, you should use null character for your separator, it will help you in scan.

like image 118
Pierre-Luc Bertrand Avatar answered Sep 24 '22 21:09

Pierre-Luc Bertrand