You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@avro.apache.org by "Dominik Hons (Jira)" <ji...@apache.org> on 2022/05/10 11:05:00 UTC

[jira] [Created] (AVRO-3515) Schema.Field equals method does not include the doc attribute

Dominik Hons created AVRO-3515:
----------------------------------

             Summary: Schema.Field equals method does not include the doc attribute
                 Key: AVRO-3515
                 URL: https://issues.apache.org/jira/browse/AVRO-3515
             Project: Apache Avro
          Issue Type: Bug
          Components: java
    Affects Versions: 1.11.0
            Reporter: Dominik Hons


The org.apache.avro.Schema.Field class contains attribute {*}doc{*}. However, it is not included in the equals method, which results in problems with schema evolution.

 

This test currently fails, because both Fields are considered equal.
{code:java}
@Test
public void testFieldEquality() {
  Schema schema = Schema.createRecord("r", "doc", "namespace", false);

  Field fieldWithDoc = new Field("f", schema, "doc");
  Field fieldWithoutDoc = new Field("f", schema);

  assertNotEquals(fieldWithDoc, fieldWithoutDoc);
} {code}



--
This message was sent by Atlassian Jira
(v8.20.7#820007)