You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@avro.apache.org by "ASF GitHub Bot (Jira)" <ji...@apache.org> on 2022/05/17 12:38:00 UTC

[jira] [Work logged] (AVRO-3374) [Java] Fully qualified type reference "ns.int" loses namespace.

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

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

                Author: ASF GitHub Bot
            Created on: 17/May/22 12:37
            Start Date: 17/May/22 12:37
    Worklog Time Spent: 10m 
      Work Description: clesaec opened a new pull request, #1688:
URL: https://github.com/apache/avro/pull/1688

   Make sure you have checked _all_ steps below.
   
   ### Jira
   
   - [x] My PR addresses the following [Avro Jira](https://issues.apache.org/jira/browse/AVRO/) issues and references them in the PR title. For example, "AVRO-1234: My Avro PR"
     - https://issues.apache.org/jira/browse/AVRO-XXX
     - In case you are adding a dependency, check if the license complies with the [ASF 3rd Party License Policy](https://www.apache.org/legal/resolved.html#category-x).
   
   ### Tests
   
   - [x] My PR adds the following unit tests TestSchema.testParseRecordWithNameAsType and TestSchema.testQualifiedName
   
   ### Commits
   
   - [x] My commits all reference Jira issues in their subject lines. In addition, my commits follow the guidelines from "[How to write a good git commit message](https://chris.beams.io/posts/git-commit/)":
     1. Subject is separated from body by a blank line
     1. Subject is limited to 50 characters (not including Jira issue reference)
     1. Subject does not end with a period
     1. Subject uses the imperative mood ("add", not "adding")
     1. Body wraps at 72 characters
     1. Body explains "what" and "why", not "how"
   
   ### Documentation
   
   - [ ] In case of new functionality, my PR adds documentation that describes how to use it.
     - All the public functions and the classes in the PR contain Javadoc that explain what it does (no adding functionality nor modified public classes)
     
   




Issue Time Tracking
-------------------

            Worklog Id:     (was: 771299)
    Remaining Estimate: 0h
            Time Spent: 10m

> [Java] Fully qualified type reference "ns.int" loses namespace.
> ---------------------------------------------------------------
>
>                 Key: AVRO-3374
>                 URL: https://issues.apache.org/jira/browse/AVRO-3374
>             Project: Apache Avro
>          Issue Type: Bug
>          Components: java
>    Affects Versions: 1.11.0
>            Reporter: Ryan Skraba
>            Assignee: Christophe Le Saec
>            Priority: Minor
>         Attachments: AVRO-3374.patch
>
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> While brainstorming for AVRO-3370, I came across this special case where a type-reference could be considered ambiguous if the SDK is not careful when simplifying inherited namespaces:
> {code:json}
> {
>   "type" : "record",
>   "name" : "ns.int",
>   "fields" : [ 
>     {"name" : "value", "type" : "int"}, 
>     {"name" : "next", "type" : [ "null", "ns.int" ]}
>   ]
> }
> {code}
> In Java, if this code is parsed, it works as expected (as a linked list).
> If the schema is turned to a String using toString(), the namespace is dropped off the last {*}{{ns.int}}{*}, turning it into the primitive. That string can still be parsed into a Schema, but the "round-trip" modifies the schema in an incompatible way.
> That namespace shouldn't be dropped when producing the JSON string representing the Schema in Java.



--
This message was sent by Atlassian Jira
(v8.20.7#820007)