我正在使用Pig 0.12.1。在FILTER
JOIN
后LEFT OUTER
A = LOAD '$file1' USING PigStorage('\t') AS (idA:int, manufacturer:chararray);
B = LOAD '$file2' USING PigStorage('\t') AS (idB:int, price:float);
C = JOIN A BY idA LEFT OUTER, B BY idB;
D = FILTER C BY price > 2.0;
后,为什么会出现错误?
这是一个修改过的例子:
D
为什么我会得到这个"无效的标量投影" ERROR pig.PigServer: exception during parsing: Error during parsing. Pig script failed to parse:
Invalid scalar projection: D
上的错误:
{{1}}
答案 0 :(得分:3)
试试这个, 您可以按
访问价格列D = FILTER C BY $3 > 2.0;
or
D = FILTER C BY B::price > 2.0;
答案 1 :(得分:0)
尝试计算关系中的任何NULL
。
D = FILTER C BY price > 2.0 AND price is not null;