如何将Java中的字符串与不区分大小写的hbase中存储的另一个字符串进行比较? [英] How to compare a string in Java with another string stored in hbase with case-insensitive?
本文介绍了如何将Java中的字符串与不区分大小写的hbase中存储的另一个字符串进行比较?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我是HBase的新手。
I am new to HBase.
我想比较Java中的字符串和不区分大小写的hbase中存储的另一个字符串。
I want to compare a string in Java with another string stored in hbase with case-insensitive.
我该如何实现?
预先感谢...
推荐答案
您可以尝试使用RegexStringComparator,例如
You could try RegexStringComparator like
RegexStringComparator regexStringComparator = new RegexStringComparator("^[aA][bB][cC]$");//will match aBc or ABC or Abc any case in order of a followed by b followed by c.
SingleColumnValueFilter filter = new SingleColumnValueFilter(
cf,
column,
CompareOp.EQUAL,
regexStringComparator
);
scan.setFilter(filter);
这篇关于如何将Java中的字符串与不区分大小写的hbase中存储的另一个字符串进行比较?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文