Expand description
Perform restore of delta table to a specified version or datetime
Algorithm:
- Read the latest state snapshot of the table.
- Read table state for version or datetime to restore
- Compute files available in state for restoring (files were removed by some commit) but missed in the latest. Add these files into commit as AddFile action.
- Compute files available in the latest state snapshot (files were added after version to restore) but missed in the state to restore. Add these files into commit as RemoveFile action.
- If ignore_missing_files option is false (default value) check availability of AddFile in file system.
- Commit Protocol, all RemoveFile and AddFile actions
into delta log using
LogStore::write_commit_entry
(commit will be failed in case of parallel transaction) TODO: comment is outdated - If table was modified in parallel then ignore restore and raise exception.
§Example
ⓘ
let table = open_table("../path/to/table")?;
let (table, metrics) = RestoreBuilder::new(table.object_store(), table.state).with_version_to_restore(1).await?;
Structs§
- Restore a Delta table with given version See this module’s documentation for more information
- Metrics from Restore