[jdbc] Incorrect DateTime results when writing numeric data with use_time_zone property#2066
[jdbc] Incorrect DateTime results when writing numeric data with use_time_zone property#2066haishui126 wants to merge 1 commit intoClickHouse:mainfrom
Conversation
…time_zone property
|
This PR need to be ported/verified with jdbc-v2 |
|
@chernser This PR addresses the time zone issue when converting Long type to LocalDateTime type in the clickhouse-data module. The jdbc-v2 does not use the clickhouse-data module, so this change will not affect v2. However, I tested v2 in 0.8.0, and found that writing Long type to DateTime64 is fine, but when writing LocalDateTime type to DateTime64, it seems that the use_time_zone setting does not take effect. |
|
@haishui126 thank you for the info! |
|
This pull request has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed in 2 weeks if no further activity occurs. Please feel free to give a status update or ping for review. Thank you for your contributions! |
|
This pull request has been automatically closed because it has not had any further activity in the last 2 weeks. Thank you for your contributions! |
Summary
Refer to #2065.
When I use ClickHouse JDBC to insert data, the server's time zone is UTC, while my client's time zone is UTC+8. The JDBC first converts my numeric data to a LocalDateTime in the UTC time zone. This time object is then treated as a LocalDateTime in the UTC+8 time zone when written into ClickHouse, resulting in the written result being 8 hours behind.
Checklist
Delete items not relevant to your PR: