问题
I am new to HBase.
I want to compare a string in Java with another string stored in hbase with case-insensitive.
How can i achieve this ?
Thanks in advance ...
回答1:
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);
来源:https://stackoverflow.com/questions/27738735/how-to-compare-a-string-in-java-with-another-string-stored-in-hbase-with-case-in