<?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: Access Hbase Increment column via hive/impala in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Access-Hbase-Increment-column-via-hive-impala/m-p/41877#M29494</link>
    <description>&lt;P&gt;Actually this has been already resolved, we changed the create table statetment, added #b (hash b - &amp;nbsp;as binary).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;create external table md_extract_file_status ( table_key string, fl_counter bigint )&lt;BR /&gt;STORED BY 'org.apache.hadoop.hive.hbase.HBaseStorageHandler' WITH SERDEPROPERTIES ('hbase.columns.mapping' = ':key,colfam:FL_Counter#b ) TBLPROPERTIES('hbase.table.name' ='HBTABLE');&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 10 Jun 2016 12:44:10 GMT</pubDate>
    <dc:creator>Tomas79</dc:creator>
    <dc:date>2016-06-10T12:44:10Z</dc:date>
    <item>
      <title>Access Hbase Increment column via hive/impala</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Access-Hbase-Increment-column-via-hive-impala/m-p/41256#M29492</link>
      <description>&lt;P&gt;Hbase has a nice feature called counter increment, where you can atomicly increment a value and get back the result. I want to create ta simple external table over this hbase table, but I dont know how to choose the correct data type for Hive/Impala.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The value of colfam:FL_Lock is this:&lt;/P&gt;&lt;P&gt;20160512_000006 column=colfam:FL_Lock, timestamp=1464120550634, value=\x00\x00\x00\x00\x00\x00\x00\x00&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I create external table with string, the query returns nothing, no error&lt;/P&gt;&lt;P&gt;If I create external table with bigint/decimal/int, the query returns NULL and ERROR from Impala:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Error converting column colfam:FL_Lock: '' TO INT&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any ideas how to map correctly this Hbase column?&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Tomas&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 16 Sep 2022 10:21:33 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Access-Hbase-Increment-column-via-hive-impala/m-p/41256#M29492</guid>
      <dc:creator>Tomas79</dc:creator>
      <dc:date>2022-09-16T10:21:33Z</dc:date>
    </item>
    <item>
      <title>Re: Access Hbase Increment column via hive/impala</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Access-Hbase-Increment-column-via-hive-impala/m-p/41870#M29493</link>
      <description>Given the encoding used internally by HBase, the only way to achieve this would be to apply a UDF on top of the returned binary data that decodes the value to an integer.&lt;BR /&gt;&lt;BR /&gt;You can use the HBase API of &lt;A href="http://archive.cloudera.com/cdh5/cdh/5/hbase/apidocs/org/apache/hadoop/hbase/util/Bytes.html#toLong(byte[])" target="_blank"&gt;http://archive.cloudera.com/cdh5/cdh/5/hbase/apidocs/org/apache/hadoop/hbase/util/Bytes.html#toLong(byte[])&lt;/A&gt; to perform the transformation within the UDF.&lt;BR /&gt;&lt;BR /&gt;X-Ref: &lt;A href="https://github.com/cloudera/hbase/blob/cdh5.7.1-release/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java#L7546-L7618" target="_blank"&gt;https://github.com/cloudera/hbase/blob/cdh5.7.1-release/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java#L7546-L7618&lt;/A&gt;</description>
      <pubDate>Fri, 10 Jun 2016 09:19:10 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Access-Hbase-Increment-column-via-hive-impala/m-p/41870#M29493</guid>
      <dc:creator>Harsh J</dc:creator>
      <dc:date>2016-06-10T09:19:10Z</dc:date>
    </item>
    <item>
      <title>Re: Access Hbase Increment column via hive/impala</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Access-Hbase-Increment-column-via-hive-impala/m-p/41877#M29494</link>
      <description>&lt;P&gt;Actually this has been already resolved, we changed the create table statetment, added #b (hash b - &amp;nbsp;as binary).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;create external table md_extract_file_status ( table_key string, fl_counter bigint )&lt;BR /&gt;STORED BY 'org.apache.hadoop.hive.hbase.HBaseStorageHandler' WITH SERDEPROPERTIES ('hbase.columns.mapping' = ':key,colfam:FL_Counter#b ) TBLPROPERTIES('hbase.table.name' ='HBTABLE');&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 10 Jun 2016 12:44:10 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Access-Hbase-Increment-column-via-hive-impala/m-p/41877#M29494</guid>
      <dc:creator>Tomas79</dc:creator>
      <dc:date>2016-06-10T12:44:10Z</dc:date>
    </item>
  </channel>
</rss>

