Module datafusion_optimizer::utils
source · Expand description
Collection of utility functions that are leveraged by the query optimizer rules
Functions
- returns a new LogicalPlan that wraps
plan
in a LogicalPlan::Filter with its predicate be allpredicates
ANDed. - Combines an array of filter expressions into a single filter expression consisting of the input filter expressions joined with logical AND.
- Combines an array of filter expressions into a single filter expression consisting of the input filter expressions joined with logical OR.
- Looks for correlating expressions: for example, a binary expression with one field from the subquery, and one not in the subquery (closed upon from outer scope)
- Log the plan in debug/tracing mode after some part of the optimizer runs
- merge inputs schema into a single schema.
- Returns the first (and only) element in a slice, or an error
- Convenience rule for writing optimizers: recursively invoke optimize on plan’s children and then return a node of the same type. Useful for optimizer rules which want to leave the type of plan unchanged but still apply to the children. This also handles the case when the
plan
is aLogicalPlan::Explain
.