[ 
https://issues.apache.org/jira/browse/AVRO-637?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12904075#action_12904075
 ] 

Philip Zeyliger commented on AVRO-637:
--------------------------------------

The schema we're talking about here is '{"type":"array", "items":"string"}', 
no?  In Java, "array" reads "List" to me.  For the generated code, List is the 
closest match we've got.  (The generated code is not a good match for things 
that don't fit into memory, so I'm not persuaded by the Iterable argument.)  
General types are nice for writing, but they're a massive pain for reading.  I 
recently wrote an RPC Server using Avro Java, and the lack of get() on an array 
that the client wrote was quite irritating (hence I'm a big fan of this jira).  
At this layer, I think you have to choose the interfaces that are closest to 
the implementation.

> GenericArray should implement Collection
> ----------------------------------------
>
>                 Key: AVRO-637
>                 URL: https://issues.apache.org/jira/browse/AVRO-637
>             Project: Avro
>          Issue Type: New Feature
>          Components: java
>            Reporter: Doug Cutting
>            Assignee: Doug Cutting
>             Fix For: 1.5.0
>
>         Attachments: AVRO-637.patch, AVRO-637.patch
>
>
> It would be nice if Avro arrays were better integrated with Java collections. 
>  The GenericArray interface permits array element reuse, which is awkward 
> with java.util.Collection.  But if GenericArray implemented Collection and 
> the Avro runtime permitted arbitrary Collection implementations to be passed 
> for Arrays then it would simplify many applications.  The runtime could still 
> reuse elements if an array implemented GenericArray, so performance would not 
> suffer for applications that, e.g., loop over a data file, reusing instances.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to