2014-12-02 106 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