alamb commented on code in PR #18938:
URL: https://github.com/apache/datafusion/pull/18938#discussion_r2577655278
##########
datafusion/physical-plan/src/filter_pushdown.rs:
##########
@@ -101,46 +101,84 @@ impl PushedDownPredicate {
self.predicate
}
- /// Create a new [`PushedDownPredicate`] with supported pushdown.
+ /// Create a new [`PushedDownPredicate`] with exact pushdown.
+ /// The child will apply the filter exactly as FilterExec would.
+ pub fn exact(predicate: Arc<dyn PhysicalExpr>) -> Self {
+ Self {
+ discriminant: PushedDown::Exact,
+ predicate,
+ }
+ }
+
+ /// Create a new [`PushedDownPredicate`] with supported pushdown (exact
filtering).
+ /// This is an alias for `exact()` for backward compatibility.
pub fn supported(predicate: Arc<dyn PhysicalExpr>) -> Self {
+ Self::exact(predicate)
+ }
+
+ /// Create a new [`PushedDownPredicate`] with inexact pushdown.
+ /// The child will use the filter for stats/partial pruning but not exact
filtering.
+ pub fn inexact(predicate: Arc<dyn PhysicalExpr>) -> Self {
Self {
- discriminant: PushedDown::Yes,
+ discriminant: PushedDown::Inexact,
predicate,
}
}
/// Create a new [`PushedDownPredicate`] with unsupported pushdown.
pub fn unsupported(predicate: Arc<dyn PhysicalExpr>) -> Self {
Self {
- discriminant: PushedDown::No,
+ discriminant: PushedDown::Unsupported,
predicate,
}
}
}
/// Discriminant for the result of pushing down a filter into a child node.
-#[derive(Debug, Clone, Copy)]
+#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum PushedDown {
Review Comment:
Since this is a public enum ([doc
link](https://docs.rs/datafusion/latest/datafusion/physical_plan/filter_pushdown/enum.PushedDown.html))
I think this will be an API change (I marked the PR as such)
Can you please add a note to the DataFusion 52 upgrade guide explaining how
people need to update their existing code (e.g. if they used to return `Yes` or
`No` what should they return after this change)?
https://github.com/apache/datafusion/blob/9f725d9c7064813cda0de0f87d115354b68d76e6/docs/source/library-user-guide/upgrading.md#L22-L21
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]