Hi,
I have strange problem. I defined Oozie Parameters for workflow where one of the action is shell script:
Oozie Parameters look like:
Name: year
Value: `date -d '1 hours ago' +%Y`
Name: month
Value: `date -d '1 hours ago' +%m`
Name: day
Value: `date -d '1 hours ago' +%d`
Name: hour
Value: `date -d '1 hours ago' +%H`
My Shell action file looks like:
hdfs_distribution_hive_and_impala.sh
#!/bin/bash
YEAR=$1
MONTH=$2
DAY=$3
HOUR=$4
SUCCESS__YEAR=`hadoop fs -stat /data/logfiles.db/install_callbacks_csv/year=${YEAR}`
SUCCESS__MONTH=`hadoop fs -stat /data/logfiles.db/install_callbacks_csv/year=${YEAR}/month=${MONTH}`
SUCCESS__DAY=`hadoop fs -stat /data/logfiles.db/install_callbacks_csv/year=${YEAR}/month=${MONTH}/day=${DAY}`
SUCCESS__HOUR=`hadoop fs -stat /data/logfiles.db/install_callbacks_csv/year=${YEAR}/month=${MONTH}/day=${DAY}/hour=${HOUR}`
I pass year, day month, and hour values via arguments. I am attaching screen with settings (hdfs.jpg)
However when I run job I am getting following error. It looks like passed arguments aren't executable and they are passed to shell scrip as String values:
Error Log:
Log Type: stderr
Log Length: 2307
stat: `/data/logfiles.db/install_callbacks_csv/year=`date': No such file or directory
stat: `-d': No such file or directory
stat: `'1': No such file or directory
stat: `ago'': No such file or directory
stat: `+%Y`': No such file or directory
stat: `/data/logfiles.db/install_callbacks_csv/year=`date': No such file or directory
stat: `-d': No such file or directory
stat: `'1': No such file or directory
stat: `ago'': No such file or directory
stat: `+%Y`/month=`date': No such file or directory
stat: `-d': No such file or directory
stat: `'1': No such file or directory
stat: `ago'': No such file or directory
stat: `+%m`': No such file or directory
stat: `/data/logfiles.db/install_callbacks_csv/year=`date': No such file or directory
stat: `-d': No such file or directory
stat: `'1': No such file or directory
stat: `ago'': No such file or directory
stat: `+%Y`/month=`date': No such file or directory
stat: `-d': No such file or directory
stat: `'1': No such file or directory
stat: `ago'': No such file or directory
stat: `+%m`/day=`date': No such file or directory
stat: `-d': No such file or directory
stat: `'1': No such file or directory
stat: `ago'': No such file or directory
stat: `+%d`': No such file or directory
stat: `/data/logfiles.db/install_callbacks_csv/year=`date': No such file or directory
stat: `-d': No such file or directory