Skip to main content

Module history_manager

Module history_manager 

Source
Expand description

This module provides functions for performing timestamp queries over the Delta Log, translating between timestamps and Delta versions.

§Usage

Use this module to:

  • Convert timestamps or timestamp ranges into Delta versions or version ranges
  • Perform time travel queries
  • Execute timestamp-based change data feed queries

The history_manager module works with tables regardless of whether they have In-Commit Timestamps (ICT) enabled. ICT is a Delta table feature that stores precise commit timestamps in the commit metadata rather than relying on file modification times, which can be affected by clock skew or filesystem limitations.

§Limitations

All timestamp queries are limited to the state captured in the provided Snapshot. For tables without ICT enabled, timestamp queries rely on file modification timestamps, which are not guaranteed to be monotonically increasing across commits.

Modules§

error
Error types for the history manager module.

Structs§

CommitAt
A commit located by a timestamp query: the commit Version paired with its timestamp.

Enums§

HistoryCommitType
Selects which commit the get_earliest_commit query returns.

Functions§

first_version_after
Gets the first CommitAt (version and timestamp) with a timestamp at or after timestamp.
get_earliest_commit
Returns the earliest table version available on the file system at log_root. The returned version is not guaranteed to exist by the time the caller acts on it: a concurrent log-cleanup operation may delete the underlying file.
latest_version_as_of
Gets the latest CommitAt (version and timestamp) with a timestamp at or before timestamp.
timestamp_range_to_versions
Converts a timestamp range to a corresponding version range.

Type Aliases§

Timestamp
A timestamp representing milliseconds since the Unix epoch (1970-01-01 00:00:00 UTC).