Sorted results from hbase scanner

2019-02-25 03:56发布

How to retrieve hbase column family "values" in any sorted order of the same?

like
column family      value
---------------------------------
        column:1               1
        column:3               2
        column:4               3
        column:2               4

标签: hadoop hbase
1条回答
乱世女痞
2楼-- · 2019-02-25 04:20

HBase itself won't do that, instead you could retrieve the list of KeyValues using the Result.raw[1] method, put that in a List and sort it by passing your own comparator to Collections.sort[2].

  1. http://hbase.apache.org/apidocs/org/apache/hadoop/hbase/client/Result.html#raw()
  2. http://download.oracle.com/javase/6/docs/api/java/util/Collections.html#sort(java.util.List, java.util.Comparator)
查看更多
登录 后发表回答