Oozie shell Action - Running hive from shell issue Oozie shell Action - Running hive from shell issue hadoop hadoop

Oozie shell Action - Running hive from shell issue


Ok finally I figured it out .Might be a trivial thing for experts on Shell but can help someone starting out.

1. hive : command not found It was not a classpath issue.It was a shell issue.The environment i am running in is a korn shell (echo $SHELL to find out). But the hive script(/usr/lib/hive/bin/hive.sh) is a bash shell.So i changed the shebang (#! /bin/bash) in my script and it worked.

2.Delegation Token can only be issued with kerberos or web authentication.In my hive script i added SET mapreduce.job.credentials.binary = ${HADOOP_TOKEN_FILE_LOCATION} HADOOP_TOKEN_FILE_LOCATION is a variable that holds the location of jobToken.This token needs to be passed for authentication of access to HDFS data(in my case,an HDFS read operation,through Hive Select query) in a secure cluster.Know more on Delegation Token Here .


Obviously, u miss shell environment variables.

To confirm it, use export in called shell by oozie.

If u use oozie call shell, a simple way is use /bin/bash -l your_script.

PS. PATH is a list of directories, so u need append ${HIVE_HOME}/bin to your PATH not ${HIVE_HOME}/bin/hive.