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

[Coral-Trino] Modify transformation for CURRENT_TIMESTAMP #483

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ljfgem
Copy link
Collaborator

@ljfgem ljfgem commented Jan 9, 2024

What changes are proposed in this pull request, and why are they necessary?

In Hive, CURRENT_TIMESTAMP returns a UTC timestamp, whereas in Trino, it returns a timestamp based on the session's timezone. Therefore, to be compatible with Hive query result, AT TIME ZONE 'UTC' should be added to the translated Trino SQL. For example, SELECT CURRENT_TIMESTAMP is transformed into SELECT CAST(CURRENT_TIMESTAMP AT TIME ZONE 'UTC' AS TIMESTAMP(3)).

How was this patch tested?

Modified unit tests.

@wmoustafa
Copy link
Contributor

Could you evaluate the Spark behavior in case Spark is used on the LHS? What triggered this issue? Is it still required? FYI @phd3.

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.

2 participants