是否可以从 pig 文件系统中的 unix 目录执行 shell 脚本命令?
最佳答案
以下是从 Pig 脚本中运行 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
步骤中替换。
关于shell - 在 pig 中执行本地 shell 脚本命令,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27248595/