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(teradata): use timestamp with time zone over timestamptz #3723

Merged
merged 1 commit into from
Jul 2, 2024

Conversation

mtagle
Copy link
Contributor

@mtagle mtagle commented Jul 2, 2024

fixes 3722

after making the change, current_timestamp in my example sql no longer retained it's precision. I'm not sure why this happened but modifying the current timestamp transform seemed to fix it.

regarding this change: current_timestamp can have a precision of 0-6, but current_timestamp() (with no arguments) is not valid sql.
documentation reference: https://docs.teradata.com/r/Enterprise_IntelliFlex_VMware/SQL-Functions-Expressions-and-Predicates/Built-In-Functions/CURRENT_TIMESTAMP/CURRENT_TIMESTAMP-Function-Syntax so I tried to represent this in the transform

@mtagle mtagle changed the title fix(teradata): use timestamp with time zone over timestamp_tz fix(teradata): use timestamp with time zone over timestamptz Jul 2, 2024
@tobymao
Copy link
Owner

tobymao commented Jul 2, 2024

please run make style, thank you very much for your pr

@mtagle
Copy link
Contributor Author

mtagle commented Jul 2, 2024

when I run make style, even on a clean master, I get this:

pre-commit run --all-files
make: pre-commit: No such file or directory
make: *** [style] Error 1

what am I missing?

Copy link
Collaborator

@georgesittas georgesittas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @mtagle

when I run make style, even on a clean master, I get this:

pre-commit run --all-files
make: pre-commit: No such file or directory
make: *** [style] Error 1

what am I missing?

It looks to me like you don't have pre-commit installed. Can you first try make install-dev, then install-pre-commit and then run make style again?

sqlglot/dialects/teradata.py Show resolved Hide resolved
@georgesittas
Copy link
Collaborator

I'll take this one to the finish line, thanks for the PR :-)

@georgesittas georgesittas merged commit 3454f86 into tobymao:main Jul 2, 2024
0 of 6 checks passed
@georgesittas
Copy link
Collaborator

Slightly refactored this while I was at it, take a look here - 84416d2.

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.

teradata should use timestamp with time zone not timestamptz
3 participants