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 1912f0f  SnapshotRetention::Tag max_ref_age_ms should be optional 
(#391)
1912f0f is described below

commit 1912f0fddbed3aa9e307339318a435cb089708ed
Author: Christian <[email protected]>
AuthorDate: Thu Jun 13 16:05:32 2024 +0200

    SnapshotRetention::Tag max_ref_age_ms should be optional (#391)
---
 crates/iceberg/src/catalog/mod.rs   | 4 +++-
 crates/iceberg/src/spec/snapshot.rs | 3 ++-
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/crates/iceberg/src/catalog/mod.rs 
b/crates/iceberg/src/catalog/mod.rs
index 195dcf3..172f335 100644
--- a/crates/iceberg/src/catalog/mod.rs
+++ b/crates/iceberg/src/catalog/mod.rs
@@ -982,7 +982,9 @@ mod tests {
             ref_name: "hank".to_string(),
             reference: SnapshotReference {
                 snapshot_id: 1,
-                retention: SnapshotRetention::Tag { max_ref_age_ms: 1 },
+                retention: SnapshotRetention::Tag {
+                    max_ref_age_ms: Some(1),
+                },
             },
         };
 
diff --git a/crates/iceberg/src/spec/snapshot.rs 
b/crates/iceberg/src/spec/snapshot.rs
index 53eee6b..e0ff079 100644
--- a/crates/iceberg/src/spec/snapshot.rs
+++ b/crates/iceberg/src/spec/snapshot.rs
@@ -351,7 +351,8 @@ pub enum SnapshotRetention {
     Tag {
         /// For snapshot references except the main branch, a positive number 
for the max age of the snapshot reference to keep while expiring snapshots.
         /// Defaults to table property history.expire.max-ref-age-ms. The main 
branch never expires.
-        max_ref_age_ms: i64,
+        #[serde(skip_serializing_if = "Option::is_none")]
+        max_ref_age_ms: Option<i64>,
     },
 }
 

Reply via email to