datafold / data-diff

Compare tables within or across databases

Home Page:https://docs.datafold.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ClickHouse date format wrong normalization

oleg-savko opened this issue · comments

Seems wrong date format when try to normalization clickhouse dates when compare with mysql

- 10404778, 2023-12-20 00:December:25., CANCELLED
+ 10404778, 2023-12-20 00:00:25.000000, CANCELLED

value = f"formatDateTime({value}, '%Y-%m-%d %H:%M:%S') || '.' || {self.to_string(fractional)}"
Here should be '%Y-%m-%d %H:%i:%S' not '%Y-%m-%d %H:%M:%S'

https://github.com/datafold/data-diff/blob/db7d8641d19a4417a378030671ce587035f5131e/data_diff/databases/clickhouse.py#L164C60-L164C60


seems its depends from ch version also
https://clickhouse.com/docs/en/sql-reference/functions/date-time-functions#formatDateTime

image