Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想在我的一个猪作业的输出文件路径中使用今天的日期,该作业假设每天运行,有没有办法做到这一点。就像是 /user/x/$todaysDate
/user/x/$todaysDate
通过 bash 执行此操作:
echo '/user/x/'`date +%Y-%m-%d`
给出:
/user/x/2012-10-14
因此,您可以将脚本执行为:
$ pig -param outpath='/user/x/'`date +%Y-%m-%d` myscript.pig
然后,在您的STORE命令中,使用$outpath:
STORE
$outpath
STORE abc INTO '$outpath';