<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question Re: hbase case insensitive query in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/hbase-case-insensitive-query/m-p/122749#M85503</link>
    <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/2302/arunpoy.html" nodeid="2302"&gt;@ARUNKUMAR RAMASAMY&lt;/A&gt; HBase has a concept of filters. For your gets and scans, you can setup a filter for your specific need. Consider using the following filter and comparator classes for case-incensitive queries. &lt;A href="http://hbase.apache.org/apidocs/org/apache/hadoop/hbase/filter/SubstringComparator.html" target="_blank"&gt;http://hbase.apache.org/apidocs/org/apache/hadoop/hbase/filter/SubstringComparator.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;and this is the class for filter &lt;A href="https://hbase.apache.org/book.html#client.filter.cv.scvf" target="_blank"&gt;https://hbase.apache.org/book.html#client.filter.cv.scvf&lt;/A&gt;&lt;/P&gt;&lt;P&gt;You can also try RegexStringComparator&lt;/P&gt;&lt;P&gt;&lt;A href="http://hbase.apache.org/apidocs/org/apache/hadoop/hbase/filter/RegexStringComparator.html" target="_blank"&gt;http://hbase.apache.org/apidocs/org/apache/hadoop/hbase/filter/RegexStringComparator.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;A SingleColumnValueFilter (see: &lt;A href="http://hbase.apache.org/apidocs/org/apache/hadoop/hbase/filter/SingleColumnValueFilter.html"&gt;http://hbase.apache.org/apidocs/org/apache/hadoop/hbase/filter/SingleColumnValueFilter.html&lt;/A&gt;) can be used to test column values for equivalence (&lt;CODE&gt;CompareOp.EQUAL&lt;/CODE&gt;), inequality (&lt;CODE&gt;CompareOp.NOT_EQUAL&lt;/CODE&gt;), or ranges (e.g., &lt;CODE&gt;CompareOp.GREATER&lt;/CODE&gt;). The following is an example of testing equivalence of a column to a String value "my value"…&lt;/P&gt;&lt;PRE&gt;SingleColumnValueFilter filter = new SingleColumnValueFilter(
  cf,
  column,
  CompareOp.EQUAL,
  Bytes.toBytes("my value")
  );
scan.setFilter(filter);
&lt;/PRE&gt;
&lt;PRE&gt;// example with Case Incensitive substring comparator
SingleColumnValueFilter scvf =
   new SingleColumnValueFilter("col", CompareOp.EQUAL,
     new SubstringComparator("substr"));
&lt;/PRE&gt;&lt;P&gt;Cloudera has good documentation for HBase filtering in Java and CLI&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.cloudera.com/documentation/enterprise/5-2-x/topics/admin_hbase_filtering.html" target="_blank"&gt;http://www.cloudera.com/documentation/enterprise/5-2-x/topics/admin_hbase_filtering.html&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 11 Mar 2016 23:11:01 GMT</pubDate>
    <dc:creator>aervits</dc:creator>
    <dc:date>2016-03-11T23:11:01Z</dc:date>
    <item>
      <title>hbase case insensitive query</title>
      <link>https://community.cloudera.com/t5/Support-Questions/hbase-case-insensitive-query/m-p/122748#M85502</link>
      <description>&lt;P&gt;Is there any way for hbase to return case insensitive values from the cells.&lt;/P&gt;&lt;P&gt; if a cell has value 'XYZ'  and If a query it with 'xyZ' . is there a way to get the result back as value present?&lt;/P&gt;</description>
      <pubDate>Fri, 11 Mar 2016 23:01:54 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/hbase-case-insensitive-query/m-p/122748#M85502</guid>
      <dc:creator>arunpoy</dc:creator>
      <dc:date>2016-03-11T23:01:54Z</dc:date>
    </item>
    <item>
      <title>Re: hbase case insensitive query</title>
      <link>https://community.cloudera.com/t5/Support-Questions/hbase-case-insensitive-query/m-p/122749#M85503</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/2302/arunpoy.html" nodeid="2302"&gt;@ARUNKUMAR RAMASAMY&lt;/A&gt; HBase has a concept of filters. For your gets and scans, you can setup a filter for your specific need. Consider using the following filter and comparator classes for case-incensitive queries. &lt;A href="http://hbase.apache.org/apidocs/org/apache/hadoop/hbase/filter/SubstringComparator.html" target="_blank"&gt;http://hbase.apache.org/apidocs/org/apache/hadoop/hbase/filter/SubstringComparator.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;and this is the class for filter &lt;A href="https://hbase.apache.org/book.html#client.filter.cv.scvf" target="_blank"&gt;https://hbase.apache.org/book.html#client.filter.cv.scvf&lt;/A&gt;&lt;/P&gt;&lt;P&gt;You can also try RegexStringComparator&lt;/P&gt;&lt;P&gt;&lt;A href="http://hbase.apache.org/apidocs/org/apache/hadoop/hbase/filter/RegexStringComparator.html" target="_blank"&gt;http://hbase.apache.org/apidocs/org/apache/hadoop/hbase/filter/RegexStringComparator.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;A SingleColumnValueFilter (see: &lt;A href="http://hbase.apache.org/apidocs/org/apache/hadoop/hbase/filter/SingleColumnValueFilter.html"&gt;http://hbase.apache.org/apidocs/org/apache/hadoop/hbase/filter/SingleColumnValueFilter.html&lt;/A&gt;) can be used to test column values for equivalence (&lt;CODE&gt;CompareOp.EQUAL&lt;/CODE&gt;), inequality (&lt;CODE&gt;CompareOp.NOT_EQUAL&lt;/CODE&gt;), or ranges (e.g., &lt;CODE&gt;CompareOp.GREATER&lt;/CODE&gt;). The following is an example of testing equivalence of a column to a String value "my value"…&lt;/P&gt;&lt;PRE&gt;SingleColumnValueFilter filter = new SingleColumnValueFilter(
  cf,
  column,
  CompareOp.EQUAL,
  Bytes.toBytes("my value")
  );
scan.setFilter(filter);
&lt;/PRE&gt;
&lt;PRE&gt;// example with Case Incensitive substring comparator
SingleColumnValueFilter scvf =
   new SingleColumnValueFilter("col", CompareOp.EQUAL,
     new SubstringComparator("substr"));
&lt;/PRE&gt;&lt;P&gt;Cloudera has good documentation for HBase filtering in Java and CLI&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.cloudera.com/documentation/enterprise/5-2-x/topics/admin_hbase_filtering.html" target="_blank"&gt;http://www.cloudera.com/documentation/enterprise/5-2-x/topics/admin_hbase_filtering.html&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 11 Mar 2016 23:11:01 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/hbase-case-insensitive-query/m-p/122749#M85503</guid>
      <dc:creator>aervits</dc:creator>
      <dc:date>2016-03-11T23:11:01Z</dc:date>
    </item>
    <item>
      <title>Re: hbase case insensitive query</title>
      <link>https://community.cloudera.com/t5/Support-Questions/hbase-case-insensitive-query/m-p/122750#M85504</link>
      <description>&lt;P&gt;@arunkumar&lt;/P&gt;&lt;P&gt;There is no direct way compare insensitive values from HBase. You need to write custom filter and add the jar to all region servers and client Or else you need to write custom coprocessor to check the value and not to skip the results when upper of value matching.&lt;/P&gt;&lt;P&gt;If you use phoenix you can run query with where condition on UPPER(column_name) = 'XYZ'. It's just simple. Phoenix do lot of things for us.&lt;/P&gt;</description>
      <pubDate>Fri, 11 Mar 2016 23:30:23 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/hbase-case-insensitive-query/m-p/122750#M85504</guid>
      <dc:creator>rchintaguntla</dc:creator>
      <dc:date>2016-03-11T23:30:23Z</dc:date>
    </item>
  </channel>
</rss>

