猪的运行和执行实用程序命令差异

时间:2019-01-15 18:51:13

标签: hadoop apache-pig hadoop2

Apache Pig Utility命令提供了两种类似的命令类型,分别是run和exec,以便在grunt shell上执行pig脚本。为了不接受任何其他输入,我的问题是针对用例,在这种情况下使用run over exec命令确实很有用。

浏览apache pig文档-http://pig.apache.org/docs/r0.17.0/cmds.html#run,其中提供了有关这两个命令的非常详细的信息

grunt> cat myscript.pig
b = ORDER a BY name;
c = LIMIT b 10;

grunt> a = LOAD 'student' AS (name, age, gpa);

grunt> run myscript.pig

grunt> d = LIMIT c 3;

grunt> DUMP d;
(alice,20,2.47)
(alice,27,1.95)
(alice,36,2.27)

grunt> cat myscript.pig
a = LOAD 'student' AS (name, age, gpa);
b = LIMIT a 3;
DUMP b;

grunt> exec myscript.pig
(alice,20,2.47)
(luke,18,4.00)
(holly,24,3.27)

0 个答案:

没有答案