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
Changes to add display timezone based on user timezone #21929
base: master
Are you sure you want to change the base?
Conversation
Thank you for your pull request and welcome to our community. We could not parse the GitHub identity of the following contributors: Amer Issa.
|
Thank you for your pull request and welcome to our community. We could not parse the GitHub identity of the following contributors: Amer Issa.
|
Should this be a client-side thing, @martint ? |
This PR originates from this Issue: |
…rino into ChangeDisplayOfTz
…rino into ChangeDisplayOfTz
Thank you for your pull request and welcome to our community. We could not parse the GitHub identity of the following contributors: Amer Issa.
|
…rino into ChangeDisplayOfTz
…rino into ChangeDisplayOfTz
Thank you for your pull request and welcome to our community. We could not parse the GitHub identity of the following contributors: Amer Issa.
|
Yes, see my comment in the issue. IMO, it should either be a CLI rendering option or an addition to the protocol to allow clients to specify that they want all timestamp with time zone converted to the client's time zone before they are transported to the client. I'm not a big fan of the latter, as it introduces an entire new layer of processing and complexity. The downside is that either of these options requires updates to clients and client applications. Controlling the latter it via a session property instead of a protocol option also has the downside that it only works for clients that support multi-statement interactions with the server. |
@martint WITH SESSION that allows for tz switch would address the last concern, correct? |
Yes, but that's the smallest of the issues. It still requires introducing a processing layer to translate all values to such timezone before returning the results to the client. |
A Trino query against an iceberg table timestamp column renders the query result differently from how Spark renders the query result for the same iceberg table:
Spark-SQL:
Trino SQL (against the same Spark generated iceberg table above):
Postgres rendering behavior for a table with a timestamptz column is like Spark:
The only option available in Trino for rendering the timestamp column at the desired timezone is to employ the Trino at_timezone function. This is undesirable as it requires a code change to existing queries. Adding the ability for Trino to transparently render the Timestamp based on a set/configured Timezone similar to how Spark and Postgres behaves is preferred because it is less intrusive.
This PR introduces configurable Trino query behavior for rendering Iceberg table timestamp columns in the same manner that Spark and Postgres render timestamp with time zone data type columns. It simplifies and encourages the adoption of Iceberg format tables that have columns of type timestamp with time zone.
The enhancement ensures that an Iceberg table timestamp column value:
Is normalized to UTC time
Is rendered at query time according to a default or specified session Time Zone