<?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 Sqoop to import data to Hive through oozie shell action fails in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Sqoop-to-import-data-to-Hive-through-oozie-shell-action/m-p/133155#M31502</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I am running a oozie shell action to run a sqoop command to import data to Hive. When I run the sqoop command directly, it works fine, but when I run it through oozie shell action, it aborts with &lt;/P&gt;&lt;PRE&gt;Failing Oozie Launcher, Main class [org.apache.oozie.action.hadoop.ShellMain], exit code [1]&lt;/PRE&gt;&lt;P&gt;Based on this link, &lt;/P&gt;&lt;P&gt;&lt;A href="https://community.hortonworks.com/questions/25121/oozie-execute-sqoop-falls.html#answer-25290"&gt;https://community.hortonworks.com/questions/25121/oozie-execute-sqoop-falls.html#answer-25290&lt;/A&gt;&lt;/P&gt;&lt;P&gt;I have added hive-site.xml also using &amp;lt;file&amp;gt; tag in oozie shell action and also based on other link I have added &lt;/P&gt;&lt;PRE&gt;export HIVE_CONF_DIR=`pwd` &lt;/PRE&gt;&lt;P&gt;before running the sqoop command. But nothing worked. When I add full hive-site.xml it resulted in the same error above, when I added just the important properties mentioned in this link &lt;A href="http://ingest.tips/2014/11/27/how-to-oozie-sqoop-hive/"&gt;http://ingest.tips/2014/11/27/how-to-oozie-sqoop-hive/&lt;/A&gt;, I get this error&lt;/P&gt;&lt;PRE&gt;FAILED: IllegalStateException Unxpected Exception thrown: Unable to fetch table XYZ. java.net.SocketException: Connection resetFailing Oozie Launcher, Main class [org.apache.oozie.action.hadoop.ShellMain], exit code [1]&lt;/PRE&gt;&lt;P&gt;Both the times, the sqoop command successfully creates the file in target-directory but fails while loading this data to hive. &lt;/P&gt;&lt;P&gt;Hadoop cluster is kerberos enabled. I have a kinit done before submitting the workflow and also kinit is done again inside the oozie shell action.&lt;/P&gt;&lt;P&gt;Can someone please throw some light on how to fix this one? below is the sqoop command used.  &lt;/P&gt;&lt;PRE&gt;Sqoop command:sqoop import \
--connect "jdbc:teradata://${server}/database=${db},logmech=ldap" \
--driver "com.teradata.jdbc.TeraDriver" \
--table "XYZ" \
--split-by "col1" \
--hive-import \
--delete-target-dir \
--target-dir "/user/test/" \
--hive-table "default.XYZ" \
--username "terauser" \
--password tdpwd \
--where "${CONDITION}" \
--m 2 \
--fetch-size 1000 \
--hive-drop-import-delims \
--fields-terminated-by '\001' \
--lines-terminated-by '\n' \
--null-string '\\N' \
--null-non-string '\\N'&lt;/PRE&gt;</description>
    <pubDate>Fri, 10 Jun 2016 19:43:08 GMT</pubDate>
    <dc:creator>mraghuram_87</dc:creator>
    <dc:date>2016-06-10T19:43:08Z</dc:date>
    <item>
      <title>Sqoop to import data to Hive through oozie shell action fails</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Sqoop-to-import-data-to-Hive-through-oozie-shell-action/m-p/133155#M31502</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I am running a oozie shell action to run a sqoop command to import data to Hive. When I run the sqoop command directly, it works fine, but when I run it through oozie shell action, it aborts with &lt;/P&gt;&lt;PRE&gt;Failing Oozie Launcher, Main class [org.apache.oozie.action.hadoop.ShellMain], exit code [1]&lt;/PRE&gt;&lt;P&gt;Based on this link, &lt;/P&gt;&lt;P&gt;&lt;A href="https://community.hortonworks.com/questions/25121/oozie-execute-sqoop-falls.html#answer-25290"&gt;https://community.hortonworks.com/questions/25121/oozie-execute-sqoop-falls.html#answer-25290&lt;/A&gt;&lt;/P&gt;&lt;P&gt;I have added hive-site.xml also using &amp;lt;file&amp;gt; tag in oozie shell action and also based on other link I have added &lt;/P&gt;&lt;PRE&gt;export HIVE_CONF_DIR=`pwd` &lt;/PRE&gt;&lt;P&gt;before running the sqoop command. But nothing worked. When I add full hive-site.xml it resulted in the same error above, when I added just the important properties mentioned in this link &lt;A href="http://ingest.tips/2014/11/27/how-to-oozie-sqoop-hive/"&gt;http://ingest.tips/2014/11/27/how-to-oozie-sqoop-hive/&lt;/A&gt;, I get this error&lt;/P&gt;&lt;PRE&gt;FAILED: IllegalStateException Unxpected Exception thrown: Unable to fetch table XYZ. java.net.SocketException: Connection resetFailing Oozie Launcher, Main class [org.apache.oozie.action.hadoop.ShellMain], exit code [1]&lt;/PRE&gt;&lt;P&gt;Both the times, the sqoop command successfully creates the file in target-directory but fails while loading this data to hive. &lt;/P&gt;&lt;P&gt;Hadoop cluster is kerberos enabled. I have a kinit done before submitting the workflow and also kinit is done again inside the oozie shell action.&lt;/P&gt;&lt;P&gt;Can someone please throw some light on how to fix this one? below is the sqoop command used.  &lt;/P&gt;&lt;PRE&gt;Sqoop command:sqoop import \
--connect "jdbc:teradata://${server}/database=${db},logmech=ldap" \
--driver "com.teradata.jdbc.TeraDriver" \
--table "XYZ" \
--split-by "col1" \
--hive-import \
--delete-target-dir \
--target-dir "/user/test/" \
--hive-table "default.XYZ" \
--username "terauser" \
--password tdpwd \
--where "${CONDITION}" \
--m 2 \
--fetch-size 1000 \
--hive-drop-import-delims \
--fields-terminated-by '\001' \
--lines-terminated-by '\n' \
--null-string '\\N' \
--null-non-string '\\N'&lt;/PRE&gt;</description>
      <pubDate>Fri, 10 Jun 2016 19:43:08 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Sqoop-to-import-data-to-Hive-through-oozie-shell-action/m-p/133155#M31502</guid>
      <dc:creator>mraghuram_87</dc:creator>
      <dc:date>2016-06-10T19:43:08Z</dc:date>
    </item>
    <item>
      <title>Re: Sqoop to import data to Hive through oozie shell action fails</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Sqoop-to-import-data-to-Hive-through-oozie-shell-action/m-p/133156#M31503</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;Since it's a exit code [1] error, you'll need to get more information about what is causing the exit code.&lt;/P&gt;&lt;P&gt;Find out the application ID of the job launched:&lt;/P&gt;&lt;PRE&gt;yarn application -list -appTypes ALL&lt;/PRE&gt;&lt;P&gt;su - as the user used to launch the job and run:&lt;/P&gt;&lt;PRE&gt;yarn logs -applicationId &amp;lt;application ID&amp;gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 10 Jun 2016 22:26:25 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Sqoop-to-import-data-to-Hive-through-oozie-shell-action/m-p/133156#M31503</guid>
      <dc:creator>aanghel</dc:creator>
      <dc:date>2016-06-10T22:26:25Z</dc:date>
    </item>
    <item>
      <title>Re: Sqoop to import data to Hive through oozie shell action fails</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Sqoop-to-import-data-to-Hive-through-oozie-shell-action/m-p/133157#M31504</link>
      <description>&lt;P&gt;Hi, I checked the logs. No information found as to why the script aborted.  This is all is shown in the log.&lt;/P&gt;&lt;PRE&gt;INFO hive.HiveImport: Loading uploaded data into Hive
WARN conf.HiveConf: HiveConf of name hive.metastore.pre-event.listeners does not exist
WARN conf.HiveConf: HiveConf of name hive.semantic.analyzer.factory.impl does not exist
Logging initialized using configuration in jar:file:/grid/8/hadoop/yarn/local/filecache/5470/hive-common-1.2.1.2.3.4.0-3485.jar!/hive-log4j.properties
Failing Oozie Launcher, Main class [org.apache.oozie.action.hadoop.ShellMain], exit code [1]&lt;/PRE&gt;</description>
      <pubDate>Tue, 14 Jun 2016 13:56:01 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Sqoop-to-import-data-to-Hive-through-oozie-shell-action/m-p/133157#M31504</guid>
      <dc:creator>mraghuram_87</dc:creator>
      <dc:date>2016-06-14T13:56:01Z</dc:date>
    </item>
    <item>
      <title>Re: Sqoop to import data to Hive through oozie shell action fails</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Sqoop-to-import-data-to-Hive-through-oozie-shell-action/m-p/133158#M31505</link>
      <description>&lt;P&gt;When I added the hive-site.xml first, I missed a few properties, now I added all properties mentioned by &lt;A rel="user" href="https://community.cloudera.com/users/2875/fengyeyouni.html" nodeid="2875"&gt;@allen huang&lt;/A&gt;&lt;/P&gt;&lt;P&gt;in this link &lt;/P&gt;&lt;PRE&gt;&lt;A href="https://community.hortonworks.com/questions/25121/oozie-execute-sqoop-falls.html#answer-25291" target="_blank"&gt;https://community.hortonworks.com/questions/25121/oozie-execute-sqoop-falls.html#answer-25291&lt;/A&gt;&lt;/PRE&gt;&lt;P&gt;So even if the sqoop is called using ooziee shell action, I had to add hive-site.xml with properties mentioned by Allen. &lt;/P&gt;&lt;P&gt;Thank you Allen :). My script is working fine now.&lt;/P&gt;</description>
      <pubDate>Tue, 14 Jun 2016 15:56:08 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Sqoop-to-import-data-to-Hive-through-oozie-shell-action/m-p/133158#M31505</guid>
      <dc:creator>mraghuram_87</dc:creator>
      <dc:date>2016-06-14T15:56:08Z</dc:date>
    </item>
  </channel>
</rss>

