[ 
https://issues.apache.org/jira/browse/AVRO-1183?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Doug Cutting updated AVRO-1183:
-------------------------------

    Resolution: Fixed
        Status: Resolved  (was: Patch Available)

I added a test and committed this.
                
> Avro Pair fails to initialize when either they key or value is a list.
> ----------------------------------------------------------------------
>
>                 Key: AVRO-1183
>                 URL: https://issues.apache.org/jira/browse/AVRO-1183
>             Project: Avro
>          Issue Type: Bug
>          Components: java
>    Affects Versions: 1.7.2
>            Reporter: Jeffrey Theobald
>            Assignee: Doug Cutting
>            Priority: Minor
>             Fix For: 1.7.3
>
>         Attachments: AVRO-1183.patch
>
>
> Hello,
> It seems that a change somewhere between 1.5.7 and 1.7.2 (maybe AVRO-966 ?) 
> has broken the Avro Pair object, so that you can no longer instantiate a pair 
> when either the key or the value is a list.
> To replicate this bug, try the following:
> {code}
> Integer key = new Integer(0);
> List<Integer> list = new ArrayList<Integer>();
> Pair<Integer, List<Integer>> pair = new Pair<Integer, List<Integer>>(key, 
> list);
> {code}
> It will produce something like the following exception:
> {noformat}org.apache.avro.AvroRuntimeException: Can't find element type of 
> Collection
>       at 
> org.apache.avro.reflect.ReflectData.createSchema(ReflectData.java:281)
>       at 
> org.apache.avro.specific.SpecificData.getSchema(SpecificData.java:151)
>       at org.apache.avro.mapred.Pair.<init>(Pair.java:312)
>         .....SNIP.....
> {noformat}
> I've used Integer here for illustration but it also affects SpecificRecord 
> objects.

--
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

Reply via email to