-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Description
Currently Trino does not support version/timestamp range travel. In previous issue #6988 there was already a design doc and discussion about the syntax we could use to support time travel(including the range).
This thread is to propose adding syntax for the FromTo expression:
SELECT * FROM <Database>.<Table>
FOR <RangeType> FROM <RangeUnit> TO <RangeUnit>
WHERE <Predicate>`
Which should yield all the rows with a start time after the FROM version, and an end time before or equal to the TO version, according to SQL Standard.
Since QueryPeriod is already well implemented in place, the change will only require us to add the syntax in SqlBase.g4 and adjust a few places in the parser to check the existence of startVersion.
Iceberg has added support for changelog scan, which supports querying changelog in a range with the end version included. We wanted syntax to be ready to support it in Trino.