You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Both fields aren't really used in the code, and make the existing code more complex. order has in its documentation that it is not used. position is only used in the SchemaAwareWriteSerializer where the value could also have been passed in as a function argument from the parent function.
Needing to fill the position fields make generating code in avro_derive significantly complex. So removing it would simplify a lot of code (we would also need to generate less code which makes T::get_schema() faster at runtime).
In the same vein, why is aliases a Option<Vec<String>>? All uses if if let Some(aliases) = field.aliases can be replaced by if !field.aliases.is_empty() and an empty Vec does not allocate.
In the same vein, why is aliases a Option<Vec<String>>? All uses if if let Some(aliases) = field.aliases can be replaced by if !field.aliases.is_empty() and an empty Vec does not allocate.
position is only used in the SchemaAwareWriteSerializer where the value could also have been passed in as a function argument from the parent function.
There is nothing about it in the spec.
+1 to remove it!
Activity
Kriskras99 commentedon Feb 27, 2026
In the same vein, why is
aliasesaOption<Vec<String>>? All uses ifif let Some(aliases) = field.aliasescan be replaced byif !field.aliases.is_empty()and an emptyVecdoes not allocate.martin-g commentedon Feb 27, 2026
https://avro.apache.org/docs/1.12.0/specification/#schema-record says:
and indeed the Rust SDK does not use it and AFAIR no user ever asked anything about it.
+1 to remove it!
martin-g commentedon Feb 27, 2026
I think I did it this way because of the
optionalinaliases: a JSON array of strings, providing alternate names for this field (optional).at https://avro.apache.org/docs/1.12.0/specification/#schema-recordYou are correct that it could be simplified!
+1 to do it!
martin-g commentedon Feb 27, 2026
There is nothing about it in the spec.
+1 to remove it!