Details
-
Improvement
-
Status: Resolved
-
Minor
-
Resolution: Fixed
-
None
-
None
Description
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
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" ]} ] }"#)?;
Then the compatibility gives the following error
assert!(SchemaCompatibility::can_read(&schema_v1, &schema_v2).is_err());
// Incompatible schemata! Field 'date' in reader schema must have a default value"
The error must not happen because date has the time alias
Attachments
Issue Links
- links to