<?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: Loading data into HBase using Pig script in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Loading-data-into-HBase-using-Pig-script/m-p/112603#M42710</link>
    <description>&lt;P&gt;TBLPROPERTIES("hbase.table.name"="MyNamespace:MyTable")       &lt;/P&gt;&lt;P&gt; I am getting "FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask. MetaException(message:org.apache.hadoop.hbase.NamespaceNotFoundException: org.apache.hadoop.hbase.NamespaceNotFoundException: MyNamespace"   Please help us here&lt;/P&gt;</description>
    <pubDate>Wed, 05 Oct 2016 20:41:05 GMT</pubDate>
    <dc:creator>amit_dass</dc:creator>
    <dc:date>2016-10-05T20:41:05Z</dc:date>
    <item>
      <title>Loading data into HBase using Pig script</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Loading-data-into-HBase-using-Pig-script/m-p/112600#M42707</link>
      <description>&lt;P&gt;Hi, I'm trying to load simple dataset into HBase using Pig script. I have referred few websites but some are using org.apache.pig.backend.hadoop.hbase.HBaseStorage and in som website they used org.apache.hadoop.hive.hbase.HBaseStorageHandler. Can someone please let me know which is the correct method and what is the difference between these two.?&lt;/P&gt;</description>
      <pubDate>Tue, 04 Oct 2016 20:36:12 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Loading-data-into-HBase-using-Pig-script/m-p/112600#M42707</guid>
      <dc:creator>maheshmsh88</dc:creator>
      <dc:date>2016-10-04T20:36:12Z</dc:date>
    </item>
    <item>
      <title>Re: Loading data into HBase using Pig script</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Loading-data-into-HBase-using-Pig-script/m-p/112601#M42708</link>
      <description>&lt;P&gt;  &lt;A rel="user" href="https://community.cloudera.com/users/12642/maheshmsh88.html" nodeid="12642"&gt;@Mahesh Mallikarjunappa&lt;/A&gt; When you use pig to load into hbase use org.apache.pig.backend.hadoop.hbase.HBaseStorage, when you use hive to load into hbase use used org.apache.hadoop.hive.hbase.HBaseStorageHandler.  Both are for those specific technolgoies.&lt;/P&gt;</description>
      <pubDate>Tue, 04 Oct 2016 21:31:25 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Loading-data-into-HBase-using-Pig-script/m-p/112601#M42708</guid>
      <dc:creator>sunile_manjee</dc:creator>
      <dc:date>2016-10-04T21:31:25Z</dc:date>
    </item>
    <item>
      <title>Re: Loading data into HBase using Pig script</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Loading-data-into-HBase-using-Pig-script/m-p/112602#M42709</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/12642/maheshmsh88.html" nodeid="12642"&gt;@Mahesh Mallikarjunappa&lt;/A&gt; The Hive serde can be used to load data into HBase via Hive. A simple example follows:&lt;/P&gt;&lt;PRE&gt;-- Create a hive-managed HBase table
CREATE TABLE MyHBaseTable(MyKey string, Col1 string, Col2 string)
   STORED BY 'org.apache.hadoop.hive.hbase.HBaseStorageHandler'
   WITH SERDEPROPERTIES ("hbase.columns.mapping" = ":key,colfam:col1,colfam:col2")
   TBLPROPERTIES("hbase.table.name" = "MyNamespace:MyTable")
;

-- Insert data into it
INSERT INTO TABLE MyHBaseTable
   SELECT SourceKey, SourceCol1, SourceCol2
   FROM SourceHiveTable
;&lt;/PRE&gt;&lt;P&gt;And from Pig, you can read form that same source and write to that same target using the HBase serde as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;pig -useHCatalog -f script.pig&lt;/P&gt;&lt;P&gt;Where script.pig is as below&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;RawData = LOAD 'SourceHiveTable'
          USING org.apache.hive.hcatalog.pig.HCatLoader();

KeepColumns = FOREACH RawData
              GENERATE SourceKey, SourceCol1, SourceCol2;

STORE KeepColumns
INTO 'hbase://MyNamespace:MyTable'
USING org.apache.pig.backend.hadoop.hbase.HBaseStorage('colfam:col1,colfam:col2');&lt;/PRE&gt;&lt;P&gt;Note: You don't specify the key in the STORE statement - the first column is always the key.&lt;/P&gt;&lt;P&gt;Hope this helps!&lt;/P&gt;</description>
      <pubDate>Wed, 05 Oct 2016 05:48:27 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Loading-data-into-HBase-using-Pig-script/m-p/112602#M42709</guid>
      <dc:creator>StevenONeill</dc:creator>
      <dc:date>2016-10-05T05:48:27Z</dc:date>
    </item>
    <item>
      <title>Re: Loading data into HBase using Pig script</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Loading-data-into-HBase-using-Pig-script/m-p/112603#M42710</link>
      <description>&lt;P&gt;TBLPROPERTIES("hbase.table.name"="MyNamespace:MyTable")       &lt;/P&gt;&lt;P&gt; I am getting "FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask. MetaException(message:org.apache.hadoop.hbase.NamespaceNotFoundException: org.apache.hadoop.hbase.NamespaceNotFoundException: MyNamespace"   Please help us here&lt;/P&gt;</description>
      <pubDate>Wed, 05 Oct 2016 20:41:05 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Loading-data-into-HBase-using-Pig-script/m-p/112603#M42710</guid>
      <dc:creator>amit_dass</dc:creator>
      <dc:date>2016-10-05T20:41:05Z</dc:date>
    </item>
    <item>
      <title>Re: Loading data into HBase using Pig script</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Loading-data-into-HBase-using-Pig-script/m-p/112604#M42711</link>
      <description>&lt;P&gt;@Amit Dass, first create table in Hive inside database and that table name should match with TBLPROPERTIES table name. &lt;/P&gt;</description>
      <pubDate>Wed, 05 Oct 2016 21:25:00 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Loading-data-into-HBase-using-Pig-script/m-p/112604#M42711</guid>
      <dc:creator>maheshmsh88</dc:creator>
      <dc:date>2016-10-05T21:25:00Z</dc:date>
    </item>
    <item>
      <title>Re: Loading data into HBase using Pig script</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Loading-data-into-HBase-using-Pig-script/m-p/112605#M42712</link>
      <description>&lt;P&gt;In hbase, create a namespace and then create a table to avoid this error.&lt;/P&gt;</description>
      <pubDate>Tue, 03 Jul 2018 12:25:52 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Loading-data-into-HBase-using-Pig-script/m-p/112605#M42712</guid>
      <dc:creator>smedoji</dc:creator>
      <dc:date>2018-07-03T12:25:52Z</dc:date>
    </item>
  </channel>
</rss>

