hbase scan中匪夷所思的SingleColumnValueFilter和COLUMNS
只有当COLUMNS中包含SingleColumnValueFilter提到的字段时, 该SingleColumnValueFilter才有效的
HBase JIRA中有人对这种匪夷所思的行为产生的质疑
只有当COLUMNS中包含SingleColumnValueFilter提到的字段时, 该SingleColumnValueFilter才有效的
Wheneverapplying a SingleColumnValueFilter to a Scan that has specific columns as it'sinput (but not the column to be checked in the Filter), the Filter won't beable to find the value that it should be checking.
Forexample, let's say we want to do a scan, but we only need COLUMN_2 columns.Furthermore, we only want rows that have a specific value for COLUMN_1. Usingthe following code won't do the trick:
Scan scan = new Scan();
scan.addColumn(FAMILY,COLUMN_2);
SingleColumnValueFilter filter = new SingleColumnValueFilter(FAMILY, COLUMN_1,CompareOp.EQUAL, TEST_VALUE);
filter.setFilterIfMissing(true);
scan.setFilter(filter);
However,we can make it work when specifically also adding the tested column as an inputcolumn:
scan.addColumn(FAMILY,COLUMN_1);
Is this by design?Personally I think that adding a filter with columns tests should not botherthe user to check that it's also on the input. It is prone to bugs.
有人回复说:
Itsby design. High-level in the Scan object you say what you are interested in andthen the filter works against the Scan specification.
作者修改了SingleColumnValueFilter.java的doc注释
Whenusing this filter on a Scan with specified inputs, the column to be testedshould also be added as input (otherwise the filter will regard the column asmissing).
于是作者写了一个新的SingleColumnValueExcludeFilter,用于做单列的值过滤, 但是不查询出这个列的值
Add a new Filter thatchecks a single column value but does not emit it.
A Filter that checks a single column value,but does not emit the tested column. This will enable a performance boost overSingleColumnValueFilter, if the tested column value is not actually needed asinput (besides for the filtering itself).

低调大师中文资讯倾力打造互联网数据资讯、行业资源、电子商务、移动互联网、网络营销平台。
持续更新报道IT业界、互联网、市场资讯、驱动更新,是最及时权威的产业资讯及硬件资讯报道平台。
转载内容版权归作者及来源网站所有,本站原创内容转载请注明来源。
- 上一篇
Hadoop安装配置手册
Hadoop安装配置手册 一、 准备篇 Hadoop运行环境: SSH服务正常运行 JDK 没安装的可以自己安装一下。 二、 基础篇(单节点Hadoop) Hadoop下载 Hadoop下载页:http://hadoop.apache.org/releases.html#Download 本文基于hadoop1.0.4版本,下载:http://labs.mop.com/apache-mirror/hadoop/common/hadoop-1.0.4/hadoop-1.0.4.tar.gz 解压下载的源码压缩包到合适的位置,如:/Users/yinxiu/dev/hadoop-1.0.4(这是本文安装hadoop的位置) 环境变量(hadoop_env.sh) 目录/Users/yinxiu/dev/hadoop-1.0.4/conf 2.1 JAVA_HOME 必须变量 export JAVA_HOME=实际JDK路径 如: export JAVA_HOME=/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/...
- 下一篇
baidu vs google 不在一个等级上的
看到 一篇文章 说 baidu 要发布 一个 hadoop 2.0 的东西。 http://cloud.csdn.net/a/20110428/296869.html 而百度也在对其Hadoop集群进行技术革新,马如悦称其为Hadoop 2.0。 被气的不行了。 剽窃修改代码,然后说是自己开发的。难道 谁的版本号高。谁就是厉害么。 从google 上面可以找到 技术的解决办法。从 google code 上面可以发现好多有用的。 开发者贡献的代码。。也可以做自己的 文件服务器。 用 gmail 可以有很少的广告。 google reader 可以阅读 rss 分享。 而baidu 这个除了 竞价排名,推广,广告,压根在就没有什么好印象。 总之 ,就像 是 电信 , 石油,垄断企业 一样,做无耻的事情。 典型的中国特色。受不了。google 啥时候 回来??
相关文章
文章评论
共有0条评论来说两句吧...
文章二维码
点击排行
推荐阅读
最新文章
- SpringBoot2整合MyBatis,连接MySql数据库做增删改查操作
- Docker安装Oracle12C,快速搭建Oracle学习环境
- SpringBoot2配置默认Tomcat设置,开启更多高级功能
- Red5直播服务器,属于Java语言的直播服务器
- Windows10,CentOS7,CentOS8安装Nodejs环境
- CentOS7,8上快速安装Gitea,搭建Git服务器
- SpringBoot2初体验,简单认识spring boot2并且搭建基础工程
- SpringBoot2全家桶,快速入门学习开发网站教程
- Docker使用Oracle官方镜像安装(12C,18C,19C)
- SpringBoot2整合Redis,开启缓存,提高访问速度