hbase 过滤器

//正则比较器
//RegexStringComparator rex = new RegexStringComparator(“理科*”);
//字符串包含比较器
//SubstringComparator rex = new SubstringComparator(“文科”);

       //前缀二进制比较器
      // BinaryPrefixComparator rex = new BinaryPrefixComparator("文科".getBytes());

       //二进制比较器
       BinaryComparator rex = new BinaryComparator("文科三班".getBytes());

过滤器常用的 为 列值过滤器,行键过滤器

//列值过滤器
SingleColumnValueFilter valueFilter = new SingleColumnValueFilter(
“info”.getBytes(),
“clazz”.getBytes(),
CompareFilter.CompareOp.EQUAL,
rex);
scan.setFilter(valueFilter);

//行键过滤器
RowFilter rowFilter = new RowFilter(CompareFilter.CompareOp.EQUAL, binaryPrefixComparator);

©️2020 CSDN 皮肤主题: 游动-白 设计师:上身试试 返回首页