Skip to content

Commit

Permalink
fix(rust): Fix null handling in collect_statistics of parquet reader
Browse files Browse the repository at this point in the history
  • Loading branch information
codesorcery committed Dec 19, 2024
1 parent 2d24796 commit 16d660b
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions crates/polars-io/src/parquet/read/predicates.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@ pub(crate) fn collect_statistics(
let stats = schema
.iter_values()
.map(|field| {
let iter = md.columns_under_root_iter(&field.name).unwrap();

Ok(if iter.len() == 0 {
ColumnStats::new(field.into(), None, None, None)
} else {
ColumnStats::from_arrow_stats(deserialize(field, iter)?, field)
let iter = md.columns_under_root_iter(&field.name);
Ok(match iter {
Some(x) if { x.len() > 0 } => {
ColumnStats::from_arrow_stats(deserialize(field, x)?, field)
},
_ => ColumnStats::new(field.into(), None, None, None),
})
})
.collect::<PolarsResult<Vec<_>>>()?;
Expand Down

0 comments on commit 16d660b

Please sign in to comment.