Roger created AVRO-2866:
---------------------------

             Summary: 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


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)

Reply via email to