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 rows.
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)
.