I've added support for this to the Avro impl - https://github.com/apache/avro/pull/1525 I will merge it only if the Java behavior is approved.
On Fri, Feb 4, 2022 at 7:50 PM Ryan Skraba <[email protected]> wrote: > Just thinking out loud here, there might be a related-but-not-quite > ambiguity or bug with primitive type names! > > { > "type" : "record", > "name" : "int", > "namespace" : "mynamespace", > "fields" : [ > { "name" : "value", "type" : "long" }, > { "name" : "next", "type" : [ "null", "mynamespace.int" ] > } ] > } > > This is a valid linked list when you parse it with the Java SDK (the > record has a namespace). If you get the JSON representation, it > becomes: > > { > "type" : "record", > "name" : "int", > "namespace" : "mynamespace", > "fields" : [ > { "name" : "value", "type" : "long" }, > { "name" : "next", "type" : [ "null", "int" ] > } ] > } > > Which is no longer a linked list. Fun! > > In the meantime, I created > https://issues.apache.org/jira/browse/FLINK-25962 to try and make a > fix there. > > Best regards, Ryan > > > > On Fri, Feb 4, 2022 at 6:27 PM Oscar Westra van Holthe - Kind > <[email protected]> wrote: > > > > On fr 4 feb. 2022 15:00, Ryan Skraba <[email protected]> wrote: > > > > > [...] I'm not quite sure that there *is* any ambiguity with > > > the examples. A JSON object {"type": "record"} without any other > > > attributes can only be valid if we look at it as a type reference (not > > > a new RECORD type). Are we allowed to add arbitrary JSON properties > > > to a type reference? > > > > > > > No: that would either change the named type, or create a copy with > changes > > (and redefining a named type differently is not allowed). > > > > > > Kind regards, > > Oscar > > > > -- > > Oscar Westra van Holthe - Kind <[email protected]> > > > > > >
