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

[Rust] Make it possible to use custom schema comparators

    XMLWordPrintableJSON

Details

    Description

      Currently comparing two schemas for equality compares their canonical forms - https://github.com/apache/avro/blob/main/lang/rust/avro/src/schema.rs#L160.
      I.e. the schemas are first serialized to their canonical forms and then compared as strings.

      The main issue here is the performance! The serialization takes it time!
      Comparing the schemas field by field (following the same rules as the canonical forms - https://avro.apache.org/docs/1.11.1/specification/#parsing-canonical-form-for-schemas) will return as soon as a field is different. For example: record schema with a different name will return false without comparing all the fields.

      Another request by users is to compare the schemas even with fields which are not part of the canonical form, e.g. the custom attributes - https://github.com/apache/avro/pull/2708#discussion_r1467183416

      Attachments

        Issue Links

          Activity

            People

              mgrigorov Martin Tzvetanov Grigorov
              mgrigorov Martin Tzvetanov Grigorov
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 40m
                  40m