<?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: How do I import data from csv file into Hbase? in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-do-I-import-data-from-csv-file-into-Hbase/m-p/99658#M12802</link>
    <description>&lt;P&gt;Hi &lt;A rel="user" href="https://community.cloudera.com/users/1527/acondron.html" nodeid="1527"&gt;@Aidan Condron&lt;/A&gt;,&lt;/P&gt;&lt;P&gt;One option worth considering is Apache Phoenix (https://phoenix.apache.org/). Phoenix using relational constructs to make working with data in HBase simpler.  With HDP we have a simple example of loading CSV data into HBase and querying using Pheonix. Check it our here: &lt;A href="http://docs.hortonworks.com/HDPDocuments/HDP2/HDP-2.3.0/bk_installing_manually_book/content/validating-phoenix-installation.html"&gt;http://docs.hortonworks.com/HDPDocuments/HDP2/HDP...&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 17 Dec 2015 00:09:20 GMT</pubDate>
    <dc:creator>bwilson</dc:creator>
    <dc:date>2015-12-17T00:09:20Z</dc:date>
    <item>
      <title>How do I import data from csv file into Hbase?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-do-I-import-data-from-csv-file-into-Hbase/m-p/99657#M12801</link>
      <description />
      <pubDate>Thu, 17 Dec 2015 00:02:26 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-do-I-import-data-from-csv-file-into-Hbase/m-p/99657#M12801</guid>
      <dc:creator>acondron</dc:creator>
      <dc:date>2015-12-17T00:02:26Z</dc:date>
    </item>
    <item>
      <title>Re: How do I import data from csv file into Hbase?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-do-I-import-data-from-csv-file-into-Hbase/m-p/99658#M12802</link>
      <description>&lt;P&gt;Hi &lt;A rel="user" href="https://community.cloudera.com/users/1527/acondron.html" nodeid="1527"&gt;@Aidan Condron&lt;/A&gt;,&lt;/P&gt;&lt;P&gt;One option worth considering is Apache Phoenix (https://phoenix.apache.org/). Phoenix using relational constructs to make working with data in HBase simpler.  With HDP we have a simple example of loading CSV data into HBase and querying using Pheonix. Check it our here: &lt;A href="http://docs.hortonworks.com/HDPDocuments/HDP2/HDP-2.3.0/bk_installing_manually_book/content/validating-phoenix-installation.html"&gt;http://docs.hortonworks.com/HDPDocuments/HDP2/HDP...&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 17 Dec 2015 00:09:20 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-do-I-import-data-from-csv-file-into-Hbase/m-p/99658#M12802</guid>
      <dc:creator>bwilson</dc:creator>
      <dc:date>2015-12-17T00:09:20Z</dc:date>
    </item>
    <item>
      <title>Re: How do I import data from csv file into Hbase?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-do-I-import-data-from-csv-file-into-Hbase/m-p/99659#M12803</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/1527/acondron.html" nodeid="1527"&gt;@Aidan Condron&lt;/A&gt; You can do it in multiple ways as following. It depends on your requirement.&lt;/P&gt;&lt;P&gt;1. If your data is already in TSV or CSV format, skip this step and use the included ImportTsv utility and bulkload. See &lt;A href="http://hbase.apache.org/book.html#arch.bulk.load"&gt;http://hbase.apache.org/book.html#arch.bulk.load&lt;/A&gt; for details.&lt;/P&gt;&lt;P&gt;2. You can use Phoenix for the same if using Phoenix with HBase.&lt;/P&gt;&lt;P&gt;&lt;A href="https://phoenix.apache.org/bulk_dataload.html"&gt;https://phoenix.apache.org/bulk_dataload.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;3. Other option would be to use HiveHBase Storage Handler to do the same. Refer below for the same.&lt;/P&gt;&lt;P&gt;&lt;A href="http://docs.hortonworks.com/HDPDocuments/HDP2/HDP-2.3.2/bk_importing_data_into_hbase_guide/content/ch_importing_data_into_hbase_chapter.html"&gt;http://docs.hortonworks.com/HDPDocuments/HDP2/HDP-...&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 17 Dec 2015 00:10:11 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-do-I-import-data-from-csv-file-into-Hbase/m-p/99659#M12803</guid>
      <dc:creator>pardeep_kumar</dc:creator>
      <dc:date>2015-12-17T00:10:11Z</dc:date>
    </item>
    <item>
      <title>Re: How do I import data from csv file into Hbase?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-do-I-import-data-from-csv-file-into-Hbase/m-p/99660#M12804</link>
      <description>&lt;P&gt;HI &lt;A rel="user" href="https://community.cloudera.com/users/1527/acondron.html" nodeid="1527"&gt;@Aidan Condron&lt;/A&gt;, If you're not bulk loading, you can upload to HBase through Hive. Head to Hive through Ambari. You can upload your .csv files to HDFS, I use the tmp folder. Then use the following in Hive,&lt;/P&gt;&lt;PRE&gt;create table MyTable (col_value STRING);

LOAD DATA INPATH '/tmp/MyData.csv' OVERWRITE INTO TABLE MyTable;

CREATE TABLE MyHiveTable (FirstName STRING, LastName STRING);

insert overwrite table MyHiveTable
SELECT
regexp_extract(col_value, '^(?:([^,]*)\,?){1}', 1) FirstName,  
regexp_extract(col_value, '^(?:([^,]*)\,?){2}', 1) LastName
from MyTable;

CREATE TABLE MyHBaseTable(firstname STRING, lastname STRING)
STORED BY 'org.apache.hadoop.hive.hbase.HBaseStorageHandler'
WITH SERDEPROPERTIES ('hbase.columns.mapping' = ':key, f:c1')
TBLPROPERTIES ('hbase.table.name' = 'MyNamesTable');

FROM MyHiveTable INSERT INTO TABLE MyHBaseTable
Select MyHiveTable.*;&lt;/PRE&gt;&lt;P&gt;It's not a fast method, but the Regex and intermediary stages are useful if you need to additional control over your data before it goes into HBase&lt;/P&gt;</description>
      <pubDate>Thu, 17 Dec 2015 18:17:22 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-do-I-import-data-from-csv-file-into-Hbase/m-p/99660#M12804</guid>
      <dc:creator>sambass</dc:creator>
      <dc:date>2015-12-17T18:17:22Z</dc:date>
    </item>
  </channel>
</rss>

