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

Error message from Struct.validate() should include the name of the offending field.

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • None
    • 0.11.0.0
    • connect
    • None

    Description

      Take a look at this repro.

        @Test
        public void structValidate() {
          Schema schema = SchemaBuilder.struct()
              .field("one", Schema.STRING_SCHEMA)
              .field("two", Schema.STRING_SCHEMA)
              .field("three", Schema.STRING_SCHEMA)
              .build();
      
          Struct struct = new Struct(schema);
          struct.validate();
        }
      

      Any one of the fields could be causing the issue. The following exception is thrown. This makes troubleshooting missing fields in connectors much more difficult.

      org.apache.kafka.connect.errors.DataException: Invalid value: null used for required field
      

      The error message should include the field or fields in the error message.

      Attachments

        Issue Links

          Activity

            People

              Aegeaner Aegeaner
              jcustenborder Jeremy Custenborder
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: