<?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: Best/Optimized Way to move data from Phoenix to Hive/Orc Table in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Best-Optimized-Way-to-move-data-from-Phoenix-to-Hive-Orc/m-p/95537#M8881</link>
    <description>&lt;P&gt;I cant say it's the best way, but I would try to create a hive table with Hbase storage handler and then do a create table as select or insert/select.&lt;/P&gt;&lt;P&gt;see a simple example below:&lt;/P&gt;&lt;PRE&gt;PHOENIX:
CREATE TABLE TEST(
  ID VARCHAR not null,
  TEXT VARCHAR
  CONSTRAINT PK PRIMARY KEY (ID)
) ;

HIVE:
CREATE EXTERNAL TABLE TEST(ID int, TEXT string) 
STORED BY 'org.apache.hadoop.hive.hbase.HBaseStorageHandler'
WITH SERDEPROPERTIES ("hbase.columns.mapping" = ":key,0:TEXT")
TBLPROPERTIES ("hbase.table.name" = "TEST");

&lt;/PRE&gt;&lt;P&gt;A more complex example, with composite key and numeric data types:&lt;/P&gt;&lt;PRE&gt;PHOENIX:
CREATE TABLE TEST2(
  ID1 VARCHAR NOT NULL,
  ID2 VARCHAR NOT NULL,
  NUM DOUBLE,
  TEXT VARCHAR
  CONSTRAINT PK PRIMARY KEY (ID1, ID2)
);

HIVE:
CREATE EXTERNAL TABLE TEST2(KEY STRUCT&amp;lt;ID1:STRING, ID2:STRING&amp;gt;, NUM DOUBLE, TEXT STRING) 
ROW FORMAT DELIMITED
COLLECTION ITEMS TERMINATED BY '\u0000'
STORED BY 'org.apache.hadoop.hive.hbase.HBaseStorageHandler'
WITH SERDEPROPERTIES ("hbase.columns.mapping" = ":key,0:NUM,0:TEXT",
"hbase.table.default.storage.type" = "binary")
TBLPROPERTIES ("hbase.table.name" = "TEST2");
&lt;/PRE&gt;</description>
    <pubDate>Fri, 16 Oct 2015 10:06:20 GMT</pubDate>
    <dc:creator>gbraccialli3</dc:creator>
    <dc:date>2015-10-16T10:06:20Z</dc:date>
    <item>
      <title>Best/Optimized Way to move data from Phoenix to Hive/Orc Table</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Best-Optimized-Way-to-move-data-from-Phoenix-to-Hive-Orc/m-p/95535#M8879</link>
      <description>&lt;P&gt;Can you please provide some recommended way to move data from Phoenix based on certain query to Hive/orc without dumping into text Format&lt;/P&gt;</description>
      <pubDate>Fri, 16 Oct 2015 09:49:10 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Best-Optimized-Way-to-move-data-from-Phoenix-to-Hive-Orc/m-p/95535#M8879</guid>
      <dc:creator>nasghar</dc:creator>
      <dc:date>2015-10-16T09:49:10Z</dc:date>
    </item>
    <item>
      <title>Re: Best/Optimized Way to move data from Phoenix to Hive/Orc Table</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Best-Optimized-Way-to-move-data-from-Phoenix-to-Hive-Orc/m-p/95536#M8880</link>
      <description>&lt;P&gt;Phoenix creates tables in HBASE so basically, you are asking to integrate HBASE and Hive. Check this &lt;A target="_blank" href="http://hortonworks.com/blog/hbase-via-hive-part-1/"&gt;blog&lt;/A&gt;. Hope this helps.  &lt;/P&gt;</description>
      <pubDate>Fri, 16 Oct 2015 10:02:39 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Best-Optimized-Way-to-move-data-from-Phoenix-to-Hive-Orc/m-p/95536#M8880</guid>
      <dc:creator>nsabharwal</dc:creator>
      <dc:date>2015-10-16T10:02:39Z</dc:date>
    </item>
    <item>
      <title>Re: Best/Optimized Way to move data from Phoenix to Hive/Orc Table</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Best-Optimized-Way-to-move-data-from-Phoenix-to-Hive-Orc/m-p/95537#M8881</link>
      <description>&lt;P&gt;I cant say it's the best way, but I would try to create a hive table with Hbase storage handler and then do a create table as select or insert/select.&lt;/P&gt;&lt;P&gt;see a simple example below:&lt;/P&gt;&lt;PRE&gt;PHOENIX:
CREATE TABLE TEST(
  ID VARCHAR not null,
  TEXT VARCHAR
  CONSTRAINT PK PRIMARY KEY (ID)
) ;

HIVE:
CREATE EXTERNAL TABLE TEST(ID int, TEXT string) 
STORED BY 'org.apache.hadoop.hive.hbase.HBaseStorageHandler'
WITH SERDEPROPERTIES ("hbase.columns.mapping" = ":key,0:TEXT")
TBLPROPERTIES ("hbase.table.name" = "TEST");

&lt;/PRE&gt;&lt;P&gt;A more complex example, with composite key and numeric data types:&lt;/P&gt;&lt;PRE&gt;PHOENIX:
CREATE TABLE TEST2(
  ID1 VARCHAR NOT NULL,
  ID2 VARCHAR NOT NULL,
  NUM DOUBLE,
  TEXT VARCHAR
  CONSTRAINT PK PRIMARY KEY (ID1, ID2)
);

HIVE:
CREATE EXTERNAL TABLE TEST2(KEY STRUCT&amp;lt;ID1:STRING, ID2:STRING&amp;gt;, NUM DOUBLE, TEXT STRING) 
ROW FORMAT DELIMITED
COLLECTION ITEMS TERMINATED BY '\u0000'
STORED BY 'org.apache.hadoop.hive.hbase.HBaseStorageHandler'
WITH SERDEPROPERTIES ("hbase.columns.mapping" = ":key,0:NUM,0:TEXT",
"hbase.table.default.storage.type" = "binary")
TBLPROPERTIES ("hbase.table.name" = "TEST2");
&lt;/PRE&gt;</description>
      <pubDate>Fri, 16 Oct 2015 10:06:20 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Best-Optimized-Way-to-move-data-from-Phoenix-to-Hive-Orc/m-p/95537#M8881</guid>
      <dc:creator>gbraccialli3</dc:creator>
      <dc:date>2015-10-16T10:06:20Z</dc:date>
    </item>
    <item>
      <title>Re: Best/Optimized Way to move data from Phoenix to Hive/Orc Table</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Best-Optimized-Way-to-move-data-from-Phoenix-to-Hive-Orc/m-p/95538#M8882</link>
      <description>&lt;P&gt;&lt;A href="http://community.hortonworks.com/users/151/nasghar.html"&gt;nasghar@hortonworks.com&lt;/A&gt; when you say "based on certain query" what does that mean? Are you thinking of this -&amp;gt; ingest data in Phoenix/hbase, then ETL it out to ORC, for running deep analytics?&lt;/P&gt;</description>
      <pubDate>Sat, 17 Oct 2015 01:21:56 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Best-Optimized-Way-to-move-data-from-Phoenix-to-Hive-Orc/m-p/95538#M8882</guid>
      <dc:creator>ddas</dc:creator>
      <dc:date>2015-10-17T01:21:56Z</dc:date>
    </item>
    <item>
      <title>Re: Best/Optimized Way to move data from Phoenix to Hive/Orc Table</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Best-Optimized-Way-to-move-data-from-Phoenix-to-Hive-Orc/m-p/95539#M8883</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/151/nasghar.html" nodeid="151"&gt;@nasghar&lt;/A&gt;:Why you want to move data from phoenix to Hive/Orc? If your intention is to run hive queries on HBase/Phoenix table then you can easily create Hive External tables on top of your existing HBase/Phoenix table. Or you intentionally wants to duplicate the data in Hive internal table? This way you will create 2 set of data which you have to maintain.(One in Hive and other in HBase)&lt;/P&gt;</description>
      <pubDate>Tue, 15 Dec 2015 00:50:33 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Best-Optimized-Way-to-move-data-from-Phoenix-to-Hive-Orc/m-p/95539#M8883</guid>
      <dc:creator>ajay_kumar</dc:creator>
      <dc:date>2015-12-15T00:50:33Z</dc:date>
    </item>
  </channel>
</rss>

