2014-12-02 107 views

回答

4

下面是你可以从你的猪脚本中运行shell命令:

--declare a shell command 
%declare command `shell_command` 
file = LOAD 'file.txt' AS (colA:chararray, colB:int) ; 

file_processed = FOREACH file GENERATE colA, colB, (command) AS colC ; 

shell_command执行的结果将提供command这是在generate一步后取代。

+0

当在FOREACH中使用它的$命令时(或者在脚本中的任何地方)。 – 2015-07-10 14:08:00