You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@avro.apache.org by "Roger (Jira)" <ji...@apache.org> on 2020/06/19 10:37:00 UTC
[jira] [Updated] (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:all-tabpanel ]
Roger updated AVRO-2866:
------------------------
Description:
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.
was:
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.
> 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.3.4#803005)