我使用Pig 0.12.1。为什么我得到一个错误,当我做JOIN
由LEFT OUTER
FILTER
后?
下面是修改后的示例:
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
试试这个,您可以通过
访问price列D = FILTER C BY $3 > 2.0;
or
D = FILTER C BY B::price > 2.0;
尝试计算关系中的所有NULL
。
D = FILTER C BY price > 2.0 AND price is not null;