Skip to content

Commit

Permalink
Merge pull request #97 from JanKaul/fix-default-timestamp
Browse files Browse the repository at this point in the history
fix default timestamp
  • Loading branch information
JanKaul authored Jan 10, 2025
2 parents f35ee19 + 573a524 commit 142208c
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion iceberg-rust-spec/src/spec/snapshot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ pub struct Snapshot {
/// A timestamp when the snapshot was created, used for garbage
/// collection and table inspection
#[builder(
default = "SystemTime::now().duration_since(UNIX_EPOCH).unwrap().as_micros() as i64"
default = "SystemTime::now().duration_since(UNIX_EPOCH).unwrap().as_millis() as i64"
)]
timestamp_ms: i64,
/// The location of a manifest list for this snapshot that
Expand Down
2 changes: 1 addition & 1 deletion iceberg-rust-spec/src/spec/table_metadata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ pub struct TableMetadata {
/// The tables highest sequence number
pub last_sequence_number: i64,
#[builder(
default = "SystemTime::now().duration_since(UNIX_EPOCH).unwrap().as_micros() as i64"
default = "SystemTime::now().duration_since(UNIX_EPOCH).unwrap().as_millis() as i64"
)]
/// Timestamp in milliseconds from the unix epoch when the table was last updated.
pub last_updated_ms: i64,
Expand Down
2 changes: 1 addition & 1 deletion iceberg-rust-spec/src/spec/view_metadata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ pub struct Version<T: Materialization> {
#[builder(default = "DEFAULT_SCHEMA_ID")]
pub schema_id: i32,
#[builder(
default = "SystemTime::now().duration_since(UNIX_EPOCH).unwrap().as_micros() as i64"
default = "SystemTime::now().duration_since(UNIX_EPOCH).unwrap().as_millis() as i64"
)]
/// Timestamp expressed in ms since epoch at which the version of the view was created.
pub timestamp_ms: i64,
Expand Down

0 comments on commit 142208c

Please sign in to comment.