Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 17 additions & 1 deletion datafusion/physical-plan/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,23 @@ pub trait ExecutionPlan: Debug + DisplayAs + Send + Sync {
.collect()
}

/// Get the [`EquivalenceProperties`] within the plan
/// Get the [`EquivalenceProperties`] within the plan.
///
/// Equivalence properties tell DataFusion what columns are known to be
/// equal, during various optimization passes. By default, this returns "no
/// known equivalences" which is always correct, but may cause DataFusion to
/// unnecessarily resort data.
///
/// If this ExecutionPlan makes no changes to the schema of the rows flowing
/// through it or how columns within each row relate to each other, it
/// should return the equivalence properties of its input. For
/// example, since `FilterExec` may remove rows from its input, but does not
/// otherwise modify them, it preserves its input equivalence properties.
/// However, since `ProjectionExec` may calculate derived expressions, it
/// needs special handling.
///
/// See also [`Self::maintains_input_order`] and [`Self::output_ordering`]
/// for related concepts.
fn equivalence_properties(&self) -> EquivalenceProperties {
EquivalenceProperties::new(self.schema())
}
Expand Down