Skip to content

Commit

Permalink
fix: Don't remember Parquet statistics if filtered (#19248)
Browse files Browse the repository at this point in the history
  • Loading branch information
coastalwhite authored Oct 16, 2024
1 parent d91b99c commit 8bf590e
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions crates/polars-io/src/parquet/read/read_impl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ fn column_idx_to_series(
file_schema: &ArrowSchema,
store: &mmap::ColumnStore,
) -> PolarsResult<Series> {
let did_filter = filter.is_some();

let field = file_schema.get_at_index(column_i).unwrap().1;

#[cfg(debug_assertions)]
Expand All @@ -91,6 +93,11 @@ fn column_idx_to_series(
_ => {},
}

// We cannot trust the statistics if we filtered the parquet already.
if did_filter {
return Ok(series);
}

// See if we can find some statistics for this series. If we cannot find anything just return
// the series as is.
let Ok(Some(stats)) = stats.map(|mut s| s.pop().flatten()) else {
Expand Down

0 comments on commit 8bf590e

Please sign in to comment.