2323//! that a consumer needs to decide how to apply it (for example, whether it
2424//! is required for correctness).
2525//!
26+ //! The expression of each conjunct must return a `Boolean` value. A row
27+ //! passes a conjunct only when the value is `true`: `false` and `NULL`
28+ //! remove the row. The type system does not enforce this rule. The code that
29+ //! makes a [`FilterConjunct`] must make sure that the expression is boolean.
30+ //!
2631//! A [`PhysicalFilter`] is *not* a [`PhysicalExpr`]. Use
2732//! [`PhysicalFilter::to_expr`] to get one expression (the `AND` of all
2833//! conjuncts) for code that only accepts expressions.
@@ -41,6 +46,10 @@ use crate::utils::{conjunction, conjunction_opt, split_conjunction};
4146/// consumer can skip an *optional* conjunct (for example, a dynamic filter
4247/// from a hash join) without an effect on the result, because another
4348/// operator removes the same rows again.
49+ ///
50+ /// The expression must return a `Boolean` value. A row passes the conjunct
51+ /// only when the value is `true` (`NULL` removes the row, as `false` does).
52+ /// The constructors do not check the type. See the [module docs](self).
4453#[ derive( Debug , Clone ) ]
4554pub struct FilterConjunct {
4655 expr : Arc < dyn PhysicalExpr > ,
@@ -64,7 +73,7 @@ impl FilterConjunct {
6473 }
6574 }
6675
67- /// The boolean expression of this conjunct.
76+ /// The expression of this conjunct. It returns a `Boolean` value .
6877 pub fn expr ( & self ) -> & Arc < dyn PhysicalExpr > {
6978 & self . expr
7079 }
0 commit comments