Am working on a project which uses HBase. Even though I formed the rowkey as good as possible, still in some scenarios I need to get the results in either ascending or descending order. Is there anything in HBase which is equivalent to "order by" operation in MySQL? Or is Order By on a specific column qualifier possible in HBase?
No; you need to read the data in the order it's sorted in the row key, then do your own sort (e.g. in java or whatever language you're using).
I know post is old but for future reference. Scan (Hbase 0.98+) now supports setReversed
public Scan setReversed(boolean reversed)
Set whether this scan is a reversed one
This is false by default which means forward(normal) scan.
Parameters:
reversed - if true, scan will be backward order
Returns:
Ref:- Hbase Scan Tutorial
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With