datafold/data-diff

ClickHouse date format wrong normalization

oleg-savko opened this issue · 2 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

This issue has been marked as stale because it has been open for 60 days with no activity. If you would like the issue to remain open, please comment on the issue and it will be added to the triage queue. Otherwise, it will be closed in 7 days.

Although we are closing this issue as stale, it's not gone forever. Issues can be reopened if there is renewed community interest. Just add a comment and it will be reopened for triage.