This is an automated email from the ASF dual-hosted git repository.

liurenjie1024 pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/iceberg-rust.git


The following commit(s) were added to refs/heads/main by this push:
     new 92cc45cb Add TableMetadata Accessors (#688)
92cc45cb is described below

commit 92cc45cb649f9bcdd7dae1c1deb33e5a6eec0474
Author: Christian <[email protected]>
AuthorDate: Fri Nov 8 14:01:37 2024 +0100

    Add TableMetadata Accessors (#688)
---
 crates/iceberg/src/spec/table_metadata.rs | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/crates/iceberg/src/spec/table_metadata.rs 
b/crates/iceberg/src/spec/table_metadata.rs
index 4a2e3ab7..74e69007 100644
--- a/crates/iceberg/src/spec/table_metadata.rs
+++ b/crates/iceberg/src/spec/table_metadata.rs
@@ -220,6 +220,12 @@ impl TableMetadata {
             .expect("Current schema id set, but not found in table metadata")
     }
 
+    /// Get the id of the current schema
+    #[inline]
+    pub fn current_schema_id(&self) -> SchemaId {
+        self.current_schema_id
+    }
+
     /// Returns all partition specs.
     #[inline]
     pub fn partition_specs_iter(&self) -> impl Iterator<Item = 
&SchemalessPartitionSpecRef> {
@@ -277,6 +283,12 @@ impl TableMetadata {
         })
     }
 
+    /// Get the current snapshot id
+    #[inline]
+    pub fn current_snapshot_id(&self) -> Option<i64> {
+        self.current_snapshot_id
+    }
+
     /// Get the snapshot for a reference
     /// Returns an option if the `ref_name` is not found
     #[inline]
@@ -307,6 +319,12 @@ impl TableMetadata {
             .expect("Default order id has been set, but not found in table 
metadata!")
     }
 
+    /// Returns default sort order id.
+    #[inline]
+    pub fn default_sort_order_id(&self) -> i64 {
+        self.default_sort_order_id
+    }
+
     /// Returns properties of table.
     #[inline]
     pub fn properties(&self) -> &HashMap<String, String> {

Reply via email to