Repository navigation
Conversation
Lazy and eager Iceberg sources now store the filters pushed to them (static and dynamic) and show them in EXPLAIN, while still reporting PushedDown::No so the parent FilterExec keeps results exact.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Builds on #1 (predicate converter); review that first.
What and why
Iceberg scans threw away every filter pushed down to them.
try_pushdown_filtersonLazyIcebergDataSourceandEagerIcebergDataSourceansweredPushedDown::Noand did not store anything. As a result, dynamic filters (for example a hash join's build-side bounds) could never reach the Iceberg reader, so there was nothing to prune files with later.This PR makes both sources keep the filters pushed to them. It does not change what gets read.
How it works
filters: Vec<Arc<dyn PhysicalExpr>>.try_pushdown_filtersappends the incoming filters to any it already holds and returns the updated source withFilterPushdownPropagation::with_updated_node. This is the same pattern DataFusion'sParquetSourceuses.Arcs DataFusion passes in. They are not copied, so aDynamicFilterPhysicalExprthat gets updated during execution stays visible through the source.try_swapping_with_projectionreturnsNone), so that schema doesn't change after pushdown.PushedDown::No. TheFilterExecabove the scan stays in the plan and keeps results exact. Nothing uses the kept filters for reading yet.apply_expressionsnow visits the kept filters, like other DataFusion sources do with their predicates.with_fetch,with_file_groups, and so on) keeps the filters, because those paths clone the source. The constructors intable_provider/scan.rsandfrom_file_groupsstart with an empty list.conjunction, so brackets are correct), and shows nothing when there are none:predicate=..., matching how DataFusion'sDataSourceExecshows predicates and dynamic filters;physical_predicate=..., because the lazy scan already printspredicate=for its Iceberg-side predicate, and two keys with the same name would be confusing.Tests
iceberg/tests/kept_filters.rshas four named tests that run the normal planning path throughIcebergTestHarnesson the taxi fixture:lazy_scan_keeps_static_filterandeager_scan_keeps_static_filter: the scan shows the kept filter, theFilterExecis still present, and the count is unchanged.lazy_scan_keeps_hash_join_dynamic_filterandeager_scan_keeps_hash_join_dynamic_filter: the probe-side scan showsDynamicFilter [ ... ], and the join result is correct.filter_pushdown.rs,limit_pushdown.rsandprojection_pushdown.rschange only to add the newphysical_predicate=text. Results are unchanged.cargo fmt --all,cargo clippy -p datafusion-distributed-iceberg --all-targets(no new warnings),cargo test -p datafusion-distributed-iceberg(all pass).