hbase RowFilter如何根据rowkey查询以及实例实现代码 habase模糊查询【转】
Operator | Description |
LESS | 小于 |
LESS_OR_EQUAL | 小于等于 |
[EQUAL | 等于 |
NOT_EQUAL | 不等于 |
GREATER_OR_EQUAL | 大于等于 |
GREATER | 大于 |
NO_OP | 排除所有 |
Comparator | Description |
BinaryComparator | 使用Bytes.compareTo()比较 |
BinaryPrefixComparator | 和BinaryComparator差不多,从前面开始比较 |
NullComparator | Does not compare against an actual value but whether a given one is null, or not null. |
BitComparator | Performs a bitwise comparison, providing a BitwiseOp class with OR, and XORoperators. |
RegexStringComparator | 正则表达式 |
SubstringComparator | 把数据当成字符串,用contains()来判断 |
- import java.io.IOException;
- import org.apache.hadoop.conf.Configuration;
- import org.apache.hadoop.hbase.HBaseConfiguration;
- import org.apache.hadoop.hbase.HColumnDescriptor;
- import org.apache.hadoop.hbase.HTableDescriptor;
- import org.apache.hadoop.hbase.client.HBaseAdmin;
- import org.apache.hadoop.hbase.client.HTable;
- import org.apache.hadoop.hbase.client.Put;
- import org.apache.hadoop.hbase.client.Result;
- import org.apache.hadoop.hbase.client.ResultScanner;
- import org.apache.hadoop.hbase.client.Scan;
- import org.apache.hadoop.hbase.filter.BinaryComparator;
- import org.apache.hadoop.hbase.filter.BinaryPrefixComparator;
- import org.apache.hadoop.hbase.filter.CompareFilter;
- import org.apache.hadoop.hbase.filter.Filter;
- import org.apache.hadoop.hbase.filter.RegexStringComparator;
- import org.apache.hadoop.hbase.filter.RowFilter;
- import org.apache.hadoop.hbase.filter.SubstringComparator;
- public class TestHbaseRowFilter {
- String tableName = "test_row_filter";
- Configuration config = HBaseConfiguration.create();
- /**
- * 部分代码来自hbase权威指南
- * @throws IOException
- */
- public void testRowFilter() throws IOException {
- HTable table = new HTable(config, tableName);
- Scan scan = new Scan();
- System.out.println("小于等于row010的行");
- Filter filter1 = new RowFilter(CompareFilter.CompareOp.LESS_OR_EQUAL,
- new BinaryComparator("row010".getBytes()));
- scan.setFilter(filter1);
- ResultScanner scanner1 = table.getScanner(scan);
- for (Result res : scanner1) {
- System.out.println(res);
- }
- scanner1.close();
- System.out.println("正则获取结尾为5的行");
- Filter filter2 = new RowFilter(CompareFilter.CompareOp.EQUAL,
- new RegexStringComparator(".*5[ DISCUZ_CODE_0 ]quot;));
- scan.setFilter(filter2);
- ResultScanner scanner2 = table.getScanner(scan);
- for (Result res : scanner2) {
- System.out.println(res);
- }
- scanner2.close();
- System.out.println("包含有5的行");
- Filter filter3 = new RowFilter(CompareFilter.CompareOp.EQUAL,
- new SubstringComparator("5"));
- scan.setFilter(filter3);
- ResultScanner scanner3 = table.getScanner(scan);
- for (Result res : scanner3) {
- System.out.println(res);
- }
- scanner3.close();
- System.out.println("开头是row01的");
- Filter filter4 = new RowFilter(CompareFilter.CompareOp.EQUAL,
- new BinaryPrefixComparator("row01".getBytes()));
- scan.setFilter(filter4);
- ResultScanner scanner4 = table.getScanner(scan);
- for (Result res : scanner4) {
- System.out.println(res);
- }
- scanner3.close();
- }
- /**
- * 初始化数据
- */
- public void init() {
- // 创建表和初始化数据
- try {
- HBaseAdmin admin = new HBaseAdmin(config);
- if (!admin.tableExists(tableName)) {
- HTableDescriptor htd = new HTableDescriptor(tableName);
- HColumnDescriptor hcd1 = new HColumnDescriptor("data");
- htd.addFamily(hcd1);
- HColumnDescriptor hcd2 = new HColumnDescriptor("url");
- htd.addFamily(hcd2);
- admin.createTable(htd);
- }
- HTable table = new HTable(config, tableName);
- table.setAutoFlush(false);
- int count = 50;
- for (int i = 1; i <= count; ++i) {
- Put p = new Put(String.format("row%03d", i).getBytes());
- p.add("data".getBytes(), String.format("col%01d", i % 10)
- .getBytes(), String.format("data%03d", i).getBytes());
- p.add("url".getBytes(), String.format("col%01d", i % 10)
- .getBytes(), String.format("url%03d", i).getBytes());
- table.put(p);
- }
- table.close();
- } catch (IOException e) {
- e.printStackTrace();
- }
- }
- /**
- * @param args
- * @throws IOException
- */
- public static void main(String[] args) throws IOException {
- TestHbaseRowFilter test = new TestHbaseRowFilter();
- test.init();
- test.testRowFilter();
- }
- }
复制代码
- 小于等于row010的行
- keyvalues={row001/data:col1/1364133382268/Put/vlen=7, row001/url:col1/1364133382268/Put/vlen=6}
- keyvalues={row002/data:col2/1364133382268/Put/vlen=7, row002/url:col2/1364133382268/Put/vlen=6}
- keyvalues={row003/data:col3/1364133382268/Put/vlen=7, row003/url:col3/1364133382268/Put/vlen=6}
- keyvalues={row004/data:col4/1364133382268/Put/vlen=7, row004/url:col4/1364133382268/Put/vlen=6}
- keyvalues={row005/data:col5/1364133382268/Put/vlen=7, row005/url:col5/1364133382268/Put/vlen=6}
- keyvalues={row006/data:col6/1364133382268/Put/vlen=7, row006/url:col6/1364133382268/Put/vlen=6}
- keyvalues={row007/data:col7/1364133382268/Put/vlen=7, row007/url:col7/1364133382268/Put/vlen=6}
- keyvalues={row008/data:col8/1364133382268/Put/vlen=7, row008/url:col8/1364133382268/Put/vlen=6}
- keyvalues={row009/data:col9/1364133382268/Put/vlen=7, row009/url:col9/1364133382268/Put/vlen=6}
- keyvalues={row010/data:col0/1364133382268/Put/vlen=7, row010/url:col0/1364133382268/Put/vlen=6}
- 正则获取结尾为5的行
- keyvalues={row005/data:col5/1364133382268/Put/vlen=7, row005/url:col5/1364133382268/Put/vlen=6}
- keyvalues={row015/data:col5/1364133382268/Put/vlen=7, row015/url:col5/1364133382268/Put/vlen=6}
- keyvalues={row025/data:col5/1364133382268/Put/vlen=7, row025/url:col5/1364133382268/Put/vlen=6}
- keyvalues={row035/data:col5/1364133382268/Put/vlen=7, row035/url:col5/1364133382268/Put/vlen=6}
- keyvalues={row045/data:col5/1364133382268/Put/vlen=7, row045/url:col5/1364133382268/Put/vlen=6}
- 包行有5的行
- keyvalues={row005/data:col5/1364133382268/Put/vlen=7, row005/url:col5/1364133382268/Put/vlen=6}
- keyvalues={row015/data:col5/1364133382268/Put/vlen=7, row015/url:col5/1364133382268/Put/vlen=6}
- keyvalues={row025/data:col5/1364133382268/Put/vlen=7, row025/url:col5/1364133382268/Put/vlen=6}
- keyvalues={row035/data:col5/1364133382268/Put/vlen=7, row035/url:col5/1364133382268/Put/vlen=6}
- keyvalues={row045/data:col5/1364133382268/Put/vlen=7, row045/url:col5/1364133382268/Put/vlen=6}
- keyvalues={row050/data:col0/1364133382268/Put/vlen=7, row050/url:col0/1364133382268/Put/vlen=6}
- 开头是row01的
- keyvalues={row010/data:col0/1364133382268/Put/vlen=7, row010/url:col0/1364133382268/Put/vlen=6}
- keyvalues={row011/data:col1/1364133382268/Put/vlen=7, row011/url:col1/1364133382268/Put/vlen=6}
- keyvalues={row012/data:col2/1364133382268/Put/vlen=7, row012/url:col2/1364133382268/Put/vlen=6}
- keyvalues={row013/data:col3/1364133382268/Put/vlen=7, row013/url:col3/1364133382268/Put/vlen=6}
- keyvalues={row014/data:col4/1364133382268/Put/vlen=7, row014/url:col4/1364133382268/Put/vlen=6}
- keyvalues={row015/data:col5/1364133382268/Put/vlen=7, row015/url:col5/1364133382268/Put/vlen=6}
- keyvalues={row016/data:col6/1364133382268/Put/vlen=7, row016/url:col6/1364133382268/Put/vlen=6}
- keyvalues={row017/data:col7/1364133382268/Put/vlen=7, row017/url:col7/1364133382268/Put/vlen=6}
- keyvalues={row018/data:col8/1364133382268/Put/vlen=7, row018/url:col8/1364133382268/Put/vlen=6}
- keyvalues={row019/data:col9/1364133382268/Put/vlen=7, row019/url:col9/1364133382268/Put/vlen=6}
复制代码
Operator | Description |
LESS | 小于 |
LESS_OR_EQUAL | 小于等于 |
[EQUAL | 等于 |
NOT_EQUAL | 不等于 |
GREATER_OR_EQUAL | 大于等于 |
GREATER | 大于 |
NO_OP | 排除所有 |
Comparator | Description |
BinaryComparator | 使用Bytes.compareTo()比较 |
BinaryPrefixComparator | 和BinaryComparator差不多,从前面开始比较 |
NullComparator | Does not compare against an actual value but whether a given one is null, or not null. |
BitComparator | Performs a bitwise comparison, providing a BitwiseOp class with OR, and XORoperators. |
RegexStringComparator | 正则表达式 |
SubstringComparator | 把数据当成字符串,用contains()来判断 |
- import java.io.IOException;
- import org.apache.hadoop.conf.Configuration;
- import org.apache.hadoop.hbase.HBaseConfiguration;
- import org.apache.hadoop.hbase.HColumnDescriptor;
- import org.apache.hadoop.hbase.HTableDescriptor;
- import org.apache.hadoop.hbase.client.HBaseAdmin;
- import org.apache.hadoop.hbase.client.HTable;
- import org.apache.hadoop.hbase.client.Put;
- import org.apache.hadoop.hbase.client.Result;
- import org.apache.hadoop.hbase.client.ResultScanner;
- import org.apache.hadoop.hbase.client.Scan;
- import org.apache.hadoop.hbase.filter.BinaryComparator;
- import org.apache.hadoop.hbase.filter.BinaryPrefixComparator;
- import org.apache.hadoop.hbase.filter.CompareFilter;
- import org.apache.hadoop.hbase.filter.Filter;
- import org.apache.hadoop.hbase.filter.RegexStringComparator;
- import org.apache.hadoop.hbase.filter.RowFilter;
- import org.apache.hadoop.hbase.filter.SubstringComparator;
- public class TestHbaseRowFilter {
- String tableName = "test_row_filter";
- Configuration config = HBaseConfiguration.create();
- /**
- * 部分代码来自hbase权威指南
- * @throws IOException
- */
- public void testRowFilter() throws IOException {
- HTable table = new HTable(config, tableName);
- Scan scan = new Scan();
- System.out.println("小于等于row010的行");
- Filter filter1 = new RowFilter(CompareFilter.CompareOp.LESS_OR_EQUAL,
- new BinaryComparator("row010".getBytes()));
- scan.setFilter(filter1);
- ResultScanner scanner1 = table.getScanner(scan);
- for (Result res : scanner1) {
- System.out.println(res);
- }
- scanner1.close();
- System.out.println("正则获取结尾为5的行");
- Filter filter2 = new RowFilter(CompareFilter.CompareOp.EQUAL,
- new RegexStringComparator(".*5[ DISCUZ_CODE_0 ]quot;));
- scan.setFilter(filter2);
- ResultScanner scanner2 = table.getScanner(scan);
- for (Result res : scanner2) {
- System.out.println(res);
- }
- scanner2.close();
- System.out.println("包含有5的行");
- Filter filter3 = new RowFilter(CompareFilter.CompareOp.EQUAL,
- new SubstringComparator("5"));
- scan.setFilter(filter3);
- ResultScanner scanner3 = table.getScanner(scan);
- for (Result res : scanner3) {
- System.out.println(res);
- }
- scanner3.close();
- System.out.println("开头是row01的");
- Filter filter4 = new RowFilter(CompareFilter.CompareOp.EQUAL,
- new BinaryPrefixComparator("row01".getBytes()));
- scan.setFilter(filter4);
- ResultScanner scanner4 = table.getScanner(scan);
- for (Result res : scanner4) {
- System.out.println(res);
- }
- scanner3.close();
- }
- /**
- * 初始化数据
- */
- public void init() {
- // 创建表和初始化数据
- try {
- HBaseAdmin admin = new HBaseAdmin(config);
- if (!admin.tableExists(tableName)) {
- HTableDescriptor htd = new HTableDescriptor(tableName);
- HColumnDescriptor hcd1 = new HColumnDescriptor("data");
- htd.addFamily(hcd1);
- HColumnDescriptor hcd2 = new HColumnDescriptor("url");
- htd.addFamily(hcd2);
- admin.createTable(htd);
- }
- HTable table = new HTable(config, tableName);
- table.setAutoFlush(false);
- int count = 50;
- for (int i = 1; i <= count; ++i) {
- Put p = new Put(String.format("row%03d", i).getBytes());
- p.add("data".getBytes(), String.format("col%01d", i % 10)
- .getBytes(), String.format("data%03d", i).getBytes());
- p.add("url".getBytes(), String.format("col%01d", i % 10)
- .getBytes(), String.format("url%03d", i).getBytes());
- table.put(p);
- }
- table.close();
- } catch (IOException e) {
- e.printStackTrace();
- }
- }
- /**
- * @param args
- * @throws IOException
- */
- public static void main(String[] args) throws IOException {
- TestHbaseRowFilter test = new TestHbaseRowFilter();
- test.init();
- test.testRowFilter();
- }
- }
复制代码
- 小于等于row010的行
- keyvalues={row001/data:col1/1364133382268/Put/vlen=7, row001/url:col1/1364133382268/Put/vlen=6}
- keyvalues={row002/data:col2/1364133382268/Put/vlen=7, row002/url:col2/1364133382268/Put/vlen=6}
- keyvalues={row003/data:col3/1364133382268/Put/vlen=7, row003/url:col3/1364133382268/Put/vlen=6}
- keyvalues={row004/data:col4/1364133382268/Put/vlen=7, row004/url:col4/1364133382268/Put/vlen=6}
- keyvalues={row005/data:col5/1364133382268/Put/vlen=7, row005/url:col5/1364133382268/Put/vlen=6}
- keyvalues={row006/data:col6/1364133382268/Put/vlen=7, row006/url:col6/1364133382268/Put/vlen=6}
- keyvalues={row007/data:col7/1364133382268/Put/vlen=7, row007/url:col7/1364133382268/Put/vlen=6}
- keyvalues={row008/data:col8/1364133382268/Put/vlen=7, row008/url:col8/1364133382268/Put/vlen=6}
- keyvalues={row009/data:col9/1364133382268/Put/vlen=7, row009/url:col9/1364133382268/Put/vlen=6}
- keyvalues={row010/data:col0/1364133382268/Put/vlen=7, row010/url:col0/1364133382268/Put/vlen=6}
- 正则获取结尾为5的行
- keyvalues={row005/data:col5/1364133382268/Put/vlen=7, row005/url:col5/1364133382268/Put/vlen=6}
- keyvalues={row015/data:col5/1364133382268/Put/vlen=7, row015/url:col5/1364133382268/Put/vlen=6}
- keyvalues={row025/data:col5/1364133382268/Put/vlen=7, row025/url:col5/1364133382268/Put/vlen=6}
- keyvalues={row035/data:col5/1364133382268/Put/vlen=7, row035/url:col5/1364133382268/Put/vlen=6}
- keyvalues={row045/data:col5/1364133382268/Put/vlen=7, row045/url:col5/1364133382268/Put/vlen=6}
- 包行有5的行
- keyvalues={row005/data:col5/1364133382268/Put/vlen=7, row005/url:col5/1364133382268/Put/vlen=6}
- keyvalues={row015/data:col5/1364133382268/Put/vlen=7, row015/url:col5/1364133382268/Put/vlen=6}
- keyvalues={row025/data:col5/1364133382268/Put/vlen=7, row025/url:col5/1364133382268/Put/vlen=6}
- keyvalues={row035/data:col5/1364133382268/Put/vlen=7, row035/url:col5/1364133382268/Put/vlen=6}
- keyvalues={row045/data:col5/1364133382268/Put/vlen=7, row045/url:col5/1364133382268/Put/vlen=6}
- keyvalues={row050/data:col0/1364133382268/Put/vlen=7, row050/url:col0/1364133382268/Put/vlen=6}
- 开头是row01的
- keyvalues={row010/data:col0/1364133382268/Put/vlen=7, row010/url:col0/1364133382268/Put/vlen=6}
- keyvalues={row011/data:col1/1364133382268/Put/vlen=7, row011/url:col1/1364133382268/Put/vlen=6}
- keyvalues={row012/data:col2/1364133382268/Put/vlen=7, row012/url:col2/1364133382268/Put/vlen=6}
- keyvalues={row013/data:col3/1364133382268/Put/vlen=7, row013/url:col3/1364133382268/Put/vlen=6}
- keyvalues={row014/data:col4/1364133382268/Put/vlen=7, row014/url:col4/1364133382268/Put/vlen=6}
- keyvalues={row015/data:col5/1364133382268/Put/vlen=7, row015/url:col5/1364133382268/Put/vlen=6}
- keyvalues={row016/data:col6/1364133382268/Put/vlen=7, row016/url:col6/1364133382268/Put/vlen=6}
- keyvalues={row017/data:col7/1364133382268/Put/vlen=7, row017/url:col7/1364133382268/Put/vlen=6}
- keyvalues={row018/data:col8/1364133382268/Put/vlen=7, row018/url:col8/1364133382268/Put/vlen=6}
- keyvalues={row019/data:col9/1364133382268/Put/vlen=7, row019/url:col9/1364133382268/Put/vlen=6}
复制代码
Operator | Description |
LESS | 小于 |
LESS_OR_EQUAL | 小于等于 |
[EQUAL | 等于 |
NOT_EQUAL | 不等于 |
GREATER_OR_EQUAL | 大于等于 |
GREATER | 大于 |
NO_OP | 排除所有 |
Comparator | Description |
BinaryComparator | 使用Bytes.compareTo()比较 |
BinaryPrefixComparator | 和BinaryComparator差不多,从前面开始比较 |
NullComparator | Does not compare against an actual value but whether a given one is null, or not null. |
BitComparator | Performs a bitwise comparison, providing a BitwiseOp class with OR, and XORoperators. |
RegexStringComparator | 正则表达式 |
SubstringComparator | 把数据当成字符串,用contains()来判断 |
- import java.io.IOException;
- import org.apache.hadoop.conf.Configuration;
- import org.apache.hadoop.hbase.HBaseConfiguration;
- import org.apache.hadoop.hbase.HColumnDescriptor;
- import org.apache.hadoop.hbase.HTableDescriptor;
- import org.apache.hadoop.hbase.client.HBaseAdmin;
- import org.apache.hadoop.hbase.client.HTable;
- import org.apache.hadoop.hbase.client.Put;
- import org.apache.hadoop.hbase.client.Result;
- import org.apache.hadoop.hbase.client.ResultScanner;
- import org.apache.hadoop.hbase.client.Scan;
- import org.apache.hadoop.hbase.filter.BinaryComparator;
- import org.apache.hadoop.hbase.filter.BinaryPrefixComparator;
- import org.apache.hadoop.hbase.filter.CompareFilter;
- import org.apache.hadoop.hbase.filter.Filter;
- import org.apache.hadoop.hbase.filter.RegexStringComparator;
- import org.apache.hadoop.hbase.filter.RowFilter;
- import org.apache.hadoop.hbase.filter.SubstringComparator;
- public class TestHbaseRowFilter {
- String tableName = "test_row_filter";
- Configuration config = HBaseConfiguration.create();
- /**
- * 部分代码来自hbase权威指南
- * @throws IOException
- */
- public void testRowFilter() throws IOException {
- HTable table = new HTable(config, tableName);
- Scan scan = new Scan();
- System.out.println("小于等于row010的行");
- Filter filter1 = new RowFilter(CompareFilter.CompareOp.LESS_OR_EQUAL,
- new BinaryComparator("row010".getBytes()));
- scan.setFilter(filter1);
- ResultScanner scanner1 = table.getScanner(scan);
- for (Result res : scanner1) {
- System.out.println(res);
- }
- scanner1.close();
- System.out.println("正则获取结尾为5的行");
- Filter filter2 = new RowFilter(CompareFilter.CompareOp.EQUAL,
- new RegexStringComparator(".*5[ DISCUZ_CODE_0 ]quot;));
- scan.setFilter(filter2);
- ResultScanner scanner2 = table.getScanner(scan);
- for (Result res : scanner2) {
- System.out.println(res);
- }
- scanner2.close();
- System.out.println("包含有5的行");
- Filter filter3 = new RowFilter(CompareFilter.CompareOp.EQUAL,
- new SubstringComparator("5"));
- scan.setFilter(filter3);
- ResultScanner scanner3 = table.getScanner(scan);
- for (Result res : scanner3) {
- System.out.println(res);
- }
- scanner3.close();
- System.out.println("开头是row01的");
- Filter filter4 = new RowFilter(CompareFilter.CompareOp.EQUAL,
- new BinaryPrefixComparator("row01".getBytes()));
- scan.setFilter(filter4);
- ResultScanner scanner4 = table.getScanner(scan);
- for (Result res : scanner4) {
- System.out.println(res);
- }
- scanner3.close();
- }
- /**
- * 初始化数据
- */
- public void init() {
- // 创建表和初始化数据
- try {
- HBaseAdmin admin = new HBaseAdmin(config);
- if (!admin.tableExists(tableName)) {
- HTableDescriptor htd = new HTableDescriptor(tableName);
- HColumnDescriptor hcd1 = new HColumnDescriptor("data");
- htd.addFamily(hcd1);
- HColumnDescriptor hcd2 = new HColumnDescriptor("url");
- htd.addFamily(hcd2);
- admin.createTable(htd);
- }
- HTable table = new HTable(config, tableName);
- table.setAutoFlush(false);
- int count = 50;
- for (int i = 1; i <= count; ++i) {
- Put p = new Put(String.format("row%03d", i).getBytes());
- p.add("data".getBytes(), String.format("col%01d", i % 10)
- .getBytes(), String.format("data%03d", i).getBytes());
- p.add("url".getBytes(), String.format("col%01d", i % 10)
- .getBytes(), String.format("url%03d", i).getBytes());
- table.put(p);
- }
- table.close();
- } catch (IOException e) {
- e.printStackTrace();
- }
- }
- /**
- * @param args
- * @throws IOException
- */
- public static void main(String[] args) throws IOException {
- TestHbaseRowFilter test = new TestHbaseRowFilter();
- test.init();
- test.testRowFilter();
- }
- }
复制代码
- 小于等于row010的行
- keyvalues={row001/data:col1/1364133382268/Put/vlen=7, row001/url:col1/1364133382268/Put/vlen=6}
- keyvalues={row002/data:col2/1364133382268/Put/vlen=7, row002/url:col2/1364133382268/Put/vlen=6}
- keyvalues={row003/data:col3/1364133382268/Put/vlen=7, row003/url:col3/1364133382268/Put/vlen=6}
- keyvalues={row004/data:col4/1364133382268/Put/vlen=7, row004/url:col4/1364133382268/Put/vlen=6}
- keyvalues={row005/data:col5/1364133382268/Put/vlen=7, row005/url:col5/1364133382268/Put/vlen=6}
- keyvalues={row006/data:col6/1364133382268/Put/vlen=7, row006/url:col6/1364133382268/Put/vlen=6}
- keyvalues={row007/data:col7/1364133382268/Put/vlen=7, row007/url:col7/1364133382268/Put/vlen=6}
- keyvalues={row008/data:col8/1364133382268/Put/vlen=7, row008/url:col8/1364133382268/Put/vlen=6}
- keyvalues={row009/data:col9/1364133382268/Put/vlen=7, row009/url:col9/1364133382268/Put/vlen=6}
- keyvalues={row010/data:col0/1364133382268/Put/vlen=7, row010/url:col0/1364133382268/Put/vlen=6}
- 正则获取结尾为5的行
- keyvalues={row005/data:col5/1364133382268/Put/vlen=7, row005/url:col5/1364133382268/Put/vlen=6}
- keyvalues={row015/data:col5/1364133382268/Put/vlen=7, row015/url:col5/1364133382268/Put/vlen=6}
- keyvalues={row025/data:col5/1364133382268/Put/vlen=7, row025/url:col5/1364133382268/Put/vlen=6}
- keyvalues={row035/data:col5/1364133382268/Put/vlen=7, row035/url:col5/1364133382268/Put/vlen=6}
- keyvalues={row045/data:col5/1364133382268/Put/vlen=7, row045/url:col5/1364133382268/Put/vlen=6}
- 包行有5的行
- keyvalues={row005/data:col5/1364133382268/Put/vlen=7, row005/url:col5/1364133382268/Put/vlen=6}
- keyvalues={row015/data:col5/1364133382268/Put/vlen=7, row015/url:col5/1364133382268/Put/vlen=6}
- keyvalues={row025/data:col5/1364133382268/Put/vlen=7, row025/url:col5/1364133382268/Put/vlen=6}
- keyvalues={row035/data:col5/1364133382268/Put/vlen=7, row035/url:col5/1364133382268/Put/vlen=6}
- keyvalues={row045/data:col5/1364133382268/Put/vlen=7, row045/url:col5/1364133382268/Put/vlen=6}
- keyvalues={row050/data:col0/1364133382268/Put/vlen=7, row050/url:col0/1364133382268/Put/vlen=6}
- 开头是row01的
- keyvalues={row010/data:col0/1364133382268/Put/vlen=7, row010/url:col0/1364133382268/Put/vlen=6}
- keyvalues={row011/data:col1/1364133382268/Put/vlen=7, row011/url:col1/1364133382268/Put/vlen=6}
- keyvalues={row012/data:col2/1364133382268/Put/vlen=7, row012/url:col2/1364133382268/Put/vlen=6}
- keyvalues={row013/data:col3/1364133382268/Put/vlen=7, row013/url:col3/1364133382268/Put/vlen=6}
- keyvalues={row014/data:col4/1364133382268/Put/vlen=7, row014/url:col4/1364133382268/Put/vlen=6}
- keyvalues={row015/data:col5/1364133382268/Put/vlen=7, row015/url:col5/1364133382268/Put/vlen=6}
- keyvalues={row016/data:col6/1364133382268/Put/vlen=7, row016/url:col6/1364133382268/Put/vlen=6}
- keyvalues={row017/data:col7/1364133382268/Put/vlen=7, row017/url:col7/1364133382268/Put/vlen=6}
- keyvalues={row018/data:col8/1364133382268/Put/vlen=7, row018/url:col8/1364133382268/Put/vlen=6}
- keyvalues={row019/data:col9/1364133382268/Put/vlen=7, row019/url:col9/1364133382268/Put/vlen=6}
复制代码
hbase RowFilter如何根据rowkey查询以及实例实现代码 habase模糊查询【转】的更多相关文章
- Python 代码实现模糊查询
Python 代码实现模糊查询 1.导语: 模糊匹配可以算是现代编辑器(如 Eclipse 等各种 IDE)的一个必备特性了,它所做的就是根据用户输入的部分内容,猜测用户想要的文件名,并提供一个推荐列 ...
- query_string查询支持全部的Apache Lucene查询语法 低频词划分依据 模糊查询 Disjunction Max
3.3 基本查询3.3.1词条查询 词条查询是未经分析的,要跟索引文档中的词条完全匹配注意:在输入数据中,title字段含有Crime and Punishment,但我们使用小写开头的crime来搜 ...
- 10 行 Python 代码实现模糊查询/智能提示
10 行 Python 代码实现模糊查询/智能提示 1.导语: 模糊匹配可以算是现代编辑器(如 Eclipse 等各种 IDE)的一个必备特性了,它所做的就是根据用户输入的部分内容,猜测用户想要的 ...
- ASP.NET MVC+EF框架+EasyUI实现权限管理系列(20)-多条件模糊查询和回收站还原的实现
原文:ASP.NET MVC+EF框架+EasyUI实现权限管理系列(20)-多条件模糊查询和回收站还原的实现 ASP.NET MVC+EF框架+EasyUI实现权限管系列 (开篇) (1):框架 ...
- stark组件的分页,模糊查询,批量删除
1.分页组件高阶 2.整合展示数据showlist类 3.stark组件之分页 3.stark组件之search模糊查询 4.action批量处理数据 4.总结 1.分页组件高阶 1.分页的class ...
- 10 star组件之分页, search模糊查询, action批量处理
1.分页组件高阶 1.分页的class形式(有bug,请看下面的) """ 自定义分页组件 """ class Pagination(obj ...
- ASP.NET操作ORACLE数据库之模糊查询
ASP.NET操作ORACLE数据库之模糊查询 一.ASP.NET MVC利用OracleHelper辅助类操作ORACLE数据库 //连接Oracle数据库的连接字符串 string connect ...
- T-SQL---多值模糊查询的处理
多值模糊查询的处理 所谓多值模糊查询,就是应用程序中传递过来多个参数,对这些参数做拆分,拆分之后,对拆分结果的key值分别做模糊查询处理 对于精确匹配时,不管是单个Key值还是多个Key值,都很容易处 ...
- JAVA 模糊查询方法
当我们需要开发一个方法用来查询数据库的时候,往往会遇到这样一个问题:就是不知道用户到底会输入什么条件,那么怎么样处理sql语句才能让我们开发的方法不管接受到什么样的条件都可以正常工作呢?这时where ...
随机推荐
- EXCEL 列与列怎么交换?
选中A列数据,按先SHIFT键的同时按住鼠标左键,向右拖动鼠标,在拖动的过程中,会出现一条虚线,当拖动到B列的右边缘时,屏幕上会出现 C:C 的提示,这时送开SHIFT键及鼠标左键,就完成了A B两列 ...
- H5中JavaScript常用代码片段
/** * 批量替换方法,批量过滤特殊字符,通常用在通过后的各种编辑器添加的内容在App上编辑上使用 * james.wang 2016-11-11 * 使用方法:ReCont(Content,[&q ...
- 〖Linux〗联想K860/i Android 4.2及以上的Bootimg解压与打包工具
因为自己有需要,所以花了一点时间来写了一下. 1. 解压工具 #!/bin/bash - #====================================================== ...
- DB2保存图片并读取动态显示图片
博文背景: 客户要求结构化图片信息,而不是文件文档话的管理,故要求将图片信息存储于DB2里,出于技术的角度,真不喜欢将文件存储于数据库, 但客户是上帝,木有办法,故有了如下的测试. 测试环境:DB2 ...
- API密钥
什么是API密钥? 答:在api调用时,用来按照指定规则对您的请求参数进行签名,服务器收到你的请求时会进行签名验证,即可以界定你的身份也可以防止其他人通过某种手段恶意篡改你的请求数据. 密钥的使用? ...
- 新浪微博api出现认证失败问题 (获取code字段值的问题)
出现该提示的原因:`` - 说: (2015-10-30 18:06:14)回调地址不一致,`` - 说: (2015-10-30 18:07:38)请在编辑开发者信息中将网站地址和应用信息--高级信 ...
- centos7编译python3.6与原有的2.7共存
在某些场景下我们可能需要python2.7和python3这两个版本进行共存,我在工作中也遇到过这样的问题,所以今天来总结下我的安装过程, 我的是用源码包安装的,安装的是python3.6的版本. 安 ...
- Javakeyword之this
this的作用: 1) this是当前对象的一个引用.便于对当前对象參数的使用. 2)能够返回对象的自己这个类的引用.同一时候还能够在一个构造函数其中调用还有一个构造函数 this演示样例: publ ...
- Xshell和Xftp5配置连接阿里云服务器
配置Xftp5 配置成功后 配置Xshell 记住用户名和密码 连接成功
- DirectoryEntry配置IIS7出现ADSI Error:未知错误(0x80005000) [转]
一.错误情况 环境:win7+iis7.0 DirectoryEntry配置IIS7出现如下错误 或者是 下面一段代码在IIS6.0下运转正常,但IIS7.0下运转会出错: System.Direct ...