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

[source-mysql] MySQL source connector timezone issue #54718

Open
1 task
pholterman opened this issue Feb 28, 2025 · 0 comments
Open
1 task

[source-mysql] MySQL source connector timezone issue #54718

pholterman opened this issue Feb 28, 2025 · 0 comments

Comments

@pholterman
Copy link

Connector Name

source-mysql

Connector Version

3.11.2

What step the error happened?

During the sync

Relevant information

I have a connection from MySQL to Snowflake using CDC.
The MySQL database has timezone Europe/Amsterdam

Source connector:
source-mysql v3.11.2
Read Changes using Change Data Capture (CDC)
Configured timezone: Europe/Amsterdam
JDBC url params: serverTimezone=Europe/Amsterdam

Destination connector:
destination-snowflake v3.15.4
no specific settings

There are 2 types of datetime columns in the source database:

  1. data type timestamp (contains timezone information)
  2. data type datetime (does not contain timezone information)

In Snowflake they are stored as:

  1. data type TIMESTAMP_TZ
  2. data type TIMESTAMP_NTZ

Say I have a record with:

  • timestamp field created_at with value 2025-02-26 20:02:55
  • datetime field status_last_updated_at with value 2025-02-26 20:26:57

After the first full refresh:

  • created_at becomes: 2025-02-26 20:02:55.000000000 +01:00
  • status_last_updated_at becomes 2025-02-26 19:26:57.000000000 (the datetime is converted to UTC)

But when this record is changed and processed through CDC, it changes:

  • created_at stays: 2025-02-26 20:02:55.000000000 +01:00
  • status_last_updated_at becomes 2025-02-26 20:26:57.000000000

Conclusion:
During the first load (full refresh), a MySQL datetime field is treated differently than during CDC.

Relevant log output

Contribute

  • Yes, I want to contribute
@pholterman pholterman added area/connectors Connector related issues needs-triage type/bug Something isn't working labels Feb 28, 2025
@pholterman pholterman changed the title MySQL source connector timezone issue [source-mysql] MySQL source connector timezone issue Mar 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants