[
https://issues.apache.org/jira/browse/PIG-3420?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13738854#comment-13738854
]
Rohini Palaniswamy commented on PIG-3420:
-----------------------------------------
Few comments on the patch:
1) You can skip the type cast in
v = innerMap.get((String) key);
2) Keep the braces for if else block.
{code}
+ if (v instanceof Utf8)
return v.toString();
- } else {
+ else
return v;
- }
{code}
3) Can't we fix newSchemaFromRequiredFieldList to handle maps and bgas instead
of catching AvroRunTimeException ?
> Failed to retrieve values from data loaded by AvroStorage
> ---------------------------------------------------------
>
> Key: PIG-3420
> URL: https://issues.apache.org/jira/browse/PIG-3420
> Project: Pig
> Issue Type: Bug
> Components: impl
> Affects Versions: 0.12
> Reporter: Yuanli Dong
> Fix For: 0.12
>
> Attachments: PIG-3420_08122013.patch
>
>
> Running the following script:
> a = load './newavro/data/avro/EmployeeMapF.ser' USING AvroStorage();
> dump a;
> c = foreach a generate name, office, 'Toyota', cars#'Toyota' as toyota,
> 'Mazda', cars#'Mazda', 'Nissan', cars#'Nissan' as nissan;
> Although object a has all the data loaded, c cannot retrieve the map values,
> column 4,6,8 are empty in the result.
> The map keys is of class Utf8, but the keys used to retrieve data is String,
> that is the reason why we cannot retrieve the values. The patch fix this
> problem.
--
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