[ 
https://issues.apache.org/jira/browse/AVRO-2866?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17448115#comment-17448115
 ] 

Oscar Westra van Holthe - Kind edited comment on AVRO-2866 at 11/23/21, 4:53 PM:
---------------------------------------------------------------------------------

This is actually the same bug as AVRO-2867: default values on forward 
references are not handled properly.


was (Author: opwvhk):
This is actually the same bug as AVRO-2867

> Avro IDL: idl2schemata does not respect enum defaults on record fields
> ----------------------------------------------------------------------
>
>                 Key: AVRO-2866
>                 URL: https://issues.apache.org/jira/browse/AVRO-2866
>             Project: Apache Avro
>          Issue Type: Bug
>            Reporter: Roger
>            Priority: Major
>
> I ran the idl2schemata tool (using avro-tools release-1.10.0-rc1) on this 
> avdl file:
> {code:none}
> protocol p {
>       record R {
>               Color col = "RED";
>       }
>       enum Color {
>               RED,
>               BLUE
>       }
> }
> {code}
> I get this resulting file in R.avsc:
> {code:json}
> {
>   "type" : "record",
>   "name" : "R",
>   "fields" : [ {
>     "name" : "col",
>     "type" : {
>       "type" : "enum",
>       "name" : "Color",
>       "symbols" : [ "RED", "BLUE" ]
>     }
>   } ]
> }
> {code}
> There is no "default" in the R.col field, which means there's no way to 
> specify an enum-valued field that can later be removed in a backwardly 
> compatible way, or to add an enum-valued field that's compatible with old 
> schemas.
> I'd expect to see a {{"default": "RED"}} entry.



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

Reply via email to