简体   繁体   中英

echo map reduce output in shell script using oozie

The.sh script has the following content inside it

echo hbase org.apache.hadoop.hbase.mapreduce.RowCounter TABLE_NAME

The above script will be called by oozie which will capture whatever output the above command emits. The problem is, the above command is executed and no output gets echoed since all the output is happening in the background. How to capture those background output and echo it using shell script?

First thing first, you need to have <capture-output/> in the Oozie Shell action.

Also to capture the output in Oozie shell action, the script need to be something like the following:

set var=`hbase org.apache.hadoop.hbase.mapreduce.RowCounter TABLE_NAME`
echo "capture_var=$var"

After you do this, the variable will be available to be passed/used within Oozie using: ${wf:actionData('shellscriptoozieactionname')['capture_var']}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM