You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pig.apache.org by "Joseph Adler (JIRA)" <ji...@apache.org> on 2013/10/08 00:37:42 UTC

[jira] [Commented] (PIG-3377) New AvroStorage throws NPE when storing untyped map/array/bag

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

Joseph Adler commented on PIG-3377:
-----------------------------------

Working on this now...

> New AvroStorage throws NPE when storing untyped map/array/bag
> -------------------------------------------------------------
>
>                 Key: PIG-3377
>                 URL: https://issues.apache.org/jira/browse/PIG-3377
>             Project: Pig
>          Issue Type: Bug
>          Components: internal-udfs
>            Reporter: Cheolsoo Park
>            Assignee: Joseph Adler
>             Fix For: 0.12.1
>
>
> The following example demonstrates the issue:
> {code}
> a = LOAD 'foo' AS (m:map[]);
> STORE a INTO 'bar' USING AvroStorage();
> {code}
> This fails with the following error:
> {code}
> java.lang.NullPointerException
>     at org.apache.pig.impl.util.avro.AvroStorageSchemaConversionUtilities.resourceFieldSchemaToAvroSchema(AvroStorageSchemaConversionUtilities.java:462)
>     at org.apache.pig.impl.util.avro.AvroStorageSchemaConversionUtilities.resourceSchemaToAvroSchema(AvroStorageSchemaConversionUtilities.java:335)
>     at org.apache.pig.builtin.AvroStorage.checkSchema(AvroStorage.java:472)
> {code}
> Similarly, untyped bag causes the following error:
> {code}
> Caused by: java.lang.NullPointerException
>     at org.apache.avro.Schema$ArraySchema.toJson(Schema.java:722)
>     ...
>     at org.apache.avro.Schema.getElementType(Schema.java:256)
>     at org.apache.pig.builtin.AvroStorage.setOutputAvroSchema(AvroStorage.java:491)
> {code}
> The problem is that AvroStorage cannot derive the output schema from untyped map/bag/tuple. When type is not defined, it should be assumed as bytearray.



--
This message was sent by Atlassian JIRA
(v6.1#6144)