[Iceberg]Support timestamp without timezone in time travel expressions#23714
Conversation
steveburnett
left a comment
There was a problem hiding this comment.
Just a nit suggesting a change in the link.
f4bfebd to
7d4129a
Compare
steveburnett
left a comment
There was a problem hiding this comment.
LGTM! (docs)
Pull updated branch, new local doc build, looks great!
| Timestamp without timezone will be parsed and rendered in the session time zone. See `TIMESTAMP <https://prestodb.io/docs/current/language/types.html#timestamp>`_. | ||
|
|
||
| The option following FOR TIMESTAMP AS OF can accept any expression that returns a timestamp or timestamp with time zone value. | ||
| For example, `TIMESTAMP '2023-10-17 13:29:46.822 America/Los_Angeles'` and `TIMESTAMP '2023-10-17 13:29:46.822'` are all constant strings for the expression. |
There was a problem hiding this comment.
This sentence is a little confusing to me. I think it's fair to specify that they are both valid -- but I think it would be good to explain what distinguishes them. Here's a suggestion, but feel free to modify:
| For example, `TIMESTAMP '2023-10-17 13:29:46.822 America/Los_Angeles'` and `TIMESTAMP '2023-10-17 13:29:46.822'` are all constant strings for the expression. | |
| For example, `TIMESTAMP '2023-10-17 13:29:46.822 America/Los_Angeles'` and `TIMESTAMP '2023-10-17 13:29:46.822'` are both valid timestamps. The first specifies the timestamp within the timezone `America/Los_Angeles`. The second will use the timestamp based on the user's session timezone.. |
There was a problem hiding this comment.
Thanks for your suggestion, modified! This change makes it more clear for readers to understand, please take a look when available.
| assertTrue(snapshotTimeMillis - currentTimeMillis <= 10, | ||
| format("Snapshot time %s is greater than the current time %s by more than 10ms", snapshotTimeMillis, currentTimeMillis)); | ||
|
|
||
| while (currentTimeMillis <= snapshotTimeMillis) { |
There was a problem hiding this comment.
Not a huge fan of the busy loop but I know we do this elsewhere, so I won't block on this but it wastes a lot of resources especially for concurrent tests.
There was a problem hiding this comment.
I see your point, but sometimes we do need to make sure that several consecutive actions happen in different milliseconds. I'd like to to make a detailed investigation into the time frame library later to see if there is a more suitable non busy loop waiting solution, and open for any better thoughts.
bfb6dad
7d4129a to
bfb6dad
Compare
bfb6dad to
2a62853
Compare
Description
We have supported time travel query on Iceberg table in PR #21425, however currently we only support timestamp with timezone expressions in
FOR TIMESTAMP AS OFas follows:In many scenarios, we do not want to explicitly indicate the time zone, but just default to using the time zone specified in the current session, since it's natural for users to execute queries based on the timestamp string in their own time zone.
This PR support timestamp without timezone in time travel expressions, so users can execute time travel query as follows:
Timestamp without timezone will be parsed and rendered in the session time zone, it's consistent with data with type of
TimestampTypein Presto.Motivation and Context
Support timestamp without timezone in time travel expressions
Impact
N/A
Test Plan
Contributor checklist
Release Notes