Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

Cannot run program "hive": error=2, by using Oozie workflow with sqoop and hive import

Cannot run program "hive": error=2, by using Oozie workflow with sqoop and hive import

New Contributor

hi all,

I am getting this error in Oozie by using sqoop and Hive import.

[main] ERROR org.apache.sqoop.tool.ImportTool  - Encountered IOException running import job: java.io.IOException: Cannot run program "hive": error=2, No such file or directory
Caused by: java.io.IOException: error=2, No such file or directory

Below is my Oozie workflow:
            <arg>import</arg>
            <arg>--connect</arg>
            <arg>jdbc:oracle:thin:@xxx</arg>
            <arg>--username</arg>
            <arg>abc</arg>
            <arg>--password</arg>
            <arg>abc</arg>
            <arg>--query</arg>
            <arg>SELECT STARTTIME FROM TEST WHERE STARTTIME BETWEEN TO_DATE('2017-06-08 14:00:00', 'YYYY-MM-DD HH24:MI:SS') AND TO_DATE('2017-06-08 14:10:59','YYYY-MM-DD HH24:MI:SS') AND  $CONDITIONS)</arg>
             <arg>--target-dir</arg>
             <arg>/${examplesRoot}/output-data/sqoop/mytest</arg>
             <arg>--hive-import</arg>
            <arg>--hive-overwrite</arg>
            <arg>--hive-table</arg>
            <arg>stest_tmp</arg>
            <arg>-m</arg>
            <arg>1</arg>
            <file>hdfs://localhost/sqoop/hive-site.xml</file>
Could you please help me with the error? What files that I am missing?

Thanks

5 REPLIES 5

Re: Cannot run program "hive": error=2, by using Oozie workflow with sqoop and hive import

Contributor

@JT Ng Check if you have oozie sharelib updated.

Also, try adding --hive-home in sqoop <arg>

<arg>--hive-home</arg>
<arg>path/to/hive_home</arg>

Re: Cannot run program "hive": error=2, by using Oozie workflow with sqoop and hive import

New Contributor

hi Shashank,

I added the args from your recommended. My job is killed but I dont see any ERROR in the log. Any idea ?

Thanks

JT

Re: Cannot run program "hive": error=2, by using Oozie workflow with sqoop and hive import

Rising Star

Are there any error messages in your log files?

Also, in the meantime, you might verify that you have a JDBC driver in /user/oozie/share/lib/lib_<timestamp>/sqoop.

Highlighted

Re: Cannot run program "hive": error=2, by using Oozie workflow with sqoop and hive import

Explorer

I am also facing the same error message when using sqoop with oozie only. If i run the sqoop command individually it is working fine. i have tried with adding hive-home as well but still i am facing the same error. Is there any other way which we can solve the problem.

Re: Cannot run program "hive": error=2, by using Oozie workflow with sqoop and hive import

New Contributor

was this problem solved, what is the fix?