-
Notifications
You must be signed in to change notification settings - Fork 1k
Description
Is your feature request related to a problem or challenge? Please describe what you are trying to do.
- Related to Enable parquet filter pushdown (
filter_pushdown
) by default datafusion#3463 in DataFusion.
When evaluating filters on data stored in parquet, you can:
- Use the
with_row_filter
API to apply predicates during the scan - Read the data and apply the predicate using the
filter
kernel afterwards
Currently, it is faster to use with_row_filter
for some predicates and filter
for others. In DataFusion we have a configuration setting to choose between the strategies (filter_pushdown
, see apache/datafusion#3463) but that is a bad UX as it
means the user must somehow know which strategy to choose, but the strategy changes
In general the queries that are slower when with_row_filter
is used:
- The predicates are not very selective (e.g. they pass more than 1% of the rows)
- The filters are applied to columns which are also used in the query result (e.g. the a filter column is also in the projection)
More Background:
The predicates are provides as a RowFilter
(see docs for more details)
RowFilter applies predicates in order, after decoding only the columns required. As predicates eliminate rows, fewer rows from subsequent columns may be required, thus potentially reducing IO and decode.
Describe the solution you'd like
I would like the evaluation of predicates in RowFilter
(aka pushed down predicates) to never be worse than decoding the columns first and then filtering them with the filter
kernel
We have added a benchmark #7401, which hopefully can
cargo bench --all-features --bench arrow_reader_row_filter
Describe alternatives you've considered
This goal will likely require several changes to the codebase. Here are some options:
- Add benchmark for parquet reader with row_filter and project settings #7401
- arrow_reader_row_filter benchmark doesn't capture page cache improvements #7460
- Benchmark for filter+concat and take+concat into even sized record batches #7589
- Parquet decoder / decoded predicate / page / results Cache #7363
- Adaptive Parquet Predicate Pushdown Evaluation #5523
- Consider removing
skip
fromRowSelector
#7450 -
RowSelection::and_then
is slow #7458 - improve: reuse
Arc<dyn Array>
in parquet record batch reader. #4864