avro-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Doug Cutting (JIRA)" <j...@apache.org>
Subject [jira] Commented: (AVRO-603) SpecificDatumReader requires the reader's schema to be set manually
Date Tue, 03 Aug 2010 20:38:17 GMT

    [ https://issues.apache.org/jira/browse/AVRO-603?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12895028#action_12895028

Doug Cutting commented on AVRO-603:

> the readers schema is readily available with an instance of the generic object

That doesn't work well if the reader's schema is a union.  The DatumReader pre-computes re-mappings
of fields, etc., so we don't want to specify a new reader's schema per instance but rather
one for a sequence of instances.  I guess we could check and only re-compute mappings etc.
when the instance schema is not double-equals to the previous instance's schema, but that
would perform poorly with unions.

> SpecificDatumReader requires the reader's schema to be set manually
> -------------------------------------------------------------------
>                 Key: AVRO-603
>                 URL: https://issues.apache.org/jira/browse/AVRO-603
>             Project: Avro
>          Issue Type: Improvement
>          Components: java
>            Reporter: Stu Hood
>            Priority: Minor
> Since SpecificDatumReader has actual objects with schemas attached to them, it would
seem that you wouldn't need to set the reader's schema: the default constructor only takes
one schema argument, so it seems to support this, but behind the scenes, it sets the readers/writers
to the same schema.
> Additionally, since DatumReader and its implementations use the terms 'expected' and
'actual' to refer to the 'reader' and 'writer' schemas, determining that you need to set the
reader's schema requires a code dive, rather than a glance at the javadocs.

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

View raw message