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:
- DeltaAnalysis logical resolution rule is resolving RestoreTableStatement unary logical operator
DeltaTimeTravelSpec
utility is used to resolve a pathDeltaDataSource
utility is used to getTimeTravelVersionDeltaSource
is requested to for the getStartingVersion
Version¶
version: Option[Long]
DeltaTimeTravelSpec
can be given a version when created:
- DeltaAnalysis logical resolution rule is executed (to resolve a RestoreTableStatement)
DeltaTimeTravelSpec
utility is used to resolve pathDeltaDataSource
utility is used to getTimeTravelVersion
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:
- Creation Source ID of the TimeTravel of RestoreTableStatement unary logical operator (when DeltaAnalysis logical resolution rule is executed)
atSyntax.path
for DeltaTimeTravelSpecdfReader
for DeltaDataSourcedeltaSource
for DeltaSource
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:
- spark.databricks.delta.timeTravel.resolveOnIdentifier.enabled is
true
- identifierContainsTimeTravel is
true
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.