Class MysqlDebeziumTimeConverter

  • All Implemented Interfaces:
    io.debezium.spi.converter.CustomConverter<org.apache.kafka.connect.data.SchemaBuilder,​io.debezium.spi.converter.RelationalColumn>

    public class MysqlDebeziumTimeConverter
    extends Object
    implements io.debezium.spi.converter.CustomConverter<org.apache.kafka.connect.data.SchemaBuilder,​io.debezium.spi.converter.RelationalColumn>
    Debezium converts the datetime type in MySQL into a UTC timestamp by default (Timestamp ), The time zone is hard-coded and cannot be changed. causing conversion errors part of the time Enable this converter to convert the four times "DATE", "DATETIME", "TIME", and "TIMESTAMP" into the format corresponding to the configured time zone (for example, yyyy-MM-dd)
    See Also:
    TinyIntOneToBooleanConverter
    • Field Detail

      • zoneId

        protected java.time.ZoneId zoneId
      • dateFormatter

        protected java.time.format.DateTimeFormatter dateFormatter
      • timeFormatter

        protected java.time.format.DateTimeFormatter timeFormatter
      • datetimeFormatter

        protected java.time.format.DateTimeFormatter datetimeFormatter
      • timestampFormatter

        protected java.time.format.DateTimeFormatter timestampFormatter
      • schemaNamePrefix

        protected String schemaNamePrefix
      • originalFormat

        protected static java.time.format.DateTimeFormatter originalFormat
      • parseNullDefaultValue

        protected Boolean parseNullDefaultValue
    • Constructor Detail

      • MysqlDebeziumTimeConverter

        public MysqlDebeziumTimeConverter()
    • Method Detail

      • configure

        public void configure​(Properties properties)
        Specified by:
        configure in interface io.debezium.spi.converter.CustomConverter<org.apache.kafka.connect.data.SchemaBuilder,​io.debezium.spi.converter.RelationalColumn>
      • converterFor

        public void converterFor​(io.debezium.spi.converter.RelationalColumn field,
                                 io.debezium.spi.converter.CustomConverter.ConverterRegistration<org.apache.kafka.connect.data.SchemaBuilder> registration)
        Specified by:
        converterFor in interface io.debezium.spi.converter.CustomConverter<org.apache.kafka.connect.data.SchemaBuilder,​io.debezium.spi.converter.RelationalColumn>
      • convertDateDefaultValue

        public Object convertDateDefaultValue​(io.debezium.spi.converter.RelationalColumn field)