问题描述
我正在设计一个应用程序以在hbase上运行,并且想要交互式地探索我的群集的内容。我在hbase shell中,并且想要执行从字符abc开始的所有密钥的扫描。这样的密钥可能包括abc4,abc92,abc20014等等......我试过一次扫描
hbase(main ):003:0>扫描'mytable',{STARTROW => 'abc',ENDROW => 'abc'}
但是这似乎没有返回任何东西,因为在技术上没有rowkeyabc只有以abc开头的rowkeys
我想要的是类似于
HBase的(主):003:0>扫描'mytable',{STARTSROWPREFIX => 'abc',ENDROWPREFIX => 'abc'}
我听说HBase能够快速完成这项任务,并且是其主要卖点之一。如何在hbase shell中执行此操作?
在此先感谢。
scan'mytable',{STARTROW => 'abc',ENDROW => 'abd'}
I am designing an app to run on hbase and want to interactively explore the contents of my cluster. I am in the hbase shell and I want to perform a scan of all keys starting with the chars "abc". Such keys might inlcude "abc4", "abc92", "abc20014" etc... I tried a scan
hbase(main):003:0> scan 'mytable', {STARTROW => 'abc', ENDROW => 'abc'}
But this does not seem to return anything since there is technically no rowkey "abc" only rowkeys starting with "abc"
What I want is something like
hbase(main):003:0> scan 'mytable', {STARTSROWPREFIX => 'abc', ENDROWPREFIX => 'abc'}
I hear HBase can do this quickly and is one of its main selling points. How do I do this in the hbase shell?
Thanks in advance.
So it turns out to be very easy. The scan ranges are not inclusive, the logic is start <= key < end. So the answer is
scan 'mytable', {STARTROW => 'abc', ENDROW => 'abd'}
这篇关于HBase(Easy):如何在hbase shell中执行范围前缀扫描的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!