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

fix: update createdTime during schema evolution #2926

Merged
merged 3 commits into from
Oct 7, 2024
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
2 changes: 1 addition & 1 deletion crates/core/src/kernel/models/actions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ impl Metadata {
configuration,
name: None,
description: None,
created_time: None,
created_time: Some(chrono::Utc::now().timestamp_millis()),
})
}

Expand Down
9 changes: 9 additions & 0 deletions crates/core/src/operations/write.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1588,6 +1588,15 @@ mod tests {
let names = fields.map(|f| f.name()).collect::<Vec<_>>();
assert_eq!(names, vec!["id", "value", "modified", "inserted_by"]);

// <https://github.com/delta-io/delta-rs/issues/2925>
let metadata = table
.metadata()
.expect("Failed to retrieve updated metadata");
assert_ne!(
None, metadata.created_time,
"Created time should be the milliseconds since epoch of when the action was created"
);

let write_metrics: WriteMetrics = get_write_metrics(table.clone()).await;
assert_common_write_metrics(write_metrics);
}
Expand Down
Loading