You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@avro.apache.org by "Michael A. Smith (Jira)" <ji...@apache.org> on 2019/11/03 02:38:00 UTC

[jira] [Updated] (AVRO-2226) UnionSchema deduction is too permissive

     [ https://issues.apache.org/jira/browse/AVRO-2226?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Michael A. Smith updated AVRO-2226:
-----------------------------------
    Resolution: Fixed
        Status: Resolved  (was: Patch Available)

> UnionSchema deduction is too permissive
> ---------------------------------------
>
>                 Key: AVRO-2226
>                 URL: https://issues.apache.org/jira/browse/AVRO-2226
>             Project: Apache Avro
>          Issue Type: Bug
>          Components: python
>    Affects Versions: 1.8.2
>            Reporter: Andrew Kelleher
>            Priority: Major
>         Attachments: AVRO-2226.patch
>
>   Original Estimate: 24h
>  Remaining Estimate: 24h
>
> When given a schema of the form
> {code:java}
> {
>   "type" : "record",
>   "name" : "A",
>   "namespace" : "com.example",
>   "fields" : [
>     {
>       "name" : "foo",
>       "type" : ["string", "null"]
>     }
>   ]
> }
> {
>   "type" : "record",
>   "name" : "B",
>   "namespace" : "com.example",
>   "fields" : [
>     {
>       "name" : "bar",
>       "type" : ["string", "null"]
>     }
>   ]
> }
> {
>   "type" : "record",
>   "name" : "AOrB",
>   "namespace" : "com.example",
>   "fields" : [
>     {
>       "name" : "entity",
>       "type" : [
>         "com.example.A",
>         "com.example.B"
>       ]
>     }
>   ]
> }
> {code}
> And a datum of the form
> {code}
> {'entity': {'foo': 'this is an instance of schema A'}}{code}
> Converting to a message, and then from a message chooses the incorrect `entity` schema:
> {code}
> {'entity': {'bar': None}}{code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)