HBase 中的 SQL LIMIT 等命令 [英] Command like SQL LIMIT in HBase
本文介绍了HBase 中的 SQL LIMIT 等命令的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
HBase 有没有类似 SQL LIMIT
查询的命令?
Does HBase have any command that works like SQL LIMIT
query?
我可以通过 setStart
和 setEnd
来完成,但我不想迭代所有行.
I can do it by setStart
and setEnd
, but I do not want to iterate all rows.
推荐答案
从 HBase shell 你可以使用 LIMIT:
From the HBase shell you can use LIMIT:
hbase> scan 'test-table', {'LIMIT' => 5}
在 Java API 中,您可以使用 Scan.setMaxResultSize(N)
或 scan.setMaxResultsPerColumnFamily(N)
.
From the Java API you can use Scan.setMaxResultSize(N)
or scan.setMaxResultsPerColumnFamily(N)
.
这篇关于HBase 中的 SQL LIMIT 等命令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文