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

Christophe Le Saec commented on AVRO-3520:
------------------------------------------

Finally, i tested it with changing : 
{code:java}
CustomEncoding.read(Object reuse, Decoder in, Schema.Field f)
{code}
See  [^patchTest.txt] 
It work well since i changed write test method with
{code:java}
  private byte[] write(Custom custom) {
    ReflectData rd = new ReflectData();
    Schema schema = rd.getSchema(Wrapper.class);
    ReflectDatumWriter<Wrapper> datumWriter = new ReflectDatumWriter<>(rd);
{code}
To prevent singleton issue.
This should also work when , "in the wild", you have to read some input stream 
with old version and some with new version.


> CustomEncoding doesn't expose the read schema
> ---------------------------------------------
>
>                 Key: AVRO-3520
>                 URL: https://issues.apache.org/jira/browse/AVRO-3520
>             Project: Apache Avro
>          Issue Type: Bug
>          Components: java
>    Affects Versions: 1.11.0
>            Reporter: Colin
>            Priority: Major
>              Labels: pull-request-available
>         Attachments: patchTest.txt
>
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> Currently it is not possible to detect a schema change when using 
> `CustomEncoding<T>`.



--
This message was sent by Atlassian Jira
(v8.20.7#820007)

Reply via email to