cube icon indicating copy to clipboard operation
cube copied to clipboard

fix(schema-compiler): use toDateTime64 for pre-1970 dates CH

Open Ilex4524 opened this issue 1 week ago • 2 comments

Check List

  • [x] Tests has been run in packages where changes made if available
  • [x] Linter has been run for changed code
  • [x] Tests for the changes have been added if not covered yet
  • [ ] Docs have been added / updated if required

Description of Changes Made (if issue reference is not provided)

This PR updates the ClickHouseQuery adapter to replace all instances of toDateTime with toDateTime64. This change ensures that dates before 1970 are handled correctly, particularly in time dimensions functionality.

Important Note for Users:

If your dataset includes dates before 1970, ensure that the enable_extended_results_for_datetime_functions ClickHouse option is turned on. This setting is crucial for functions like toStartOfYear to work correctly with dates outside the typical range.

For more information, refer to the ClickHouse documentation.

Ilex4524 avatar Jun 25 '24 13:06 Ilex4524