You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pig.apache.org by "Koji Noguchi (JIRA)" <ji...@apache.org> on 2018/04/05 19:15:00 UTC

[jira] [Commented] (PIG-5333) LoadCaster sometimes not set for complex type

    [ https://issues.apache.org/jira/browse/PIG-5333?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16427468#comment-16427468 ] 

Koji Noguchi commented on PIG-5333:
-----------------------------------

Looking at {{LineageFindRelVisitor.java}}, we update the uid to funcSpec mapping by calling {{addUidLoadFuncToMap}} method.  After that, we sometimes update all the fields inside any complex type (bag/map/tuple) by calling {{setLoadFuncForUids}} right after but sometimes not.

I don't see why we don't want to make this true for all the addUidLoadFuncToMap calls.  Uploading pig-5333-v01.patch which does that.

> LoadCaster sometimes not set for complex type
> ---------------------------------------------
>
>                 Key: PIG-5333
>                 URL: https://issues.apache.org/jira/browse/PIG-5333
>             Project: Pig
>          Issue Type: Bug
>            Reporter: Koji Noguchi
>            Assignee: Koji Noguchi
>            Priority: Major
>         Attachments: pig-5333-v01.patch
>
>
> TypeCasting a bytearray field in the nested foreach below
> {code}
> 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';
> {code}
> Fails with 
> {noformat}
> 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)
> {noformat}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)