You must pass the variable from Shell Action to Oozie Shell using Hive

All,

Looking at passing a variable from shell action to oozie shell. I run commands like in my script:

#!/bin/sh
evalDate="hive -e 'set hive.execution.engine=mr; select     max(cast(create_date as int)) from db.table;'"
evalPartition=$(eval $evalBaais)
echo "evaldate=$evalPartition"

The trick is that it is a shell hive team.

Then I run this to get it in oozie:

${wf:actionData('getPartitions')['evaldate']}

But he confuses every time! I can run these commands in my shell and it seems to work, but no. Similarly, if I run commands in other cells in the cluster, they also work fine. Any ideas?

+4
source share
2 answers

The problem was setting up my cluster. When I worked as an oozie user, I had problems with permission to write to / tmp / yarn. With this, I changed the command to run:

baais = "export HADOOP_USER_NAME = functionid; hive yarn -hiveconf hive.execution.engine = mr -e 'select max (cast (create_date as int)) db.table;'"

.

+1

-S hive . (. )

, "evalBaais"? , "evalDate". :

#!/bin/sh
evalDate="hive -S -e 'set hive.execution.engine=mr; select            max(cast(create_date as int)) from db.table;'"
evalPartition=$(eval $evalDate)
echo "evaldate=$evalPartition"

.

0

All Articles