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

Ryan Skraba commented on AVRO-2689:
-----------------------------------

To check evolution with {{tojson}}, we'd probably want to specify the reader 
schema in the GenericDatumReader created here:
 
[https://github.com/apache/avro/blob/master/lang/java/tools/src/main/java/org/apache/avro/tool/DataFileReadTool.java#L75]
 
 The writer schema is automatically set when the DataFileStream is created.  If 
we want to set a different reader schema (than the one found in the file), it 
should be set by calling
{code:java}
reader.setExpected(readerSchema){code}
just after the DataFileStream is created.

> Avro-tools should have a way to test schema evolution.
> ------------------------------------------------------
>
>                 Key: AVRO-2689
>                 URL: https://issues.apache.org/jira/browse/AVRO-2689
>             Project: Apache Avro
>          Issue Type: Improvement
>          Components: java
>            Reporter: Ryan Skraba
>            Priority: Major
>
> The avro-tools command line should have at least one way to test 
> reading/writing with an evolved schema.  This would be useful for testing 
> schema evolution and reproducing errors or bug reports from the command line.
> A good candidate would be to add a {{--reader-schema}} option to the 
> {{tojson}} tool (where the writer schema comes from the data file).
> Alternatively, the {{fragtojson}} already takes the writer schema and we 
> could add {{--reader-schema-file}}.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to