File tree 2 files changed +16
-7
lines changed
datafusion/expr/src/logical_plan
2 files changed +16
-7
lines changed Original file line number Diff line number Diff line change @@ -53,10 +53,11 @@ pub trait UserDefinedLogicalNode: fmt::Debug + Send + Sync {
53
53
/// Return the output schema of this logical plan node.
54
54
fn schema ( & self ) -> & DFSchemaRef ;
55
55
56
- /// Returns all expressions in the current logical plan node. This
57
- /// should not include expressions of any inputs (aka
58
- /// non-recursively). These expressions are used for optimizer
59
- /// passes and rewrites.
56
+ /// Returns all expressions in the current logical plan node. This should
57
+ /// not include expressions of any inputs (aka non-recursively).
58
+ ///
59
+ /// These expressions are used for optimizer
60
+ /// passes and rewrites. See [`LogicalPlan::expressions`] for more details.
60
61
fn expressions ( & self ) -> Vec < Expr > ;
61
62
62
63
/// A list of output columns (e.g. the names of columns in
Original file line number Diff line number Diff line change @@ -234,9 +234,17 @@ impl LogicalPlan {
234
234
] )
235
235
}
236
236
237
- /// returns all expressions (non-recursively) in the current
238
- /// logical plan node. This does not include expressions in any
239
- /// children
237
+ /// Returns all expressions (non-recursively) evaluated by the current
238
+ /// logical plan node. This does not include expressions in any children
239
+ ///
240
+ /// The returned expressions do not necessarily represent or even
241
+ /// contributed to the output schema of this node. For example,
242
+ /// `LogicalPlan::Filter` returns the filter expression even though the
243
+ /// output of a Filter has the same columns as the input.
244
+ ///
245
+ /// The expressions do contain all the columns that are used by this plan,
246
+ /// so if there are columns not referenced by these expressions then
247
+ /// DataFusion's optimizer attempts to optimize them away.
240
248
pub fn expressions ( self : & LogicalPlan ) -> Vec < Expr > {
241
249
let mut exprs = vec ! [ ] ;
242
250
self . inspect_expressions ( |e| {
You can’t perform that action at this time.
0 commit comments