You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hive.apache.org by Ajay Chander <ha...@gmail.com> on 2016/04/07 02:50:53 UTC

Hive support in oozie shell action

Hi Everyone,

I am trying to execute a hive script in oozie shell action like below,

<workflow-app name="My_Workflow" xmlns="uri:oozie:workflow:0.5">
<start to="shell-0282"/>
<kill name="Kill">
<message>Action failed, error
message[${wf:errorMessage(wf:lastErrorNode())}]</message>
</kill>
<action name="shell-0282">
<shell xmlns="uri:oozie:shell-action:0.1">
<job-tracker>${jobTracker}</job-tracker>
<name-node>${nameNode}</name-node>
<exec>/user/hue/oozie/workspaces/hue-oozie-1459982183.04/b.sh</exec>
<file>/user/hue/oozie/workspaces/hue-oozie-1459982183.04/b.sh#b.sh</file>
<capture-output/>
</shell>
<ok to="End"/>
<error to="Kill"/>
</action>
<end name="End"/>
</workflow-app>


b.sh:

#!/bin/bash

hive -e "LOAD DATA INPATH '/user/test/landing_zone/file1 _*' INTO TABLE
mydb.Test"

It throws 'Launcher Error reason main class
[org.apache.oozie.action.hadoop.ShellMain] exit code [1] '

Any pointers ? Thanks for your time.