全部,需要将变量从Shell Action传递到使用Hive的Oozie Shell
寻找将shell动作传递给oozie shell的变量。我在我的脚本中运行如下命令:
#!/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"
窍门是它是shell中的配置单元命令。
然后我运行这个得到它在Oozie的:
${wf:actionData('getPartitions')['evaldate']}
但它拉一个空白的每一次!我可以在我的shell中运行这些命令,它似乎工作,但oozie不。同样,如果我在群集的其他框上运行命令,它们也可以很好地运行。有任何想法吗?
我不确定您是否可以从shell操作调用配置单元查询。我建议你对配置单元查询使用配置单元操作,然后传递可以捕获的参数。另外不要忘记使用 –
KKa
嗯,我不认为你可以保存Hive动作的输出。从我的研究看来,你可以为shell/ssh/java操作,但Hive不能像写入磁盘那样操作。我之前为Sqoop运行过类似的操作 - 为什么它对于Sqoop而不是Hive? – theMJof91