Skip to content

[Coral-Trino] Modify transformation for CURRENT_TIMESTAMP#483

Open
ljfgem wants to merge 1 commit intolinkedin:masterfrom
ljfgem:fix-current-timestamp-trino
Open

[Coral-Trino] Modify transformation for CURRENT_TIMESTAMP#483
ljfgem wants to merge 1 commit intolinkedin:masterfrom
ljfgem:fix-current-timestamp-trino

Conversation

@ljfgem
Copy link
Copy Markdown
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
Copy Markdown
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