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:11:00 UTC
[jira] [Updated] (AVRO-3515) Schema.Field equals method does not include the doc attribute
[ https://issues.apache.org/jira/browse/AVRO-3515?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Dominik Hons updated AVRO-3515:
-------------------------------
Attachment: AVRO-3515.patch
Status: Patch Available (was: Open)
> 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
> Priority: Minor
> Attachments: AVRO-3515.patch
>
>
> 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)