Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pub DeltaTable method to retrieve table configurations #356

Merged
merged 1 commit into from
Aug 7, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ tlaplus/*.toolbox/*/*.tla
tlaplus/*.toolbox/*/MC.cfg
tlaplus/*.toolbox/*/[0-9]*-[0-9]*-[0-9]*-[0-9]*-[0-9]*-[0-9]*/
/.idea
.vscode
15 changes: 15 additions & 0 deletions rust/src/delta.rs
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,11 @@ impl DeltaTableMetaData {
configuration,
}
}

/// Return the configurations of the DeltaTableMetaData; could be empty
pub fn get_configuration(&self) -> &HashMap<String, String> {
&self.configuration
}
}

impl fmt::Display for DeltaTableMetaData {
Expand Down Expand Up @@ -1006,6 +1011,16 @@ impl DeltaTable {
self.schema().ok_or(DeltaTableError::NoSchema)
}

/// Return the tables configurations that are encapsulated in the DeltaTableStates currentMetaData field
pub fn get_configurations(&self) -> Result<&HashMap<String, String>, DeltaTableError> {
Ok(self
.state
.current_metadata
.as_ref()
.ok_or(DeltaTableError::NoMetadata)?
.get_configuration())
}

/// Creates a new DeltaTransaction for the DeltaTable.
/// The transaction holds a mutable reference to the DeltaTable, preventing other references
/// until the transaction is dropped.
Expand Down