Struct deltalake::DeltaTable [−][src]
pub struct DeltaTable { pub version: DeltaDataTypeVersion, pub table_uri: String, // some fields omitted }
Expand description
In memory representation of a Delta Table
Fields
version: DeltaDataTypeVersion
The version of the table as of the most recent loaded Delta log entry.
table_uri: String
The URI the DeltaTable was loaded from.
Implementations
Load DeltaTable with data from latest checkpoint
Updates the DeltaTable to the most recent state committed to the transaction log by loading the last checkpoint and incrementally applying each version since.
Updates the DeltaTable to the most recent state committed to the transaction by incrementally applying each version since current.
pub async fn load_version(
&mut self,
version: DeltaDataTypeVersion
) -> Result<(), DeltaTableError>
pub async fn load_version(
&mut self,
version: DeltaDataTypeVersion
) -> Result<(), DeltaTableError>
Loads the DeltaTable state for the given version.
pub fn get_files_by_partitions(
&self,
filters: &[PartitionFilter<'_, &str>]
) -> Result<Vec<String>, DeltaTableError>
pub fn get_files_by_partitions(
&self,
filters: &[PartitionFilter<'_, &str>]
) -> Result<Vec<String>, DeltaTableError>
Returns the file list tracked in current table state filtered by provided
PartitionFilter
s.
pub fn get_file_paths_by_partitions(
&self,
filters: &[PartitionFilter<'_, &str>]
) -> Result<Vec<String>, DeltaTableError>
👎 Deprecated since 0.4.0: Please use the get_file_uris_by_partitions function instead
pub fn get_file_paths_by_partitions(
&self,
filters: &[PartitionFilter<'_, &str>]
) -> Result<Vec<String>, DeltaTableError>
Please use the get_file_uris_by_partitions function instead
Return the file uris as strings for the partition(s)
pub fn get_file_uris_by_partitions(
&self,
filters: &[PartitionFilter<'_, &str>]
) -> Result<Vec<String>, DeltaTableError>
pub fn get_file_uris_by_partitions(
&self,
filters: &[PartitionFilter<'_, &str>]
) -> Result<Vec<String>, DeltaTableError>
Return the file uris as strings for the partition(s)
Return a refernece to all active “add” actions present in the loaded state
Returns an iterator of file names present in the loaded state
Returns a collection of file names present in the loaded state
Returns file names present in the loaded state in HashSet
👎 Deprecated since 0.4.0: Please use the get_file_uris function instead
Please use the get_file_uris function instead
Returns a URIs for all active files present in the current table version.
Returns a URIs for all active files present in the current table version.
Returns statistics for files, in order
Returns the currently loaded state snapshot.
Returns the metadata associated with the loaded state.
Returns a vector of tombstones (i.e. Remove
actions present in the current delta log.
Returns the current version of the DeltaTable based on the loaded metadata.
Returns the minimum reader version supported by the DeltaTable based on the loaded metadata.
Returns the minimum writer version supported by the DeltaTable based on the loaded metadata.
Run the Vacuum command on the Delta Table: delete files no longer referenced by a Delta table and are older than the retention threshold. We do not recommend that you set a retention interval shorter than 7 days, because old snapshots and uncommitted files can still be in use by concurrent readers or writers to the table. If vacuum cleans up active files, concurrent readers can fail or, worse, tables can be corrupted when vacuum deletes files that have not yet been committed.
Return table schema parsed from transaction log. Return None if table hasn’t been loaded or no metadata was found in the log.
Return table schema parsed from transaction log. Return DeltaTableError
if table hasn’t
been loaded or no metadata was found in the log.
pub fn create_transaction(
&mut self,
options: Option<DeltaTransactionOptions>
) -> DeltaTransaction<'_>
pub fn create_transaction(
&mut self,
options: Option<DeltaTransactionOptions>
) -> DeltaTransaction<'_>
Creates a new DeltaTransaction for the DeltaTable. The transaction holds a mutable reference to the DeltaTable, preventing other references until the transaction is dropped.
pub async fn try_commit_transaction(
&mut self,
commit: &PreparedCommit,
version: DeltaDataTypeVersion
) -> Result<DeltaDataTypeVersion, DeltaTransactionError>
pub async fn try_commit_transaction(
&mut self,
commit: &PreparedCommit,
version: DeltaDataTypeVersion
) -> Result<DeltaDataTypeVersion, DeltaTransactionError>
Tries to commit a prepared commit file. Returns DeltaTransactionError::VersionAlreadyExists
if the given version
already exists. The caller should handle the retry logic itself.
This is low-level transaction API. If user does not want to maintain the commit loop then
the DeltaTransaction.commit
is desired to be used as it handles try_commit_transaction
with retry logic.
pub fn new(
table_uri: &str,
storage_backend: Box<dyn StorageBackend>
) -> Result<Self, DeltaTableError>
pub fn new(
table_uri: &str,
storage_backend: Box<dyn StorageBackend>
) -> Result<Self, DeltaTableError>
Create a new Delta Table struct without loading any data from backing storage.
NOTE: This is for advanced users. If you don’t know why you need to use this method, please
call one of the open_table
helper methods instead.
pub async fn load_with_datetime(
&mut self,
datetime: DateTime<Utc>
) -> Result<(), DeltaTableError>
pub async fn load_with_datetime(
&mut self,
datetime: DateTime<Utc>
) -> Result<(), DeltaTableError>
Time travel Delta table to latest version that’s created at or before provided datetime
argument.
Internally, this methods performs a binary search on all Delta transaction logs.
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for DeltaTable
impl Send for DeltaTable
impl Sync for DeltaTable
impl Unpin for DeltaTable
impl !UnwindSafe for DeltaTable