[
https://issues.apache.org/jira/browse/AVRO-3248?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17439336#comment-17439336
]
Lu Litao commented on AVRO-3248:
--------------------------------
Sure,
say we want to create a UnionSchema: ["RecordA", "RecordB"],
when we call UnionSchema::new, it will produce error on follow (schema.rs:320)
```
let kind = SchemaKind::from(schema);
if vindex.insert(kind, i).is_some() {
return Err(Error::GetUnionDuplicate);
}
```
that is becaues RecordA and RecordB both have SchemaKind::Record, and it did
not differentiate records with different names.
note that we are allowed to have union with types of different names
ref: https://avro.apache.org/docs/current/spec.html#Unions
> Rust: Support named types in UnionSchema
> ----------------------------------------
>
> Key: AVRO-3248
> URL: https://issues.apache.org/jira/browse/AVRO-3248
> Project: Apache Avro
> Issue Type: Improvement
> Reporter: Lu Litao
> Priority: Major
>
> currently there's no support for named type in avro's Union type in rust.
> as stated in this comment of the UnionSchma struct
> {quote}// Used to ensure uniqueness of schema inputs, and provide constant
> time finding of the
> // schema index given a value.
> // **NOTE** that this approach does not work for named types, and will have
> to be modified
> // to support that. A simple solution is to also keep a mapping of the names
> used.
> {quote}
--
This message was sent by Atlassian Jira
(v8.3.4#803005)