Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correctly handle temporal type Time zone. #328

Closed
aadant opened this issue Oct 20, 2023 · 1 comment
Closed

Correctly handle temporal type Time zone. #328

aadant opened this issue Oct 20, 2023 · 1 comment
Assignees
Labels
datatype Related to supporting or bugs with current supported datatypes. GA-1 All the issues that are issues in release(Scheduled Dec 2023) high-priority qa-verified label to mark issues that were verified by QA

Comments

@aadant
Copy link
Collaborator

aadant commented Oct 20, 2023

A MySQL Datetime is similar to a String, it is not dependent of the server time zone.
A MySQL Timestamp is similar to a DateTime in CH, it is dependent of the server time zone.

How to reproduce :

in MySQL, set

time_zone=America/Chicago

in the my.cnf

in CH, set

<timezone>America/Chicago</timezone>

Replicate https://github.com/Altinity/clickhouse-sink-connector/blob/develop/sink-connector/tests/data_types.sql

Compare the temporal tables. As the server time zones are the same, the DateTime and Timestamps should return the same values.

see also #312
ClickHouse/ClickHouse#7083

Using clickhouse-client, casting a CSV file containing data to a String on the client side creates a DateTime matching the original String on the server side. If the client time zone is different and the String is cast to a DateTime on the client, the DateTime will not match the original String.

@aadant aadant changed the title Correctly handle temporal types Time zone. Correctly handle temporal type Time zone. Oct 20, 2023
@aadant aadant added datatype Related to supporting or bugs with current supported datatypes. high-priority labels Oct 20, 2023
@subkanthi subkanthi added the GA-1 All the issues that are issues in release(Scheduled Dec 2023) label Dec 18, 2023
@Selfeer
Copy link
Collaborator

Selfeer commented Feb 8, 2024

The issue was manually verified by the Altinity QA team and marked as qa-verified.

Build used for testing: altinityinfra/clickhouse-sink-connector:443-14a14ba5c18fb3bc9f57c48d9a5079d4d6fe15e8-lt

We've verified that the DateTime and Timestamps return the same value for the scenario when the ClickHouse and MySQL servers have the same timezone set but the main machine on which the servers are being run has a different timezone.

@Selfeer Selfeer added the qa-verified label to mark issues that were verified by QA label Feb 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
datatype Related to supporting or bugs with current supported datatypes. GA-1 All the issues that are issues in release(Scheduled Dec 2023) high-priority qa-verified label to mark issues that were verified by QA
Projects
None yet
Development

No branches or pull requests

3 participants