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

Fix: parse time[(p)] with time zone correctly #2041

Merged
merged 6 commits into from
Aug 11, 2023
Merged

Fix: parse time[(p)] with time zone correctly #2041

merged 6 commits into from
Aug 11, 2023

Conversation

georgesittas
Copy link
Collaborator

@georgesittas georgesittas commented Aug 11, 2023

Fixes #2028

Bonus fix: Redshift seems to only allow specifying the precision parameter in TIMETZ / TIMESTAMPTZ when the alternative syntax is used: WITH TIME ZONE (tested). For example:

CAST(.. AS TIME[STAMP]TZ(precision)) -> syntax error
CAST(.. AS TIME[STAMP](precision) WITH TIME ZONE) -> works as expected

References:

@georgesittas georgesittas requested a review from tobymao August 11, 2023 17:08
sqlglot/dialects/duckdb.py Outdated Show resolved Hide resolved
@cpcloud
Copy link
Contributor

cpcloud commented Aug 11, 2023

Thanks for knocking out all these PRs folks.

It's really going to help us as we start our port to replace sqlalchemy with sqlglot + DBAPIs inside of ibis 🚀

@georgesittas georgesittas merged commit 4591092 into main Aug 11, 2023
@georgesittas georgesittas deleted the jo/timetz branch August 11, 2023 18:34
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.

time(precision) with time zone is parsed incorrectly into TIMESTAMPTZ
3 participants