gpt4 book ai didi

hadoop - 运行 PIG 脚本时出错

转载 作者:可可西里 更新时间:2023-11-01 16:13:00 26 4
gpt4 key购买 nike

x = load '/home/manish/Work/inputs/testInput.txt' using PigStorage(',') AS (key:chararray , value:int);
y = group x bt key;
r = foreach y { m = generate x.value AS one; ord_m = ORDER m BY one desc; lim_m = LIMIT ord_m 3; generate group, lim_m;};

获取错误为:

2014-12-09 20:07:45,978 [main] ERROR org.apache.pig.tools.grunt.Grunt - ERROR 1200: <line 4, column 29>  mismatched input 'x' expecting LEFT_PAREN

即在第三行。

r = foreach y { m = generate x.value AS one; ord_m = ORDER m BY one desc; lim_m = LIMIT ord_m 3; generate group, lim_m;};

最佳答案

你能试试这个吗?

x = load '/home/manish/Work/inputs/testInput.txt' using PigStorage(',') AS (key:int , value:int);
y = group x by key;
r = foreach y {
ord_m = ORDER x BY value desc;
lim_m = LIMIT ord_m 3;
generate group, lim_m;
};
dump r;

关于hadoop - 运行 PIG 脚本时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27381834/

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