You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@avro.apache.org by "Martin Tzvetanov Grigorov (Jira)" <ji...@apache.org> on 2023/12/12 10:21:00 UTC

[jira] [Resolved] (AVRO-3917) [Rust] Field aliases are not taken into account when calculating schema compatibility

     [ https://issues.apache.org/jira/browse/AVRO-3917?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Martin Tzvetanov Grigorov resolved AVRO-3917.
---------------------------------------------
    Fix Version/s: 1.12.0
                   1.11.4
         Assignee: Martin Tzvetanov Grigorov
       Resolution: Fixed

> [Rust] Field aliases are not taken into account when calculating schema compatibility
> -------------------------------------------------------------------------------------
>
>                 Key: AVRO-3917
>                 URL: https://issues.apache.org/jira/browse/AVRO-3917
>             Project: Apache Avro
>          Issue Type: Improvement
>            Reporter: Marcos
>            Assignee: Martin Tzvetanov Grigorov
>            Priority: Minor
>              Labels: pull-request-available
>             Fix For: 1.12.0, 1.11.4
>
>          Time Spent: 1h
>  Remaining Estimate: 0h
>
> When calculating the schema compatibility field aliases are not taken into account to calculate the end result, for example:
> The compatibility result for following schemas (writer schema_v1 and reader schema_v2) must be {*}Ok(()){*}, but it is not the case
>  
> {code:js}
> let schema_v1 = Schema::parse_str(r#"
> {
>     "type": "record",
>     "name": "Conference",
>     "namespace": "advdaba",
>      "fields": [
>          {"type": "string", "name": "name"},
>          {"type": "long", "name": "time"}
>      ]
> }"#)?;
> let schema_v2 = Schema::parse_str(r#"
> {
>     "type": "record",
>     "name": "Conference",
>     "namespace": "advdaba",
>      "fields": [
>          {"type": "string", "name": "name"},
>          {"type": "long", "name": "date", "aliases" : [ "time" ]}
>      ]
> }"#)?;
> {code}
>  
> Then the compatibility gives the following *error*
> {code:js}
> assert!(SchemaCompatibility::can_read(&schema_v1, &schema_v2).is_err());
> // Incompatible schemata! Field 'date' in reader schema must have a default value"
> {code}
> The error must not happen because *date* has the *time* alias



--
This message was sent by Atlassian Jira
(v8.20.10#820010)