Uploaded image for project: 'Debezium'
  1. Debezium
  2. DBZ-1183

ArrayIndexOutOfBoundsException when calling handleEvent

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Cannot Reproduce
    • Icon: Major Major
    • None
    • 0.8.3.Final
    • mysql-connector
    • None

      In the "io.debezium.relational.TableSchemaBuilder.createValueGenerator" method,there are some codes bellow:

      return (row) -> {
      Struct result = new Struct(schema);
      for (int i = 0; i != numFields; ++i) {
      Object value = row[recordIndexes[i]];
      ValueConverter converter = converters[i];
      if (converter != null) {
      value = value == null ? value : converter.convert(value);
      try

      { result.put(fields[i], value); }

      catch (DataException e) {
      Column col = columns.get;
      LOGGER.error("Failed to properly convert key value for '{}.{}' of type {} for row {}:",
      columnSetName, col.name(), col.typeName(), row, e);
      }
      }
      }
      return result;
      };

      In extreme cases, row.size is not equal numFields,so ArrayIndexOutOfBoundsException throws.

      eg. If Failed to commit offsets,and the connector task quit.Before we restart the connector,an column added ,and new table schema generated.So the data from old offset not matches current table schema .Bellow codes throw an ArrayIndexOutOfBoundsException

              Unassigned Unassigned
              gabrywu gabry.wu gabry.wu (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: