Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
None
-
None
-
None
-
Reviewed
Description
TypeCasting a bytearray field in the nested foreach below
A = load 'input.txt' as (a0:bytearray, a1:bytearray); B = group A by (a0,a1); C = FOREACH B GENERATE SIZE(A) as sizeofgroup, A; SPLIT C into D if sizeofgroup > 2, Z OTHERWISE; F = FOREACH D { F1 = FOREACH A generate (chararray) a0; GENERATE F1; } store F into '/tmp/output/F'; store Z into '/tmp/output/Z';
Fails with
Caused by: org.apache.pig.backend.executionengine.ExecException: ERROR 1075: Received a bytearray from the UDF or Union from two different Loaders. Cannot determine how to convert the bytearray to string for [a0[7,29]] at org.apache.pig.backend.hadoop.executionengine.physicalLayer.expressionOperators.POCast.getNextString(POCast.java:1126)