Skip to content

[python] Support time travel by timestamp and watermark in TimeTravelUtil#7899

Open
JunRuiLee wants to merge 1 commit into
apache:masterfrom
JunRuiLee:pypaimon-time-travel-by-timestamp
Open

[python] Support time travel by timestamp and watermark in TimeTravelUtil#7899
JunRuiLee wants to merge 1 commit into
apache:masterfrom
JunRuiLee:pypaimon-time-travel-by-timestamp

Conversation

@JunRuiLee
Copy link
Copy Markdown
Contributor

Purpose

Currently pypaimon's TimeTravelUtil only supports time travel by scan.tag-name and scan.snapshot-id. This PR adds support for three additional time travel modes that are available on the Java side:

  • scan.timestamp-millis: Travel to the latest snapshot with commit time <= the given timestamp (milliseconds)
  • scan.timestamp: Same as above but accepts a human-readable timestamp string (e.g. '2023-12-01 12:00:00')
  • scan.watermark: Travel to the first snapshot with watermark >= the given value

Add scan.timestamp-millis, scan.timestamp, and scan.watermark options
to CoreOptions and extend TimeTravelUtil to resolve snapshots using
these parameters, aligning with Java-side time travel capabilities.

- Add SCAN_TIMESTAMP_MILLIS, SCAN_TIMESTAMP, SCAN_WATERMARK config
  options and accessor methods to CoreOptions
- Extend TimeTravelUtil.try_travel_to_snapshot() to handle timestamp
  and watermark based time travel
- Add SnapshotManager.later_or_equal_watermark() for watermark lookup
- Parse scan.timestamp using local timezone (matching Java behavior)
- Unify all point-in-time scan options in TableScan through
  TimeTravelUtil, ensuring mutual-exclusion validation and consistent
  schema/data resolution
- Reject conflicting incremental-between-timestamp and point-in-time
  scan options
@JunRuiLee JunRuiLee force-pushed the pypaimon-time-travel-by-timestamp branch from df56ffc to c149409 Compare May 19, 2026 10:54
@JunRuiLee JunRuiLee marked this pull request as ready for review May 19, 2026 10:55
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.

1 participant