[
https://issues.apache.org/jira/browse/AVRO-3138?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17541299#comment-17541299
]
Ryan Skraba commented on AVRO-3138:
-----------------------------------
Hello! I think this problem is pretty well understood, and the *"new"*
field-ordering behaviour (no longer the "order of declaration") is a better
strategy moving forward. Reverting it doesn't seem like the right solution to
this problem.
I think we're perfectly willing to accept an option for use cases that rely on
the *"old"* field ordering convention and can't use reader/writer schema
resolution for some reason. We just need some guidance for how this can best be
done!
# A JVM system property set to true triggers the old behaviour, or
# The presence of an environment variable triggers the old behaviour, or
# A Java annotation can be used on the POJO to use the "order of declaration",
or
# We can explicitly set the field order on the POJO using some other Java
annotation -- {{@AvroFieldOrder}} doesn't exist yet :D, or
# An argument in the ReflectData instance determines which field order strategy
to use, or...
There's likely more alternatives. I don't have any strong opinions on the
issue. I kind of like (4) as a new feature that could be useful in other use
cases, but it also probably requires the most migration effort if you have lots
of Pojos. We could also do more than one of the above, if that's the right
thing to do.
If this is a critical issue to you, please weigh in!
> Incompatibility in the generation of schema between versions 1.9.x and 1.10.x
> ------------------------------------------------------------------------------
>
> Key: AVRO-3138
> URL: https://issues.apache.org/jira/browse/AVRO-3138
> Project: Apache Avro
> Issue Type: Bug
> Components: java
> Affects Versions: 1.10.0, 1.10.1, 1.10.2
> Reporter: Thiago Gutenberg Carvalho da Costa
> Priority: Critical
> Attachments: avro-schema-issue.zip
>
>
> During the generation of the schema with the ReflectData class, the order of
> the record fields in the generated schema is changing between version 1.9.2
> and 1.10.2
> Attached follows a project with a simple test demonstrating the problem.
--
This message was sent by Atlassian Jira
(v8.20.7#820007)