<?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 How to fetch single column from HBASE table in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/How-to-fetch-single-column-from-HBASE-table/m-p/166161#M128513</link>
    <description>&lt;P&gt;I have a table dept_tbl in HBase with 1 Column Family and 3 columns in it&lt;/P&gt;&lt;P&gt;cf1:dept_city, cf1:dept_name, cf1:dept_no&lt;/P&gt;&lt;P&gt;-------&lt;/P&gt;&lt;P&gt;I want to filter a column say dept_no and get the corresponding dept_name for it&lt;/P&gt;&lt;P&gt;Like: if dept_no=10, return dept_name=ACCOUNTING&lt;/P&gt;&lt;P&gt;-------&lt;/P&gt;&lt;P&gt;I applied filter as below:&lt;/P&gt;&lt;P&gt;scan 'dept_tbl',{FILTER
=&amp;gt; "MultipleColumnPrefixFilter('dept_name','dept_no') &lt;STRONG&gt;AND&lt;/STRONG&gt;
SingleColumnValueFilter('cf1','dept_no',=, 'binary:10')"}&lt;/P&gt;&lt;P&gt;-------&lt;/P&gt;&lt;P&gt;This returns me 2 columns: 'dept_name' and 'dept_no'&lt;/P&gt;&lt;P&gt;I need only 1 column 'dept_name' to be returned&lt;/P&gt;&lt;P&gt;-------&lt;/P&gt;&lt;P&gt;If I use MultipleColumnPrefixFilter('dept_name').. it gives me all rows as if it didnt check for filter of dept_no=10&lt;/P&gt;&lt;P&gt;I tried many combinations, I couldnt get it to return single column single row.&lt;/P&gt;&lt;P&gt;-------&lt;/P&gt;&lt;P&gt;Script to create the table:&lt;/P&gt;&lt;P&gt;create 'dept_tbl','cf1'
put 'dept_tbl','R1','cf1:dept_no','10'
put 'dept_tbl','R1','cf1:dept_name','ACCOUNTING'
put 'dept_tbl','R1','cf1:dept_city','NEW YORK'
put 'dept_tbl','R2','cf1:dept_no','20'
put 'dept_tbl','R2','cf1:dept_name','RESEARCH'
put 'dept_tbl','R2','cf1:dept_city','DALLAS'
put 'dept_tbl','R3','cf1:dept_no','30'
put 'dept_tbl','R3','cf1:dept_name','SALES'
put 'dept_tbl','R3','cf1:dept_city','CHICAGO'
put 'dept_tbl','R4','cf1:dept_no','40'
put 'dept_tbl','R4','cf1:dept_name','OPERATIONS'
put 'dept_tbl','R4','cf1:dept_city','BOSTON'&lt;/P&gt;</description>
    <pubDate>Wed, 08 Feb 2017 20:25:23 GMT</pubDate>
    <dc:creator>anubhav_r_raika</dc:creator>
    <dc:date>2017-02-08T20:25:23Z</dc:date>
    <item>
      <title>How to fetch single column from HBASE table</title>
      <link>https://community.cloudera.com/t5/Support-Questions/How-to-fetch-single-column-from-HBASE-table/m-p/166161#M128513</link>
      <description>&lt;P&gt;I have a table dept_tbl in HBase with 1 Column Family and 3 columns in it&lt;/P&gt;&lt;P&gt;cf1:dept_city, cf1:dept_name, cf1:dept_no&lt;/P&gt;&lt;P&gt;-------&lt;/P&gt;&lt;P&gt;I want to filter a column say dept_no and get the corresponding dept_name for it&lt;/P&gt;&lt;P&gt;Like: if dept_no=10, return dept_name=ACCOUNTING&lt;/P&gt;&lt;P&gt;-------&lt;/P&gt;&lt;P&gt;I applied filter as below:&lt;/P&gt;&lt;P&gt;scan 'dept_tbl',{FILTER
=&amp;gt; "MultipleColumnPrefixFilter('dept_name','dept_no') &lt;STRONG&gt;AND&lt;/STRONG&gt;
SingleColumnValueFilter('cf1','dept_no',=, 'binary:10')"}&lt;/P&gt;&lt;P&gt;-------&lt;/P&gt;&lt;P&gt;This returns me 2 columns: 'dept_name' and 'dept_no'&lt;/P&gt;&lt;P&gt;I need only 1 column 'dept_name' to be returned&lt;/P&gt;&lt;P&gt;-------&lt;/P&gt;&lt;P&gt;If I use MultipleColumnPrefixFilter('dept_name').. it gives me all rows as if it didnt check for filter of dept_no=10&lt;/P&gt;&lt;P&gt;I tried many combinations, I couldnt get it to return single column single row.&lt;/P&gt;&lt;P&gt;-------&lt;/P&gt;&lt;P&gt;Script to create the table:&lt;/P&gt;&lt;P&gt;create 'dept_tbl','cf1'
put 'dept_tbl','R1','cf1:dept_no','10'
put 'dept_tbl','R1','cf1:dept_name','ACCOUNTING'
put 'dept_tbl','R1','cf1:dept_city','NEW YORK'
put 'dept_tbl','R2','cf1:dept_no','20'
put 'dept_tbl','R2','cf1:dept_name','RESEARCH'
put 'dept_tbl','R2','cf1:dept_city','DALLAS'
put 'dept_tbl','R3','cf1:dept_no','30'
put 'dept_tbl','R3','cf1:dept_name','SALES'
put 'dept_tbl','R3','cf1:dept_city','CHICAGO'
put 'dept_tbl','R4','cf1:dept_no','40'
put 'dept_tbl','R4','cf1:dept_name','OPERATIONS'
put 'dept_tbl','R4','cf1:dept_city','BOSTON'&lt;/P&gt;</description>
      <pubDate>Wed, 08 Feb 2017 20:25:23 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/How-to-fetch-single-column-from-HBASE-table/m-p/166161#M128513</guid>
      <dc:creator>anubhav_r_raika</dc:creator>
      <dc:date>2017-02-08T20:25:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to fetch single column from HBASE table</title>
      <link>https://community.cloudera.com/t5/Support-Questions/How-to-fetch-single-column-from-HBASE-table/m-p/166162#M128514</link>
      <description>&lt;P&gt;&lt;A href="https://community.hortonworks.com/users/14497/anubhavrraikar.html"&gt;@Anubhav Raikar&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.hortonworks.com/users/14497/anubhavrraikar.html"&gt;&lt;/A&gt;Use reverse order of the filters:&lt;/P&gt;&lt;P&gt;scan 'dept_tbl',{FILTER =&amp;gt; "SingleColumnValueFilter('cf1','dept_no',=,'binary:10') AND MultipleColumnPrefixFilter('dept_name')"}&lt;/P&gt;&lt;P&gt;The order of the filter matters here.&lt;/P&gt;</description>
      <pubDate>Wed, 08 Feb 2017 21:42:53 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/How-to-fetch-single-column-from-HBASE-table/m-p/166162#M128514</guid>
      <dc:creator>jgub</dc:creator>
      <dc:date>2017-02-08T21:42:53Z</dc:date>
    </item>
    <item>
      <title>Re: How to fetch single column from HBASE table</title>
      <link>https://community.cloudera.com/t5/Support-Questions/How-to-fetch-single-column-from-HBASE-table/m-p/166163#M128515</link>
      <description>&lt;P&gt;whoaaa.. yes.. it works.. good to know the order matters.. thank you!&lt;/P&gt;</description>
      <pubDate>Wed, 08 Feb 2017 21:49:02 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/How-to-fetch-single-column-from-HBASE-table/m-p/166163#M128515</guid>
      <dc:creator>anubhav_r_raika</dc:creator>
      <dc:date>2017-02-08T21:49:02Z</dc:date>
    </item>
  </channel>
</rss>

