-
Notifications
You must be signed in to change notification settings - Fork 221
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make TextualFromNative output deterministic #222
Comments
Hello, I am also experiencing this issue. |
checking |
Another way to make it deterministic would be to keep the order of the fields in the records in the schema. It would be consistent with what produce Avro library for Java and also with avro-tools. In general the question of being deterministic is not just to have a consistent JSON representation: the result of going Binary -> Native -> Textual -> Native -> Binary should get you back where you started. And this should be the case regardless of which platform created the first binary. A lot of Avro data around here has been created in Hadoop by Java processes so I think this library should be consistent with it. For the same reason, maps should try to keep the ordering all along. This means it can not simply use Go's map implementation. An equivalent of Java's LinkedHashMap should be used instead. |
TextualFromNative output is not deterministic due to the underlying map type used for the data struct.
Ideally the method should be deterministic similarly to what the json.Marshal already does by sorting the map keys.
Current behaviour:
Result:
The text was updated successfully, but these errors were encountered: