Skip to content

Apache DataFusion SQL Query Engine

Remove unused ExecutionPlan::relies_input_order (has been replaced with required_input_ordering) (#4856)

Andrew Lamb39d98f8f4528
diff --git a/datafusion/core/src/physical_optimizer/repartition.rs b/datafusion/core/src/physical_optimizer/repartition.rs
index 98ca12a9ef..806ed1d4b4 100644
--- a/datafusion/core/src/physical_optimizer/repartition.rs
+++ b/datafusion/core/src/physical_optimizer/repartition.rs
@@ -140,9 +140,6 @@ impl Repartition {
///
/// 2. Has a direct parent that `benefits_from_input_partitioning`
///
-/// 3. Does not have a parent that `relies_on_input_order` unless there
-/// is an intervening node that does not `maintain_input_order`
-///
/// if `can_reorder` is false, means that the output of this node
/// can not be reordered as as the final output is relying on that order
///
diff --git a/datafusion/core/src/physical_plan/limit.rs b/datafusion/core/src/physical_plan/limit.rs
index 776fefd8bf..eec66eb70a 100644
--- a/datafusion/core/src/physical_plan/limit.rs
+++ b/datafusion/core/src/physical_plan/limit.rs
@@ -105,10 +105,6 @@ impl ExecutionPlan for GlobalLimitExec {
Partitioning::UnknownPartitioning(1)
}
- fn relies_on_input_order(&self) -> bool {
- self.input.output_ordering().is_some()
- }
-
fn maintains_input_order(&self) -> bool {
true
}
@@ -274,10 +270,6 @@ impl ExecutionPlan for LocalLimitExec {
self.input.output_partitioning()
}
- fn relies_on_input_order(&self) -> bool {
- self.input.output_ordering().is_some()
- }
-
fn benefits_from_input_partitioning(&self) -> bool {
false
}
diff --git a/datafusion/core/src/physical_plan/mod.rs b/datafusion/core/src/physical_plan/mod.rs
index d7383f2315..b9a0d9707e 100644
--- a/datafusion/core/src/physical_plan/mod.rs
+++ b/datafusion/core/src/physical_plan/mod.rs
@@ -141,27 +141,6 @@ pub trait ExecutionPlan: Debug + Send + Sync {
vec![None; self.children().len()]
}
- /// Returns `true` if this operator relies on its inputs being
- /// produced in a certain order (for example that they are sorted
- /// a particular way) for correctness.
- ///
- /// If `true` is returned, DataFusion will not apply certain
- /// optimizations which might reorder the inputs (such as
- /// repartitioning to increase concurrency).
- ///
- /// The default implementation checks the input ordering requirements
- /// and if there is non empty ordering requirements to the input, the method will
- /// return `true`.
- ///
- /// WARNING: if you override this default and return `false`, your
- /// operator can not rely on DataFusion preserving the input order
- /// as it will likely not.
- fn relies_on_input_order(&self) -> bool {
- self.required_input_ordering()
- .iter()
- .any(|ordering| matches!(ordering, Some(_)))
- }
-
/// Returns `false` if this operator's implementation may reorder
/// rows within or between partitions.
///
diff --git a/datafusion/core/src/scheduler/pipeline/execution.rs b/datafusion/core/src/scheduler/pipeline/execution.rs
index 8ecece85e9..b5aa9aff6d 100644
--- a/datafusion/core/src/scheduler/pipeline/execution.rs
+++ b/datafusion/core/src/scheduler/pipeline/execution.rs
@@ -239,10 +239,6 @@ impl ExecutionPlan for ProxyExecutionPlan {
self.inner.required_input_distribution()
}
- fn relies_on_input_order(&self) -> bool {
- self.inner.relies_on_input_order()
- }
-
fn maintains_input_order(&self) -> bool {
self.inner.maintains_input_order()
}