[
https://issues.apache.org/jira/browse/PIG-3412?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13739160#comment-13739160
]
Cheolsoo Park commented on PIG-3412:
------------------------------------
+1.
> jsonstorage breaks when tuple does not have as many columns as schema
> ---------------------------------------------------------------------
>
> Key: PIG-3412
> URL: https://issues.apache.org/jira/browse/PIG-3412
> Project: Pig
> Issue Type: Improvement
> Affects Versions: 0.11
> Reporter: Adam Silberstein
> Fix For: 0.11
>
> Attachments: jsonStoragePatch.patch
>
>
> Noticed this error when doing something like
> A = flatten(STRSPLIT($0, ',', 3)) AS (col1:chararray, col2:chararray,
> col3:chararray);
> STORE A INTO 'foo' USING JsonStorage();
> If the string being split doesn't generate 3 columns, then JsonStorage errors
> out with an index exception. This is because it tries to read the fields of
> the tuple passed to it or not. See JsonStorage, line 148.
> MY patch checks the length of the tuple. If any schema column positions are
> past the length of the tuple, it fills in null.
--
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