Uploaded image for project: 'Kafka'
  1. Kafka
  2. KAFKA-4810

SchemaBuilder should be more lax about checking that fields are unset if they are being set to the same value

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 0.10.2.0
    • 0.11.0.0
    • connect

    Description

      Currently SchemaBuilder is strict when checking that certain fields have not been set yet (e.g. version, name, doc). It just checks that the field is null. This is intended to protect the user from buggy code that overwrites a field with different values, but it's a bit too strict currently. In generic code for converting schemas (e.g. Converters) you will sometimes initialize a builder with these values (e.g. because you get a SchemaBuilder for a logical type, which sets name & version), but then have generic code for setting name & version from the source schema.

      We saw this bug in practice with Confluent's AvroConverter, so it's likely it could trip up others as well. You can work around the issue, but it would be nice if exceptions were only thrown if you try to overwrite an existing value with a different value.

      Attachments

        Activity

          People

            pshk4r Vitaly Pushkar
            ewencp Ewen Cheslack-Postava
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - 1h
                1h
                Remaining:
                Remaining Estimate - 1h
                1h
                Logged:
                Time Spent - Not Specified
                Not Specified