CC-24785
The Java.Sql.Date datatype only contains the day, month and year information and does not have the time. In the Kafka record it is stored as an integer which signifies the number of days since epoch date. When we bind it to the preparedStatement to build the insert query, we're using the db.timezone config on it to update it. Anything that is before the UTC will subtract the date by 1 because while applying the timezone it is assumed that the value of time is 00:00:00Z.
Solution
Added a config date.timezone to control what timezone to be used for converting the Date. The config is added to maintain backward compatibility. The default behaviour of the connector will remain the same and setting the config to UTC will make the Date pass as is without any conversion.
Problem
CC-24785 The Java.Sql.Date datatype only contains the day, month and year information and does not have the time. In the Kafka record it is stored as an integer which signifies the number of days since epoch date. When we bind it to the preparedStatement to build the insert query, we're using the db.timezone config on it to update it. Anything that is before the UTC will subtract the date by 1 because while applying the timezone it is assumed that the value of time is 00:00:00Z.
Solution
Added a config
date.timezone
to control what timezone to be used for converting the Date. The config is added to maintain backward compatibility. The default behaviour of the connector will remain the same and setting the config to UTC will make the Date pass as is without any conversion.Does this solution apply anywhere else?
If yes, where?
Test Strategy
Testing done:
Release Plan
[CC-24785]: https://confluentinc.atlassian.net/browse/CC-24785?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ