Command like SQL LIMIT in HBase

前端 未结 5 1043
暗喜
暗喜 2021-01-31 13:55

Does HBase have any command that works like SQL LIMIT query?

I can do it by setStart and setEnd, but I do not want to iterate all

5条回答
  •  离开以前
    2021-01-31 14:35

    From the HBase shell you can use LIMIT:

    hbase> scan 'test-table', {'LIMIT' => 5}
    

    From the Java API you can use Scan.setMaxResultSize(N) or scan.setMaxResultsPerColumnFamily(N).

    • HBase API docs - Scan.setMaxResultSize
    • HBase API docs - Scan.setMaxResultsPerColumnFamily

提交回复
热议问题