Issue with Microsecond Precision in Timestamp Conversion Using Kafka Sink Connector
I am using the following Debezium PostgreSQL connector configuration to capture changes from my PostgreSQL database and publish them to Kafka. My PostgreSQL table has an updated_at column of type timestamptz.
When I update or create any record in the table, the Debezium connector publishes a change log message to Kafka. The updated_at field in these messages is formatted with microseconds precision, such as 2022-01-21T07:45:42.232000Z.
Here is my connector configuration:
I have set time.precision.mode=connect, which should generate timestamp columns with milliseconds precision, but it is not working as expected.
I am using a Kafka sink connector that employs the TimestampConverter transformation to convert the updated_at string into a timestamp format suitable for Iceberg tables. However, the conversion fails due to the microseconds precision in the updated_at field. The TimestampConverter uses the SimpleDateFormat class in Java, which does not support microseconds precision.
Question: How can I handle the conversion of timestamps with microseconds precision in the updated_at field when using Kafka sink connectors? Are there any recommended approaches or configurations to ensure accurate conversion of these timestamps, given that time.precision.mode=connect should handle milliseconds precision but isn't working as expected?