[ https://issues.apache.org/jira/browse/PIG-3293?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13755016#comment-13755016 ]
Koji Noguchi commented on PIG-3293: ----------------------------------- I hit a worse case today. (1) Case I mentioned originally was with union between loaderA and loaderB in which both return the same loadCaster, Utf8StorageConverter. Typecast failing after the union. One I saw today. (2) Single Loader but with different argument resulting in a typecast error. {noformat} A = load 'data1' using LoaderA('col1') as (a:bytearray); B = load 'data1' using LoaderA('col2') as (a:bytearray); C = union ...; D = foreach C generate (chararray)a; store D ... {noformat} I wish I can simply check the classname of the loaders for the uniqueness of loadcaster. But then, I saw HBaseStorage returning different loadcaster depending on its input parameters. One other approach I'm thinking is, is it possible to push the typecast above the union so that we can perform loader.getLoadCaster().bytsToCharArray for each input to union ? > Casting fails after Union from two data sources&loaders > ------------------------------------------------------- > > Key: PIG-3293 > URL: https://issues.apache.org/jira/browse/PIG-3293 > Project: Pig > Issue Type: Bug > Reporter: Koji Noguchi > Priority: Minor > Attachments: pig-3293-test-only-v01.patch > > > Script similar to > {noformat} > A = load 'data1' using MyLoader() as (a:bytearray); > B = load 'data2' as (a:bytearray); > C = union onschema A,B; > D = foreach C generate (chararray)a; > Store D into './out'; > {noformat} > fails with > java.lang.Exception: org.apache.pig.backend.executionengine.ExecException: > ERROR 1075: Received a bytearray from the UDF. Cannot determine how to > convert the bytearray to string. > Both MyLoader and PigStorage use the default Utf8StorageConverter. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira