在 Pig 中执行 JOIN 然后 FILTER 后出现"Invalid scalar projection"错误



我使用Pig 0.12.1。为什么我得到一个错误,当我做JOINLEFT 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;

相关内容

  • 没有找到相关文章

最新更新