java.util.Date is instantiated with the local time zone and this may result in a Date instance with a non-hour value or the wrong date value. It may be unnoticed or results in the error.
Caused by: org.apache.kafka.connect.errors.DataException: Kafka Connect Date type should not have any time fields set to non-zero values.
at org.apache.kafka.connect.data.Date.fromLogical(Date.java:64)
at io.confluent.connect.avro.AvroData$6.convert(AvroData.java:281)
at io.confluent.connect.avro.AvroData.fromConnectData(AvroData.java:425)
at io.confluent.connect.avro.AvroData.fromConnectData(AvroData.java:612)
at io.confluent.connect.avro.AvroData.fromConnectData(AvroData.java:371)
at io.confluent.connect.avro.AvroConverter.fromConnectData(AvroConverter.java:80)
at org.apache.kafka.connect.storage.Converter.fromConnectData(Converter.java:62)
at org.apache.kafka.connect.runtime.WorkerSourceTask.lambda$convertTransformedRecord$2(WorkerSourceTask.java:290)
at org.apache.kafka.connect.runtime.errors.RetryWithToleranceOperator.execAndRetry(RetryWithToleranceOperator.java:128)
at org.apache.kafka.connect.runtime.errors.RetryWithToleranceOperator.execAndHandleError(RetryWithToleranceOperator.java:162)
... 11 more
sql.Timestamp is instantiated at GenericJdbcTypeConverter.convertToJdbcTimeTypeFromAvroTimeType from the default string representation of avro date and not directly from its internal representation. As a result, the sub-seconds are dropped.
This PR fixes two date/time related issues.
java.util.Date is instantiated with the local time zone and this may result in a Date instance with a non-hour value or the wrong date value. It may be unnoticed or results in the error.
sql.Timestamp is instantiated at
GenericJdbcTypeConverter.convertToJdbcTimeTypeFromAvroTimeType
from the default string representation of avro date and not directly from its internal representation. As a result, the sub-seconds are dropped.