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

ASF subversion and git services commented on AVRO-3759:
-------------------------------------------------------

Commit 1b9b0858e66968ce3a1d396e879e4803495030aa in avro's branch 
refs/heads/dependabot/cargo/lang/rust/master/libflate-1.4.0 from Martin Grigorov
[ https://gitbox.apache.org/repos/asf?p=avro.git;h=1b9b0858e ]

AVRO-3759: Add extra types for RecordSchema, EnumSchema, FixedSchema and 
DecimalSchema (#2241)

* AVRO-3759: Add extra types for RecordSchema, EnumSchema, FixedSchema and 
DecimalSchema

Signed-off-by: Martin Tzvetanov Grigorov <[email protected]>

* AVRO-3759: Add rustdoc to the new types

Signed-off-by: Martin Tzvetanov Grigorov <[email protected]>

---------

Signed-off-by: Martin Tzvetanov Grigorov <[email protected]>

> [Rust] Schema types inconsistency
> ---------------------------------
>
>                 Key: AVRO-3759
>                 URL: https://issues.apache.org/jira/browse/AVRO-3759
>             Project: Apache Avro
>          Issue Type: Improvement
>          Components: rust
>            Reporter: Fedor Telnov
>            Assignee: Martin Tzvetanov Grigorov
>            Priority: Major
>             Fix For: 1.12.0, 1.11.2
>
>
> That is how Unions and Records are defined in apache-avro Rust crate:
>  
> ```
>     /// A `union` Avro schema.
>     Union(UnionSchema),
>     /// A `record` Avro schema.
>     ///
>     /// The `lookup` table maps field names to their position in the `Vec`
>     /// of `fields`.
>     Record {
>         name: Name,
>         aliases: Aliases,
>         doc: Documentation,
>         fields: Vec<RecordField>,
>         lookup: BTreeMap<String, usize>,
>     },
> ```
>  
> That is inconsistent - one variant is defined with pattern Type(Type) which 
> is VERY convenient(for instance, it allows one to use UnionSchema as type), 
> and the other one(Record) is simply a struct variant, which is not very 
> convenient. My proposition is to hide Record's body in RecordSchema type and 
> use it here - just as you do with union. That would significantly help users, 
> as we can't use enum variants as types in Rust. It can also be done with 
> other schema types as well.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to