<?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: Unable to map numeric fields from Hbase table to Phoenix in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Unable-to-map-numeric-fields-from-Hbase-table-to-Phoenix/m-p/169410#M37219</link>
    <description>&lt;P&gt;As Josh already mentioned, it's included in Apache Phoenix 4.8.0. And it would handle it correctly. One additional note - the implementation that was accepted in Apache Phoenix is a bit different. More information can be found there: &lt;A href="https://github.com/mini666/hive-phoenix-handler"&gt;https://github.com/mini666/hive-phoenix-handler&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 16 Aug 2016 15:47:48 GMT</pubDate>
    <dc:creator>ssoldatov</dc:creator>
    <dc:date>2016-08-16T15:47:48Z</dc:date>
    <item>
      <title>Unable to map numeric fields from Hbase table to Phoenix</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Unable-to-map-numeric-fields-from-Hbase-table-to-Phoenix/m-p/169400#M37209</link>
      <description>&lt;P&gt;I have Hbase table with integer field.&lt;/P&gt;&lt;P&gt;When I map Phoenix table on to this Hbase table, integer field show values like : -213456236&lt;/P&gt;&lt;P&gt;E.g.&lt;/P&gt;&lt;PRE&gt;hbase&amp;gt; create 'emp','f1'

hbase&amp;gt; put 'emp',1,'f1:eid',1001
&lt;/PRE&gt;&lt;P&gt;Corresponding Phoenix table:&lt;/P&gt;&lt;PRE&gt;Create table "emp" (pk integer primary key, "f1"."eid" integer);&lt;/PRE&gt;&lt;P&gt;When I try to select from emp table, I get large number in eid field:&lt;/P&gt;&lt;PRE&gt;select "eid" from "emp";
=&amp;gt; 299345678&lt;/PRE&gt;&lt;P&gt;This is happening for float values also. Whereas varchar values get populated correctly.&lt;/P&gt;&lt;P&gt;What wrong am I doing? Am I wrongly mapping the Hbase table to phoenix? I have followed steps from FAQ page.&lt;/P&gt;&lt;P&gt;I have read below question, but unable to get any clue.&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.hortonworks.com/questions/15381/created-phoenix-view-to-map-existing-hbase-table-b.html" target="_blank"&gt;https://community.hortonworks.com/questions/15381/created-phoenix-view-to-map-existing-hbase-table-b.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt; Please help &lt;A rel="user" href="https://community.cloudera.com/users/223/jelser.html" nodeid="223"&gt;@Josh Elser&lt;/A&gt; &lt;/P&gt;</description>
      <pubDate>Mon, 08 Aug 2016 23:11:39 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Unable-to-map-numeric-fields-from-Hbase-table-to-Phoenix/m-p/169400#M37209</guid>
      <dc:creator>saurabh_rathi</dc:creator>
      <dc:date>2016-08-08T23:11:39Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to map numeric fields from Hbase table to Phoenix</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Unable-to-map-numeric-fields-from-Hbase-table-to-Phoenix/m-p/169401#M37210</link>
      <description>&lt;P&gt;You should use Apache Phoenix's APIs for writing data to Phoenix tables. There is often special encoding of values in these tables. Integers are one example. They are stored as a sequence of 4 bytes (with a sign bit) to ensure that they sort properly. The "string" form of the integer is being parsed as a number.&lt;/P&gt;</description>
      <pubDate>Mon, 08 Aug 2016 23:15:23 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Unable-to-map-numeric-fields-from-Hbase-table-to-Phoenix/m-p/169401#M37210</guid>
      <dc:creator>elserj</dc:creator>
      <dc:date>2016-08-08T23:15:23Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to map numeric fields from Hbase table to Phoenix</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Unable-to-map-numeric-fields-from-Hbase-table-to-Phoenix/m-p/169402#M37211</link>
      <description>&lt;P&gt;Thank for the reply Josh.&lt;/P&gt;&lt;P&gt;My use-case is: Data is going to get populated into Hbase table. &lt;/P&gt;&lt;P&gt;I'm going to create a Phoenix table on top of Hbase table so that I can fire SQL on it.&lt;/P&gt;&lt;P&gt;So I'm going to just read data from Phoenix table.&lt;/P&gt;</description>
      <pubDate>Mon, 08 Aug 2016 23:19:39 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Unable-to-map-numeric-fields-from-Hbase-table-to-Phoenix/m-p/169402#M37211</guid>
      <dc:creator>saurabh_rathi</dc:creator>
      <dc:date>2016-08-08T23:19:39Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to map numeric fields from Hbase table to Phoenix</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Unable-to-map-numeric-fields-from-Hbase-table-to-Phoenix/m-p/169403#M37212</link>
      <description>&lt;P&gt;Ok, beware that you are going down an unsupported path. You may be able to use the HBase &lt;A href="https://hbase.apache.org/apidocs/org/apache/hadoop/hbase/util/Bytes.html"&gt;Bytes&lt;/A&gt; class for properly converting data in your write-side, but I am not sure if this will be 100% accurate.&lt;/P&gt;</description>
      <pubDate>Mon, 08 Aug 2016 23:45:00 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Unable-to-map-numeric-fields-from-Hbase-table-to-Phoenix/m-p/169403#M37212</guid>
      <dc:creator>elserj</dc:creator>
      <dc:date>2016-08-08T23:45:00Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to map numeric fields from Hbase table to Phoenix</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Unable-to-map-numeric-fields-from-Hbase-table-to-Phoenix/m-p/169404#M37213</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/11584/saurabh-rathi.html" nodeid="11584"&gt;@Saurabh Rathi&lt;/A&gt;, the workaround , you can do is to declare your field "eid" as VARCHAR and use TO_NUMBER function to cast it to number during query if required.&lt;/P&gt;&lt;P&gt;Or, &lt;A rel="user" href="https://community.cloudera.com/users/223/jelser.html" nodeid="223"&gt;@Josh Elser&lt;/A&gt; said, while storing the data in hbase , you can encode your integer to phoenix representation of INT by using below API.(same for other data types)&lt;/P&gt;&lt;PRE&gt;byte[] byte_representation = PInteger.INSTANCE.toBytes(&amp;lt;integer_value&amp;gt;);&lt;/PRE&gt;&lt;P&gt;Please see for more details:-&lt;/P&gt;&lt;P&gt;
&lt;A href="https://phoenix.apache.org/faq.html#How_I_map_Phoenix_table_to_an_existing_HBase_table"&gt;https://phoenix.apache.org/faq.html#How_I_map_Phoenix_table_to_an_existing_HBase_table&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 09 Aug 2016 16:08:16 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Unable-to-map-numeric-fields-from-Hbase-table-to-Phoenix/m-p/169404#M37213</guid>
      <dc:creator>asinghal</dc:creator>
      <dc:date>2016-08-09T16:08:16Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to map numeric fields from Hbase table to Phoenix</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Unable-to-map-numeric-fields-from-Hbase-table-to-Phoenix/m-p/169405#M37214</link>
      <description>&lt;P&gt;Thanks for the reply &lt;A rel="user" href="https://community.cloudera.com/users/627/asinghal.html" nodeid="627"&gt;@Ankit Singhal&lt;/A&gt; &lt;/P&gt;&lt;P&gt;I am populating Hbase table through Hive table.&lt;/P&gt;&lt;PRE&gt;CREATE TABLE sdm_report__301__301_hive (order_by bigint, virus_id bigint, virus_name string, server_date date) 
STORED BY 'org.apache.hadoop.hive.hbase.HBaseStorageHandler'  
WITH SERDEPROPERTIES ('hbase.columns.mapping' = ':key, family:vid, family:name, family:server_date')  
TBLPROPERTIES ('hbase.table.name' = 'sdm_report__301__301_hbase'); 
INSERT OVERWRITE TABLE sdm_report__301__301_hive SELECT * FROM sdm_report__301__301;
&lt;/PRE&gt;&lt;P&gt;How should I use API you mentioned while inserting data into Hbase table through Hive?&lt;/P&gt;&lt;P&gt;Is there a way to map 'PInteger' class datatype while creating Hbase table?&lt;/P&gt;&lt;P&gt;Or is there a way to directly create Phoenix table through Hive?&lt;/P&gt;</description>
      <pubDate>Tue, 09 Aug 2016 17:44:43 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Unable-to-map-numeric-fields-from-Hbase-table-to-Phoenix/m-p/169405#M37214</guid>
      <dc:creator>saurabh_rathi</dc:creator>
      <dc:date>2016-08-09T17:44:43Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to map numeric fields from Hbase table to Phoenix</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Unable-to-map-numeric-fields-from-Hbase-table-to-Phoenix/m-p/169406#M37215</link>
      <description>&lt;P&gt;Probably only by making your own Hive UDF. The VARCHAR and TO_NUMBER approach would be simplest.&lt;/P&gt;</description>
      <pubDate>Tue, 09 Aug 2016 21:38:43 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Unable-to-map-numeric-fields-from-Hbase-table-to-Phoenix/m-p/169406#M37215</guid>
      <dc:creator>elserj</dc:creator>
      <dc:date>2016-08-09T21:38:43Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to map numeric fields from Hbase table to Phoenix</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Unable-to-map-numeric-fields-from-Hbase-table-to-Phoenix/m-p/169407#M37216</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/223/jelser.html" nodeid="223"&gt;@Josh Elser&lt;/A&gt; &lt;/P&gt;&lt;P&gt;Can I use PhoenixStorageHandler while creating Hive table?&lt;/P&gt;&lt;P&gt;Mentioned here: &lt;/P&gt;&lt;P&gt;&lt;A href="https://github.com/nmaillard/Phoenix-Hive"&gt;https://github.com/nmaillard/Phoenix-Hive&lt;/A&gt; &lt;/P&gt;</description>
      <pubDate>Thu, 11 Aug 2016 20:01:25 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Unable-to-map-numeric-fields-from-Hbase-table-to-Phoenix/m-p/169407#M37216</guid>
      <dc:creator>saurabh_rathi</dc:creator>
      <dc:date>2016-08-11T20:01:25Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to map numeric fields from Hbase table to Phoenix</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Unable-to-map-numeric-fields-from-Hbase-table-to-Phoenix/m-p/169408#M37217</link>
      <description>&lt;P&gt;I'm not sure of the state of that repository, but such a feature is included in Apache Phoenix 4.8.0 and will be included in HDP 2.5. I would assume that the integration would handle this natively, but I am not positive.&lt;/P&gt;</description>
      <pubDate>Thu, 11 Aug 2016 22:15:18 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Unable-to-map-numeric-fields-from-Hbase-table-to-Phoenix/m-p/169408#M37217</guid>
      <dc:creator>elserj</dc:creator>
      <dc:date>2016-08-11T22:15:18Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to map numeric fields from Hbase table to Phoenix</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Unable-to-map-numeric-fields-from-Hbase-table-to-Phoenix/m-p/169409#M37218</link>
      <description>&lt;P&gt;I'm planning to use approach mentioned below using phoenix-pig integration.&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.hortonworks.com/questions/12538/phoenix-storage-in-pig.html" target="_blank"&gt;https://community.hortonworks.com/questions/12538/phoenix-storage-in-pig.html&lt;/A&gt; &lt;/P&gt;</description>
      <pubDate>Fri, 12 Aug 2016 20:11:39 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Unable-to-map-numeric-fields-from-Hbase-table-to-Phoenix/m-p/169409#M37218</guid>
      <dc:creator>saurabh_rathi</dc:creator>
      <dc:date>2016-08-12T20:11:39Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to map numeric fields from Hbase table to Phoenix</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Unable-to-map-numeric-fields-from-Hbase-table-to-Phoenix/m-p/169410#M37219</link>
      <description>&lt;P&gt;As Josh already mentioned, it's included in Apache Phoenix 4.8.0. And it would handle it correctly. One additional note - the implementation that was accepted in Apache Phoenix is a bit different. More information can be found there: &lt;A href="https://github.com/mini666/hive-phoenix-handler"&gt;https://github.com/mini666/hive-phoenix-handler&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 16 Aug 2016 15:47:48 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Unable-to-map-numeric-fields-from-Hbase-table-to-Phoenix/m-p/169410#M37219</guid>
      <dc:creator>ssoldatov</dc:creator>
      <dc:date>2016-08-16T15:47:48Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to map numeric fields from Hbase table to Phoenix</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Unable-to-map-numeric-fields-from-Hbase-table-to-Phoenix/m-p/169411#M37220</link>
      <description>&lt;P&gt;Thanks for the reply. We are using HDP2.3 and Phoenix 4.4. Hence I'm planning to use pig integration mentioned below for Hive to Phoenix table transfer.&lt;/P&gt;</description>
      <pubDate>Wed, 17 Aug 2016 11:32:32 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Unable-to-map-numeric-fields-from-Hbase-table-to-Phoenix/m-p/169411#M37220</guid>
      <dc:creator>saurabh_rathi</dc:creator>
      <dc:date>2016-08-17T11:32:32Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to map numeric fields from Hbase table to Phoenix</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Unable-to-map-numeric-fields-from-Hbase-table-to-Phoenix/m-p/169412#M37221</link>
      <description>&lt;P&gt;idea work-around if you don't have minimal versions of &lt;/P&gt;&lt;UL&gt;
&lt;LI&gt;Phoenix 4.8.0+&lt;/LI&gt;&lt;LI&gt;Hive 1.2.1+&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;to use Phoenix Storage Handler for Hive.&lt;/P&gt;&lt;P&gt;Phoenix-Pig Integration worked for  me.. thank you  &lt;A rel="user" href="https://community.cloudera.com/users/11584/saurabh-rathi.html" nodeid="11584"&gt;@Saurabh Rathi&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 25 Apr 2017 02:01:12 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Unable-to-map-numeric-fields-from-Hbase-table-to-Phoenix/m-p/169412#M37221</guid>
      <dc:creator>SatyaPraveen</dc:creator>
      <dc:date>2017-04-25T02:01:12Z</dc:date>
    </item>
  </channel>
</rss>

