You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@avro.apache.org by "Oscar Westra van Holthe - Kind (Jira)" <ji...@apache.org> on 2021/11/23 16:53:00 UTC

[jira] [Commented] (AVRO-2866) Avro IDL: idl2schemata does not respect enum defaults on record fields

    [ 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 commented on AVRO-2866:
------------------------------------------------------

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)