Skip to content

Commit 1be6b04

Browse files
adriangbclaude
andauthored
docs: clarify what PushedDown::Yes and PushedDown::No mean (#25670)
## Which issue does this PR close? - Related to #18856 and #24528. This PR does not change the API. It only documents the two states that exist. ## Rationale for this change The docs say `PushedDown::No` means "the predicate could not be pushed down into the child node". This reads as "the child ignores the filter". But a child that replies `No` can still use the filter, for example for statistics pruning. ## What changes are included in this PR? Doc comments on `PushedDown`: | Reply | Must the parent evaluate the filter? | Can the child use the filter? | |---|---|---| | `Yes` | No. The child applies it exactly. | Yes, exactly | | `No` | Yes | Yes, in an inexact way (for example statistics pruning), or not at all | ## What is the testing strategy for this PR? Documentation only. `cargo doc -p datafusion-physical-plan` builds with `-D warnings`. ## Are there any user-facing changes? No. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
1 parent a98f304 commit 1be6b04

1 file changed

Lines changed: 15 additions & 2 deletions

File tree

‎datafusion/physical-plan/src/filter_pushdown.rs‎

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,11 +123,24 @@ impl PushedDownPredicate {
123123
}
124124

125125
/// Discriminant for the result of pushing down a filter into a child node.
126+
///
127+
/// This tells the parent whether it still has to evaluate the filter. It does
128+
/// not tell the parent how, or if, the child uses the filter.
129+
///
130+
/// For example, a child that replies [`PushedDown::No`] can still keep the
131+
/// filter and use it in an inexact way, such as to prune files, row groups or
132+
/// pages with statistics.
126133
#[derive(Debug, Clone, Copy)]
127134
pub enum PushedDown {
128-
/// The predicate was successfully pushed down into the child node.
135+
/// The child guarantees that it applies the predicate exactly: it never
136+
/// produces a row for which the predicate is not true. The parent does
137+
/// not need to evaluate the predicate again.
129138
Yes,
130-
/// The predicate could not be pushed down into the child node.
139+
/// The child does not guarantee that it applies the predicate exactly,
140+
/// so the parent must still evaluate it.
141+
///
142+
/// The child may ignore the predicate, or it may use it in an inexact
143+
/// way, for example for statistics pruning.
131144
No,
132145
}
133146

0 commit comments

Comments
 (0)