How to compare a string in Java with another string stored in hbase with case-insensitive?

空扰寡人 提交于 2019-12-23 04:26:50

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!