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

Minor: pass ParquetFileMetrics to build_row_filter in parquet #4161

Merged
merged 1 commit into from
Nov 10, 2022
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
3 changes: 1 addition & 2 deletions datafusion/core/src/physical_plan/file_format/parquet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -414,8 +414,7 @@ impl FileOpener for ParquetOpener {
table_schema.as_ref(),
builder.metadata(),
reorder_predicates,
&file_metrics.pushdown_rows_filtered,
&file_metrics.pushdown_eval_time,
&file_metrics,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it was just bothering me for some reason that this was different than prune_row_groups and build_page_filter

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Keep align is necessary. Will keep in mind in future.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(to be clear I was the one who wrote the original code that was not consistent -- so I need to keep it in mind :) )

);

match row_filter {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ use std::sync::Arc;

use crate::physical_plan::metrics;

use super::ParquetFileMetrics;

/// This module contains utilities for enabling the pushdown of DataFusion filter predicates (which
/// can be any DataFusion `Expr` that evaluates to a `BooleanArray`) to the parquet decoder level in `arrow-rs`.
/// DataFusion will use a `ParquetRecordBatchStream` to read data from parquet into arrow `RecordBatch`es.
Expand Down Expand Up @@ -309,9 +311,11 @@ pub fn build_row_filter(
table_schema: &Schema,
metadata: &ParquetMetaData,
reorder_predicates: bool,
rows_filtered: &metrics::Count,
time: &metrics::Time,
file_metrics: &ParquetFileMetrics,
) -> Result<Option<RowFilter>> {
let rows_filtered = &file_metrics.pushdown_rows_filtered;
let time = &file_metrics.pushdown_eval_time;

let predicates = split_conjunction_owned(expr);

let mut candidates: Vec<FilterCandidate> = predicates
Expand Down