[
https://issues.apache.org/jira/browse/AVRO-3370?focusedWorklogId=724742&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-724742
]
ASF GitHub Bot logged work on AVRO-3370:
----------------------------------------
Author: ASF GitHub Bot
Created on: 10/Feb/22 20:39
Start Date: 10/Feb/22 20:39
Worklog Time Spent: 10m
Work Description: netlify[bot] edited a comment on pull request #1533:
URL: https://github.com/apache/avro/pull/1533#issuecomment-1035486821
❌ Deploy Preview for *avro-website-preview* failed.
🔨 Explore the source changes: 4c5d61b4b81732b77d2fcb77f5ac6f61059c848f
🔍 Inspect the deploy log:
[https://app.netlify.com/sites/avro-website-preview/deploys/620577fe1146090007831539](https://app.netlify.com/sites/avro-website-preview/deploys/620577fe1146090007831539)
--
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: 724742)
Time Spent: 40m (was: 0.5h)
> [Spec] Inconsistent behaviour on types as invalid names.
> --------------------------------------------------------
>
> Key: AVRO-3370
> URL: https://issues.apache.org/jira/browse/AVRO-3370
> Project: Apache Avro
> Issue Type: Bug
> Reporter: Ryan Skraba
> Priority: Major
> Labels: pull-request-available
> Fix For: 1.11.1
>
> Time Spent: 40m
> Remaining Estimate: 0h
>
> We've run across this in some code that interoperates between Java and Python.
> The spec [currently
> forbids|https://avro.apache.org/docs/current/spec.html#names] using a
> primitive type name as a keyword: _*Primitive type names have no namespace
> and their names may not be defined in any namespace.*_
> {code:java}
> {"type":"record","name":"long","fields":[{"name":"a1","type":"long"}]} {code}
> That fails in Java with {{"org.apache.avro.AvroTypeException: Schemas may not
> be named after primitives: long"}}
> What do we expect to happen when a named schema uses a complex type?
> {code:java}
> {"type":"record","name":"record","fields":[{"name":"a1","type":"long"}]}
> {code}
> This currently *succeeds* in Java and the schema can be used to serialize and
> deserialize data.
> This currently *fails* in Python with: {{avro.schema.SchemaParseException:
> record is a reserved type name}}
> Which one is the correct behaviour?
> This gets a bit more complicated when we consider using the name as a
> reference.
> The following two schemas both work in Java:
> {code:java}
> {"type":"record","name":"LinkedList",
> "fields":[
> {"name":"value","type":"int},
> {"name":"next","type":["null","LinkedList"]}]}" {code}
> {code:java}
> {"type":"record","name":"LinkedList",
> "fields":[
> {"name":"value","type":"int},
> {"name":"next","type":["null",{"type":"LinkedList"}]}]}"
> {code}
> If we rename {{LinkedList}} to {{record}} the former succeeds in Java and the
> latter fails with {{{}org.apache.avro.SchemaParseException: No name in
> schema: {"type":"record"{}}}}
--
This message was sent by Atlassian Jira
(v8.20.1#820001)