avro-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gavin DeSchutter (JIRA)" <j...@apache.org>
Subject [jira] [Comment Edited] (AVRO-1815) Incompatible schema change not detected when wrapped in a UNION
Date Tue, 27 Jun 2017 21:54:00 GMT

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

Gavin DeSchutter edited comment on AVRO-1815 at 6/27/17 9:53 PM:
-----------------------------------------------------------------

We are encountering similar issues when using `full transitive` compatibility.
Here is an example schema:
{code:javascript}
{
  "type": "record",
  "name": "Foo",
  "namespace": "events",
  "fields": [
    {
      "name": "bar",
      "type": {
        "type": "record",
        "name": "Bar",
        "fields": [
          {
            "name": "baz",
            "type":
            [
              "string",
              {
                "type": "record",
                "name": "Baz",
                "fields": [
                  {
                    "name": "customer",
                    "type": "boolean"
                  }
                ]
              }
            ]  
          }
        ]
      }
    }
  ]
}
{code}

Altering the field of `customer` to `["int", "string"]` does not return an incompatibility
error.


was (Author: gdeschut):
We are encountering similar issues when using `full transitive` compatibility.
Here is an example schema:
{code:json}
{
  "type": "record",
  "name": "Foo",
  "namespace": "events",
  "fields": [
    {
      "name": "bar",
      "type": {
        "type": "record",
        "name": "Bar",
        "fields": [
          {
            "name": "baz",
            "type":
            [
              "string",
              {
                "type": "record",
                "name": "Baz",
                "fields": [
                  {
                    "name": "customer",
                    "type": "boolean"
                  }
                ]
              }
            ]  
          }
        ]
      }
    }
  ]
}
{code}

Altering the field of `customer` to `["int", "string"]` does not return an incompatibility
error.

> Incompatible schema change not detected when wrapped in a UNION
> ---------------------------------------------------------------
>
>                 Key: AVRO-1815
>                 URL: https://issues.apache.org/jira/browse/AVRO-1815
>             Project: Avro
>          Issue Type: Bug
>          Components: java
>    Affects Versions: 1.7.7
>            Reporter: Martin Boyle
>         Attachments: AVRO-1815.patch
>
>
> An incompatible schema change is not detected when it is in a UNION and the change is
to the value type of a map e.g. 
> field 
>  { "name": "segmentEkv", "type": ["null", {"type": "map", "values": {"type": "map", "values":
"string"}}], "default": null},
> changes to 
>  { "name": "segmentEkv", "type": ["null", {"type": "map", "values": {"type": "array",
"items": "int"}}], "default": null},
> The SchemaValidatorBuilder() will pass this as being compatible.  Whereas SchemaCompatibility.check_reader_writer_compatibility
will return an incompatible result.  The problem for me is that the Confluent Schema Registry
uses SchemaValidatorBuilder.
> Problem appears to be that while the ResolvingGrammerGenerator correctly marks the field
as being an incompatible change, the check for errors on the Symbol object does not descend
into the UnionAdjustActionField



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Mime
View raw message