[ 
https://issues.apache.org/jira/browse/AVRO-3433?focusedWorklogId=738008&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-738008
 ]

ASF GitHub Bot logged work on AVRO-3433:
----------------------------------------

                Author: ASF GitHub Bot
            Created on: 08/Mar/22 08:21
            Start Date: 08/Mar/22 08:21
    Worklog Time Spent: 10m 
      Work Description: travisbrown commented on pull request #1582:
URL: https://github.com/apache/avro/pull/1582#issuecomment-1061521571


   @jklamer That approach looks reasonable to me, including the names, although 
off the top of my head I don't know what terminology the Java tooling uses 
here, and I think it would make sense to aim for consistency.
   
   Semi-relatedly, the idea of `Name` being hashed and compared by fullname 
with the specific representation and aliases being ignored seems like it could 
cause problems down the line: sooner or later someone will try to put them in a 
set, etc., and get an unpleasant surprise. What do you think about something 
like having a `Fullname` type that would be a simple string wrapper with a safe 
constructor, using that for these map keys, and having `fullname()` on `Name` 
return `Fullname` instances?
   
   


-- 
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: 738008)
    Time Spent: 5.5h  (was: 5h 20m)

> Rust: The canonical form should preserve schema references
> ----------------------------------------------------------
>
>                 Key: AVRO-3433
>                 URL: https://issues.apache.org/jira/browse/AVRO-3433
>             Project: Apache Avro
>          Issue Type: Bug
>          Components: rust
>    Affects Versions: 1.12.0
>            Reporter: Martin Tzvetanov Grigorov
>            Assignee: Martin Tzvetanov Grigorov
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 1.11.1, 1.12.0
>
>          Time Spent: 5.5h
>  Remaining Estimate: 0h
>
> Reported at 
> [https://github.com/flavray/avro-rs/issues/182#issuecomment-1059762821]
> =================================
> There still seems to be an issue with {{can't refine}} errors, at least in 
> some non-recursive cases. Take the following example:
> {code:java}
> fn main() {
>     let schema = r#"
>     {
>       "name": "test.test",
>       "type": "record",
>       "fields": [
>         {
>           "name": "bar",
>           "type": { "name": "test.foo", "type": "record", "fields": [{ 
> "name": "id", "type": "long" }] }
>         },
>         { "name": "baz", "type": "test.foo" }
>       ]
>     }
>     "#;
>     let schema = apache_avro::schema::Schema::parse_str(&schema).unwrap();
>     println!("{}", serde_json::to_string(&schema).unwrap());
> } {code}
> This prints the following (the same thing happens if the {{test.foo}} 
> definition is in a separate file):
> {code:java}
> $ target/release/avro-test | jq
> {
>   "type": "record",
>   "name": "test.test",
>   "fields": [
>     {
>       "name": "bar",
>       "type": {
>         "type": "record",
>         "name": "test.foo",
>         "fields": [
>           {
>             "name": "id",
>             "type": "long"
>           }
>         ]
>       }
>     },
>     {
>       "name": "baz",
>       "type": {
>         "type": "record",
>         "name": "test.foo",
>         "fields": [
>           {
>             "name": "id",
>             "type": "long"
>           }
>         ]
>       }
>     }
>   ]
> } {code}
> Which will cause the Java tooling to fail with the 
> {{org.apache.avro.SchemaParseException: Can't redefine: test}} error above.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

Reply via email to