You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@avro.apache.org by "Thiruvalluvan M. G. (JIRA)" <ji...@apache.org> on 2010/04/16 11:57:26 UTC

[jira] Updated: (AVRO-517) Resolving Decoder fails in some cases

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

Thiruvalluvan M. G. updated AVRO-517:
-------------------------------------

    Attachment: AVRO-517.patch

The trouble is that the ResolvingDecoder does not take care of the trailing field in the underlying BinaryDecoder. So part of the data belonging to the current object is left in the BinaryDecoder. GenericDatumReader constructs a new ResolvingDecoder for the next object. So the leftover integer field is read as a string of the next object.

This problem will not occur if the same ResolvingDecoder is used for all the objects. But that approach requires quite a bit of changes to GenericDatumReader. So I added a new method drain() in ResolvingDecoder, which,if called after reading the entire record as per reader's schema, drains the remaining unused portions.

> Resolving Decoder fails in some cases
> -------------------------------------
>
>                 Key: AVRO-517
>                 URL: https://issues.apache.org/jira/browse/AVRO-517
>             Project: Avro
>          Issue Type: Bug
>          Components: java
>    Affects Versions: 1.3.2
>            Reporter: Scott Carey
>            Assignee: Thiruvalluvan M. G.
>            Priority: Critical
>         Attachments: AVRO-517.patch
>
>
> User reports that reading an 'actual' schema of 
>  string, string, int
> fails when using an expected schema of:
>  string, string
> Sample code and details in the comments.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira