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

Incorrect date display in the time zone column #938

Open
tellienne opened this issue Dec 2, 2024 · 1 comment
Open

Incorrect date display in the time zone column #938

tellienne opened this issue Dec 2, 2024 · 1 comment
Assignees
Labels
lightweight Issues related to Lightweight version p2 postgres Issues related to PostgreSQL
Milestone

Comments

@tellienne
Copy link

Hello!
We noticed that the connector records dates incorrectly if a special time zone is specified in the field.

How to play:

  1. Create a column with the timestamptz type in Postgres.
  2. In our example, the date in the column is stored with the time zone utc +3. For example - 2024-12-01 00:00:00.000 +0300
  3. Start transfer
  4. The transfer will save the date in this column with the time zone of the clickhouse server. By default UTC: 2024-11-30 21:00:00.
  5. Set the clickhouse column to a time zone other than UTC:
MODIFY COLUMN IF EXISTS column_name Nullable(DateTime64(6,'Europe/Moscow'));

The date will be recalculated to +3 like 2024-12-01 00:00:00.000 +0300. this is the result we need

  1. run a snapshot using ad hoc snapshot
  2. As a result of the snapshot, the date will be oversaved as 2024-11-30 21:00:00.000 +0300.
    The time is actually saved in UTC, but with a non-UTC time zone

In Postgres we use dates with different time zones. One table can have columns with the timestamp type and store the date in utc, and columns with the timestamptz type, where the time zone is UTC+3.
In clickhouse we need to display dates in the same time zones as in Postgres

@subkanthi subkanthi added the postgres Issues related to PostgreSQL label Dec 4, 2024
@subkanthi subkanthi added this to the 2.6.0 milestone Dec 4, 2024
@subkanthi subkanthi added the lightweight Issues related to Lightweight version label Dec 4, 2024
@subkanthi subkanthi added the p2 label Dec 11, 2024
@subkanthi
Copy link
Collaborator

Hi @tellienne , we dont get the timezone information from debezium, you can use this config variable clickhouse.datetime.timezone to set the timezone for the connector.

https://github.com/Altinity/clickhouse-sink-connector/blob/develop/doc/timezone.md

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lightweight Issues related to Lightweight version p2 postgres Issues related to PostgreSQL
Projects
None yet
Development

No branches or pull requests

2 participants