有什么方法可以限制Hbase中的列数 [英] Is there any way to limit the number of columns in Hbase

查看:138
本文介绍了有什么方法可以限制Hbase中的列数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法限制Hbase特定行下的列数?我看到了限制行的方法。我不知道是否有任何方法可以限制列家庭价值



像,



row  ;     columnfamily(page)     价值

1   页面:1                           1

b $ b 1         页面:2       ;             2 n
1      页:3                           3



我需要检索列家族页面的row1值:1和页面:2

是否可能?

解决方案

这是可能的。

当scan-ning使用 http://hbase.apache.org/apidocs/org/apache/hadoop/hbase/client/Scan.html#addColumn(byte [] ,byte [])



当get-ting使用
http://hbase.apache.org/apidocs/org/apache/hadoop/ hbase / client / Get.html#addColumn(byte [],byte [])



如果列键是可预测的,例如key是索引,然后基于特定值可以通过迭代来添加密钥。除此之外,如果条件可能是随机的和复杂的,例如> 1和< 3,键入(3,10,11)等。对于过滤器使用这个。有许多预先实施的过滤器。您可能会对限定符过滤器感兴趣。



希望这有助于。


Is there any way to limit the number of columns under a particular row in Hbase? I have seen methods to limit rows. I wonder if there is any ways i can limit column family values

Like,

row      columnfamily(page)      value
1          page:1                         1
1          page:2                         2
1          page:3                         3

I need to retrieve row1 values for column families page:1 and page:2
Is it possible?

解决方案

It is possible.

When scan-ning use http://hbase.apache.org/apidocs/org/apache/hadoop/hbase/client/Scan.html#addColumn(byte[], byte[])

When get-ting use http://hbase.apache.org/apidocs/org/apache/hadoop/hbase/client/Get.html#addColumn(byte[], byte[])

If the column key is predictable, for example, key is an index, then based on a particular value the keys could be added by iterating. Besides you could use filters as well if the conditioning could be random and complicated for example > 1 and < 3, key in (3, 10, 11) etc. For filter use this. There are host of pre-implemented filters. You would probably be interested in the qualifier filter.

Hope this helps.

这篇关于有什么方法可以限制Hbase中的列数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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