sundeepa
sundeepa

Reputation: 55

How do I retrieve multiple rows from HBase using suffix glob, from a REST client?

I have the following rows in a HBase table called test

ROW COLUMN+CELL row1 column=cf:a, timestamp=1429204170712, value=value1 row2 column=cf:b, timestamp=1429204196225, value=value2 row3 column=cf:c, timestamp=1429204213427, value=value3

I am trying to retrieve all the rows with rowkey matching prefix row using Suffix Globbing, as mentioned here

But why do I get Bad request when I try http://localhost:8080/test/row* where localhost:8080 is where the HBase REST server Stargate is listening, test is the table and row is a partial rowkey. I executed it in a browser and in a REST client Poster (Firefox plugin). Executing the URL http://localhost:8080/test/row*/cf gives the response value1 but I would like to retrieve the values in all the rows with rowkey matching prefix row.

I am running HBase 0.94.26, Stargate (came bundled with HBase), Hadoop 1.2.1, Ubuntu 12.04 virtual machine.

Is it possible to retrieve all the rows programmatically atleast?

Upvotes: 1

Views: 1689

Answers (1)

prashant thakre
prashant thakre

Reputation: 5147

As per the doc REST works fine for retrieving all the rows. However you need to just modify the URL accordingly. As per my opinion try the below comination on of them should work, Please note that that I have not yet tested.

http://localhost:8080/test/row*

http://localhost:8080/test/row

Suffix Globbing

Multiple value queries of a row can optionally append a suffix glob on the row key. This is a restricted form of scanner which will return all values in all rows that have keys which contain the supplied key on their left hand side, for example:

org.someorg.*
    -> org.someorg.blog
    -> org.someorg.home
    -> org.someorg.www

Upvotes: 1

Related Questions