[
https://issues.apache.org/jira/browse/AVRO-3495?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17524514#comment-17524514
]
ASF subversion and git services commented on AVRO-3495:
-------------------------------------------------------
Commit 70b37a70e6efd3591af5921f231446c9b013593a in avro's branch
refs/heads/branch-1.11 from Martin Grigorov
[ https://gitbox.apache.org/repos/asf?p=avro.git;h=70b37a70e ]
AVRO-3495: Rust: Fields order should not matter (#1650)
* AVRO-3495: The order of the struct's fields and schema's fields should not
matter
Signed-off-by: Martin Tzvetanov Grigorov <[email protected]>
* AVRO-3495: Use the lookup table when comparing values against fields by name
Until now it was expected that both the schema fields and the input
values are sorted the same way.
Use BTreeMap instead of HashMap for the lookup table because otherwise
the assertion on the validation error messages is impossible due to
random printing of the map's entries
Signed-off-by: Martin Tzvetanov Grigorov <[email protected]>
* AVRO-3495: Update the test case
Signed-off-by: Martin Tzvetanov Grigorov <[email protected]>
(cherry picked from commit 3312b986e43252963d567e3b1137b8de33220696)
> Rust: Record serialization is sensitive to order of fields in struct
> --------------------------------------------------------------------
>
> Key: AVRO-3495
> URL: https://issues.apache.org/jira/browse/AVRO-3495
> Project: Apache Avro
> Issue Type: Bug
> Components: rust
> Reporter: Martin Tzvetanov Grigorov
> Assignee: Martin Tzvetanov Grigorov
> Priority: Major
> Labels: pull-request-available
> Time Spent: 20m
> Remaining Estimate: 0h
>
> Initially reported at: [https://github.com/flavray/avro-rs/issues/47]
>
> Trying to validate and write a record from the following struct:
> {code:java}
> #[derive(Deserialize, Serialize)]
> pub struct MyRecord {
> b: String,
> a: i64,
> }
> {code}
>
> using this schema:
> {code:java}
> {
> "type": "record",
> "name": "my_record",
> "fields": [
> {"name": "a", "type": "long"},
> {"name": "b", "type": "string"},
> ]
> } {code}
>
> fails because the order of the fields is not the same.
--
This message was sent by Atlassian Jira
(v8.20.7#820007)