Our Community is getting an upgrade! To get everything ready for the relaunch, we’ll be placing the site in read-only mode starting September 21st.
We really appreciate your understanding while we get things set up behind the scenes. Catch up on all the exciting details about the move here.
Need help or have questions? Drop us a line at [email protected]

Support Questions

Find answers, ask questions, and share your expertise
Announcements
Share your experience with Cloudera on G2 and get a $25 Amazon Gift card.
Hi, I'm CLEO! Something exciting is coming to the Community. Stay Tuned!

Execute hive hql file from oozie shell action in Ambari

avatar
Explorer

Hi Team, 

 

I have a requirement where I need to schedule an oozie work flow using shell action. Shell action is using a shell script which in turn will be calling a hql file which is available on HDFS location.

 

I am not able to call that hql file from the shell script which I am using in shell action. 

I know using beeline - f parameters to use to call local files but can you please guide me to call a file which is on HDFS.

 

Any help/suggestions will be highly appreciated.

 

Thanks, 

Wasim

1 ACCEPTED SOLUTION

avatar
Explorer

Thank you all for your responses. This issue was because of credential problem and it's resolved now.

 

View solution in original post

2 REPLIES 2

avatar
Master Collaborator

Hi @wasimakram ,

 

Are you facing any issues/errors while calling the hive script ? can you share your workflow.xml file to have a look?

Below is the simple example for it:

 

<workflow-app xmlns = "uri:oozie:workflow:0.4" name = "simple-Workflow">

   <start to = "fork_node" />

   

   <fork name = "fork_node">

      <path start = "Create_External_Table"/>

      <path start = "Create_orc_Table"/>

   </fork>

   

   <action name = "Create_External_Table">

      <hive xmlns = "uri:oozie:hive-action:0.4">

         <job-tracker>xyz.com:8088</job-tracker>

         <name-node>hdfs://rootname</name-node>

         <script>hdfs_path_of_script/external.hive</script>

      </hive>

      

    <ok to = "end" />

      <error to = "kill_job" />

   </action>

   

   <kill name = "kill_job">

      <message>Job failed</message>

   </kill>

   

   <end name = "end" />

 

</workflow-app>

 

Regards,

Chethan YM

avatar
Explorer

Thank you all for your responses. This issue was because of credential problem and it's resolved now.