v.20.4Improvement
Use Time Zone for DateTime Comparisons to Fix Issue #5206
Use time zone when comparing DateTime with string literal. This fixes #5206. #10515 (alexey-milovidov)
Why it matters
This feature fixes an issue where comparisons betweenDateTime columns and string literal values did not take the time zone into account, leading to incorrect query results. By using the time zone properly, it ensures that date and time comparisons behave as expected, improving query accuracy and reliability.How to use it
Users don't need to change their queries explicitly. When comparing aDateTime column to a string literal, ClickHouse automatically applies the time zone for accurate comparison.