Skip to content

DeltaTimeTravelSpec

Creating Instance

DeltaTimeTravelSpec takes the following to be created:

DeltaTimeTravelSpec asserts that either version or timestamp is provided (and throws an AssertionError).

DeltaTimeTravelSpec is created when:

Version

version: Option[Long]

DeltaTimeTravelSpec can be given a version when created:

version is mutually exclusive with the timestamp (so only one can be specified).

Creation Source ID

DeltaTimeTravelSpec is given a Creation Source ID when created.

The Creation Source ID indicates the API used to time travel:

Time Travel Patterns

DeltaTimeTravelSpec defines regular expressions for timestamp- and version-based time travel identifiers:

  • Version URI: (path)@[vV](some numbers)
  • Timestamp URI: (path)@(yyyyMMddHHmmssSSS)

Resolving Path

resolvePath(
  conf: SQLConf,
  identifier: String): (DeltaTimeTravelSpec, String)

resolvePath...FIXME

resolvePath is used when DeltaTableUtils utility is used to extractIfPathContainsTimeTravel.

getTimestamp

getTimestamp(
  timeZone: String): Timestamp

getTimestamp...FIXME

getTimestamp is used when DeltaTableUtils utility is used to resolveTimeTravelVersion.

isApplicable

isApplicable(
  conf: SQLConf,
  identifier: String): Boolean

isApplicable is true when all of the following hold:

isApplicable is used when DeltaTableUtils utility is used to extractIfPathContainsTimeTravel.

identifierContainsTimeTravel

identifierContainsTimeTravel(
  identifier: String): Boolean

identifierContainsTimeTravel is true when the given identifier is either timestamp or version time travel pattern.