<?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: Load Hive Table form Pig Output File. in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/Load-Hive-Table-form-Pig-Output-File/m-p/217361#M179270</link>
    <description>&lt;P&gt;Hi &lt;A rel="user" href="https://community.cloudera.com/users/17037/ishvari.html" nodeid="17037"&gt;@Ishvari Dhimmar&lt;/A&gt;&lt;/P&gt;&lt;P&gt;As stated by Ervits after flattening the pig output to remove bags if there are any use the file to load into a hive table. &lt;/P&gt;&lt;P&gt;For loading into a hive table use " load data inpath &amp;lt;pig out output file&amp;gt; into table &amp;lt;hive table name&amp;gt;".&lt;/P&gt;&lt;P&gt;Ensure that the format of the pig output file is compatible with hive native formats. If you do so then you will achieve what you are looking for.  &lt;/P&gt;</description>
    <pubDate>Wed, 03 May 2017 03:05:47 GMT</pubDate>
    <dc:creator>balavignesh_nag</dc:creator>
    <dc:date>2017-05-03T03:05:47Z</dc:date>
    <item>
      <title>Load Hive Table form Pig Output File.</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Load-Hive-Table-form-Pig-Output-File/m-p/217359#M179268</link>
      <description>&lt;P&gt;For submit &lt;STRONG&gt;Hive&lt;/STRONG&gt;, &lt;STRONG&gt;Pig &lt;/STRONG&gt;job in Azure &lt;STRONG&gt;HDInsight&lt;/STRONG&gt;, I am using .&lt;STRONG&gt;Net SDK&lt;/STRONG&gt;. After successfully output of &lt;STRONG&gt;Pig &lt;/STRONG&gt;Job ,I used &lt;STRONG&gt;Pig &lt;/STRONG&gt;output file to load into H&lt;STRONG&gt;ive &lt;/STRONG&gt;table. &lt;STRONG&gt;Hive &lt;/STRONG&gt;job executed successfully but &lt;STRONG&gt;Pig &lt;/STRONG&gt;output is in &lt;STRONG&gt;BAG &lt;/STRONG&gt;format , so its store data in &lt;STRONG&gt;Hive &lt;/STRONG&gt;table like "&lt;STRONG&gt;(&lt;/STRONG&gt;" , "&lt;STRONG&gt;)&lt;/STRONG&gt;" &lt;STRONG&gt;characters&lt;/STRONG&gt;. Means &lt;STRONG&gt;First &lt;/STRONG&gt;and &lt;STRONG&gt;Last column &lt;/STRONG&gt;of &lt;STRONG&gt;Hive &lt;/STRONG&gt;table having these &lt;STRONG&gt;characters&lt;/STRONG&gt;. I want to &lt;STRONG&gt;remove &lt;/STRONG&gt;this characters from &lt;STRONG&gt;Hive &lt;/STRONG&gt;table. Should I have to change the &lt;STRONG&gt;Pig &lt;/STRONG&gt;output &lt;STRONG&gt;format &lt;/STRONG&gt;or Is this anyway to &lt;STRONG&gt;remove &lt;/STRONG&gt;above &lt;STRONG&gt;character &lt;/STRONG&gt;from &lt;STRONG&gt;Hive &lt;/STRONG&gt;Table ?&lt;/P&gt;&lt;P&gt;Please give solution.&lt;/P&gt;&lt;P&gt;Thank You.&lt;/P&gt;</description>
      <pubDate>Tue, 02 May 2017 14:24:29 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Load-Hive-Table-form-Pig-Output-File/m-p/217359#M179268</guid>
      <dc:creator>ishvari</dc:creator>
      <dc:date>2017-05-02T14:24:29Z</dc:date>
    </item>
    <item>
      <title>Re: Load Hive Table form Pig Output File.</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Load-Hive-Table-form-Pig-Output-File/m-p/217360#M179269</link>
      <description>&lt;P&gt;You can use flatten operator to remove bag thus removing the extra characters &lt;A href="http://pig.apache.org/docs/r0.16.0/basic.html#flatten" target="_blank"&gt;http://pig.apache.org/docs/r0.16.0/basic.html#flatten&lt;/A&gt; so before you finish generating the file with Pig, call the flatten operator and then load it in aHive table&lt;/P&gt;&lt;PRE&gt;grunt&amp;gt; cat empty.bag
{}      1
grunt&amp;gt; A = LOAD 'empty.bag' AS (b : bag{}, i : int);
grunt&amp;gt; B = FOREACH A GENERATE flatten(b), i;
grunt&amp;gt; DUMP B;
grunt&amp;gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 02 May 2017 15:13:26 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Load-Hive-Table-form-Pig-Output-File/m-p/217360#M179269</guid>
      <dc:creator>aervits</dc:creator>
      <dc:date>2017-05-02T15:13:26Z</dc:date>
    </item>
    <item>
      <title>Re: Load Hive Table form Pig Output File.</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Load-Hive-Table-form-Pig-Output-File/m-p/217361#M179270</link>
      <description>&lt;P&gt;Hi &lt;A rel="user" href="https://community.cloudera.com/users/17037/ishvari.html" nodeid="17037"&gt;@Ishvari Dhimmar&lt;/A&gt;&lt;/P&gt;&lt;P&gt;As stated by Ervits after flattening the pig output to remove bags if there are any use the file to load into a hive table. &lt;/P&gt;&lt;P&gt;For loading into a hive table use " load data inpath &amp;lt;pig out output file&amp;gt; into table &amp;lt;hive table name&amp;gt;".&lt;/P&gt;&lt;P&gt;Ensure that the format of the pig output file is compatible with hive native formats. If you do so then you will achieve what you are looking for.  &lt;/P&gt;</description>
      <pubDate>Wed, 03 May 2017 03:05:47 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Load-Hive-Table-form-Pig-Output-File/m-p/217361#M179270</guid>
      <dc:creator>balavignesh_nag</dc:creator>
      <dc:date>2017-05-03T03:05:47Z</dc:date>
    </item>
  </channel>
</rss>

