开发者

Sorted results from hbase scanner

开发者 https://www.devze.com 2023-02-16 04:55 出处:网络
How to retrieve hbase column 开发者_运维百科family \"values\" in any sorted order of the same?

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


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)
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号