Uploaded image for project: 'Apache Avro'
  1. Apache Avro
  2. AVRO-3515

Schema.Field equals method does not include the doc attribute

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Not A Bug
    • 1.11.0
    • None
    • java
    • None

    Description

      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.

      @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);
      } 

      Attachments

        1. AVRO-3515.patch
          2 kB
          Dominik Hons

        Activity

          People

            Unassigned Unassigned
            dominik.hons Dominik Hons
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: