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

[rust] Some code when checking schema compatibility is never reached

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • None
    • 1.12.0, 1.11.4
    • None

    Description

      When checking schema compatibility between schemas some code blocks are never reached. For example, these lines are never reached because writer and readers schemas are for sure the same type (record) which is previously compared.

      This issue leads to unnecessary if let blocks which can be suppressed and `Errors` that are never reached. For example the following code could be removed because it is know before hand that the schema is Record which it has a name and only one error can be retrieved.

       let Schema::Record(RecordSchema { name: w_name, .. }) = writers_schema { ... } 
      

      Solution: Refactor the code and add more unittest to match_schemas function to clean up the unreachable code

      Attachments

        Activity

          People

            mgrigorov Martin Tzvetanov Grigorov
            marcosschroh Marcos Schroh
            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 - 2h
                2h