Hello:
I am by no means an expert, but we have been solving a similar problem,
capturing parameters from a shell action (not an ssh action, as ssh action is
more limited in what you can do (i.e., ssh only, as I understand)), and passing
it through a hive action to hive scripts. The shell script just needs to echo
the parameter as a "key=value" pair, like this:
# get today and yesterday's dates however you see fit, and echo them
echo "date_today=$date_today"
echo "date_yesterday=$date_yesterday"
Then the hive action can pass the parameters to the hive script like this:
<param>DATE_TODAY=${wf:actionData('name_of_the_shell_action_goes_here')['date_today']</param>
<param>DATE_YESTERDAY=${wf:actionData('name_of_the_shell_action_goes_here')['date_yesterday']</param>
The hive query in the hive action can then access the parameters like this:
SELECT * FROM foo where date = ${DATE_TODAY}
SELECT * FROM foo where date = ${DATE_YESTERDAY}
As for the specifics of the hive queries, I think that is a hive specific
question, and not much to do with oozie.
I hope this helps,
Richard.
On Nov 11, 2013, at 4:05 PMEST, P lva wrote:
> I need to periodically load files from local file system into hdfs and
> update hive table partitions. The query for updating the partitions depends
> on the timestamps(select * where date = "").
>
>
> The first part I'm presuming can be done using ssh action and hdfs -put,
> but I dont understand how to update partitions based on date.
>
> I could use Oozie EL but I need today's and yesterday's date. Moreover I
> don't understand how to capture date and pass it as a parameter into hive
> script.
>
> How do I Do this, any ideas ?