HBase(Easy):如何在hbase shell中执行范围前缀扫描 [英] HBase (Easy): How to Perform Range Prefix Scan in hbase shell

查看:1607
本文介绍了HBase(Easy):如何在hbase shell中执行范围前缀扫描的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在设计一个应用程序以在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中执行范围前缀扫描的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆