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

feature: Add DateTime with timezone support #154

Closed
wants to merge 1 commit into from

Conversation

mlosnikov
Copy link

@mlosnikov mlosnikov commented Mar 31, 2023

Summary

Metabase builder generates condition like this on DateTime column even if local timezone is enabled:
column_name >= parseDateTimeBestEffort('2023-03-13 00:00:00.000Z')

For comparison, with Postgres it looks like this:
"column_name" >= timestamp with time zone '2023-03-13 00:00:00.000-04:00'

This PR just extends regex for column mapping to properly handle columns with type DateTime('Timezone')

Some tests with this regex:
https://regex101.com/r/Yahlbt/1

Checklist

Delete items not relevant to your PR:

  • Unit and integration tests covering the common scenarios were added
  • A human-readable description of the changes was provided to include in CHANGELOG
  • For significant changes, documentation in https://github.com/ClickHouse/clickhouse-docs was updated with further explanations or tutorials

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@slvrtrn
Copy link
Collaborator

slvrtrn commented Mar 31, 2023

@mlosnikov, shall we also support DateTime64 in this scenario?

@mlosnikov
Copy link
Author

@slvrtrn I suppose so. I included \d* pattern for both Enum and DateTime.
Also, there are tests for such cases here:
https://regex101.com/r/Yahlbt/1

@slvrtrn
Copy link
Collaborator

slvrtrn commented Mar 31, 2023

This is great. Thanks for your contribution! Do you think it is possible to add some tests as well?

@slvrtrn
Copy link
Collaborator

slvrtrn commented Aug 1, 2023

Closing this in favor of #181

@slvrtrn slvrtrn closed this Aug 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants