Search code examples
phphadoophbasethrift

HBase - How to query based on key-timestamp-id?


All-

New to HBase and I've finally been able to actually take data I was once storing in MySQL (about 50 million rows) and insert it into my HBase table.

I'm now trying to query this data based on the keys and am running into some problems.

Basically I have a key that is constructed like:

objectname-createdtime-customerid

Now I need to query based on the objectname and a range for the createdtime, does anyone know how I can do this? (I'm using PHP/Thrift, but I don't need it to be a specific answer to this)

I can query if I know the exact row/key, I just need to know how to specify a range now for the middle property.

Thanks in advance!


Solution

  • Use a scan where the start row is the one with key objectname-<min created time>-customerid and the stop row has key objectname-<max created time>-customerid.

    http://wiki.apache.org/hadoop/Hbase/ThriftApi#Scanner_methods