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

Connector throws NPE when using custom converter

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Major Major
    • None
    • 1.8.1.Final, 1.9.0.Alpha1, 1.9.0.Alpha2, 1.9.0.Beta1, 1.9.0.CR1
    • None
    • False
    • None
    • False

      In AbstractMysqlFieldReader, method readField, line 63

      // DBZ-2673
      // It is necessary to check the type names as types like ENUM and SET are
      // also reported as JDBC type char
      else if (!connectorConfig.customConverterRegistry().isEmpty() && TEXT_DATATYPES.contains(column.typeName())) {
      try {
          return rs.getString(columnIndex).getBytes(column.charsetName());
      }
      catch (UnsupportedEncodingException e) {
            logger.warn("Unsupported encoding '{}' for column '{}', sending value as String");
            return rs.getObject(columnIndex);
      }
      }
      

       

      here if we have a varchar whose value is null and we also configured a custom converter, rs.getString(columnIndex).getBytes(column.charsetName()) throws npe

       

      See also in https://github.com/apache/incubator-inlong/pull/3478

       

              Unassigned Unassigned
              ziruipeng sting peng (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: