[
https://issues.apache.org/jira/browse/AVRO-3248?focusedWorklogId=680580&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-680580
]
ASF GitHub Bot logged work on AVRO-3248:
----------------------------------------
Author: ASF GitHub Bot
Created on: 12/Nov/21 01:59
Start Date: 12/Nov/21 01:59
Worklog Time Spent: 10m
Work Description: lulitao1997 commented on pull request #1393:
URL: https://github.com/apache/avro/pull/1393#issuecomment-966756569
I checked and ur solution seems to be wrong if we have a union like this
["A", "B"]
where A and B are like this –
// A and B are the same except the name.
let schema_str_1 = r#"{
"name": "A",
"type": "record",
"fields": [
{"name": "field_one", "type": "float"}
]
}"#;
let schema_str_2 = r#"{
"name": "B",
"type": "record",
"fields": [
{"name": "field_one", "type": "float"}
]
}"#;
in this case, the schema found by a value will always be "A"'s schema.
this also applies to A, B being "fixed" type, which seems more plausible in
reallife (for example A =
{"name": "fieldA", "type": "fixed", "size": 10}
, B =
{"name": "fieldB", "type": "fixed", "size": 10}
)
here is my PR for these scenario . https://github.com/apache/avro/pull/1396
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
Issue Time Tracking
-------------------
Worklog Id: (was: 680580)
Time Spent: 0.5h (was: 20m)
> 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
> Assignee: Martin Tzvetanov Grigorov
> Priority: Major
> Labels: pull-request-available
> Time Spent: 0.5h
> Remaining Estimate: 0h
>
> 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.20.1#820001)