Skip to content

Commit

Permalink
fix: stats is optional in add action
Browse files Browse the repository at this point in the history
  • Loading branch information
jkylling committed Sep 3, 2024
1 parent 4ee4e54 commit 2266a5a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions crates/core/src/kernel/snapshot/parse.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ pub(super) fn read_adds(array: &dyn ProvidesColumnByName) -> DeltaResult<Vec<Add
let size = ex::extract_and_cast::<Int64Array>(arr, "size")?;
let modification_time = ex::extract_and_cast::<Int64Array>(arr, "modificationTime")?;
let data_change = ex::extract_and_cast::<BooleanArray>(arr, "dataChange")?;
let stats = ex::extract_and_cast::<StringArray>(arr, "stats")?;
let stats = ex::extract_and_cast_opt::<StringArray>(arr, "stats");
let tags = ex::extract_and_cast_opt::<MapArray>(arr, "tags");
let dv = ex::extract_and_cast_opt::<StructArray>(arr, "deletionVector");

Expand Down Expand Up @@ -126,7 +126,7 @@ pub(super) fn read_adds(array: &dyn ProvidesColumnByName) -> DeltaResult<Vec<Add
size: ex::read_primitive(size, i)?,
modification_time: ex::read_primitive(modification_time, i)?,
data_change: ex::read_bool(data_change, i)?,
stats: ex::read_str_opt(stats, i).map(|s| s.to_string()),
stats: stats.and_then(|stats| ex::read_str_opt(stats, i).map(|s| s.to_string())),
partition_values: pvs
.and_then(|pv| collect_map(&pv.value(i)).map(|m| m.collect()))
.unwrap_or_default(),
Expand Down

0 comments on commit 2266a5a

Please sign in to comment.