From d0402737e2451039b730d4d23771fdcd1a63ae65 Mon Sep 17 00:00:00 2001 From: ion-elgreco <15728914+ion-elgreco@users.noreply.github.com> Date: Mon, 1 Jan 2024 17:07:57 +0100 Subject: [PATCH] fmt --- crates/deltalake-core/src/operations/delete.rs | 8 +++----- crates/deltalake-core/src/operations/merge/mod.rs | 8 +++----- crates/deltalake-core/src/operations/update.rs | 6 +++--- 3 files changed, 9 insertions(+), 13 deletions(-) diff --git a/crates/deltalake-core/src/operations/delete.rs b/crates/deltalake-core/src/operations/delete.rs index 3f11c20c3e..37d5a99183 100644 --- a/crates/deltalake-core/src/operations/delete.rs +++ b/crates/deltalake-core/src/operations/delete.rs @@ -249,12 +249,11 @@ async fn execute( metrics.execution_time_ms = Instant::now().duration_since(exec_start).as_micros(); - let mut app_metadata = match app_metadata { Some(meta) => meta, - None => HashMap::new() - }; - + None => HashMap::new(), + }; + app_metadata.insert("readVersion".to_owned(), snapshot.version().into()); let delete_metrics = serde_json::to_value(metrics.clone()); @@ -262,7 +261,6 @@ async fn execute( if let Ok(map) = delete_metrics { app_metadata.insert("operationMetrics".to_owned(), map); } - // Do not make a commit when there are zero updates to the state if !actions.is_empty() { diff --git a/crates/deltalake-core/src/operations/merge/mod.rs b/crates/deltalake-core/src/operations/merge/mod.rs index 995ba6cadd..d1e4f00239 100644 --- a/crates/deltalake-core/src/operations/merge/mod.rs +++ b/crates/deltalake-core/src/operations/merge/mod.rs @@ -1390,12 +1390,11 @@ async fn execute( metrics.execution_time_ms = Instant::now().duration_since(exec_start).as_millis() as u64; - let mut app_metadata = match app_metadata { Some(meta) => meta, - None => HashMap::new() - }; - + None => HashMap::new(), + }; + app_metadata.insert("readVersion".to_owned(), snapshot.version().into()); let merge_metrics = serde_json::to_value(metrics.clone()); @@ -1403,7 +1402,6 @@ async fn execute( if let Ok(map) = merge_metrics { app_metadata.insert("operationMetrics".to_owned(), map); } - // Do not make a commit when there are zero updates to the state if !actions.is_empty() { diff --git a/crates/deltalake-core/src/operations/update.rs b/crates/deltalake-core/src/operations/update.rs index cc51d65e10..1fad08e820 100644 --- a/crates/deltalake-core/src/operations/update.rs +++ b/crates/deltalake-core/src/operations/update.rs @@ -411,9 +411,9 @@ async fn execute( let mut app_metadata = match app_metadata { Some(meta) => meta, - None => HashMap::new() - }; - + None => HashMap::new(), + }; + app_metadata.insert("readVersion".to_owned(), snapshot.version().into()); let update_metrics = serde_json::to_value(metrics.clone());