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

[Rust] incorrect compatibility checks with logicalType uuid

    XMLWordPrintableJSON

Details

    Description

      A schema with a logicalType uuid field is incompatible with itself, per `SchemaCompatibility`:

       

      use apache_avro::{Schema, schema_compatibility::SchemaCompatibility};
      
      fn main() {     
          let schema_str = r#"\{"type": "string", "logicalType": "uuid"}"#;
          let writers_schema = Schema::parse_str(schema_str).unwrap();
          let readers_schema = Schema::parse_str(schema_str).unwrap();
          if let Err(err) = SchemaCompatibility::can_read(&writers_schema, &readers_schema) {
              eprintln!("Error: {}", err);
          }
      }
      

       

      this is the behavior on `main` as of writing (`876eae32`) and on the latest version on crates.rs (`v0.16.0`)

      I have a proposed fix here: https://github.com/apache/avro/compare/main...mknaw:avro:logical-type-compat-fix

      Perhaps there are other valid logicalTypes with this behavior. I have not checked every logicalType yet.

      Attachments

        Issue Links

          Activity

            People

              mgrigorov Martin Tzvetanov Grigorov
              mknaw mknaw
              Votes:
              0 Vote for this issue
              Watchers:
              3 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 - 0.5h
                  0.5h