标签:style blog color java 使用 strong 数据 for
SingleColumnValueFilter
过滤某列值大于多少小于多少:
List<Filter> filters = new ArrayList<Filter>(); filters.add( new SingleColumnValueFilter(Bytes.toBytes("pinfo"), //列族 Bytes.toBytes("t"), //列名 CompareOp.GREATER,Bytes.toBytes("1359901"]) ) //值 filters.add( new SingleColumnValueFilter(Bytes.toBytes("pinfo"), Bytes.toBytes("t"), CompareOp.LESS,Bytes.toBytes("1389901"]) ) FilterList filterList1 = new FilterList(Operator.MUST_PASS_ALL,filters); sn.setFilter(filterList1);
字符串存在list a内
for (int a=0;a<size;a++) { // Filter filter2 = new RowFilter(CompareOp.EQUAL, // new RegexStringComparator(".*"+maclist.get(a)+"$")); Filter filter2 = new RowFilter(CompareOp.EQUAL, new SubstringComparator(maclist.get(a))); filters.add(filter2); } FilterList filterList1 = new FilterList(Operator.MUST_PASS_ONE,filters); sn.setFilter(filterList1);
不需要指定某个列,含指某个值的列的数据都取出来,混在一起
HTable table = new HTable(config, tableName); Scan scan = new Scan(); System.out.println("只列出值包含data1的列"); Filter filter1 = new ValueFilter(CompareFilter.CompareOp.EQUAL, new SubstringComparator("data1")); scan.setFilter(filter1);
使用HBASE用到的几个filter SingleColumnValueFilter,RowFilter,ValueFilter,布布扣,bubuko.com
使用HBASE用到的几个filter SingleColumnValueFilter,RowFilter,ValueFilter
标签:style blog color java 使用 strong 数据 for
原文地址:http://blog.csdn.net/u011750989/article/details/38558673