gpt4 book ai didi

shell - 在 pig 中执行本地 shell 脚本命令

转载 作者:可可西里 更新时间:2023-11-01 14:28:46 25 4
gpt4 key购买 nike

是否可以从 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/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com