ozankabak commented on code in PR #11875:
URL: https://github.com/apache/datafusion/pull/11875#discussion_r1709153015
##########
datafusion/core/src/physical_optimizer/sort_pushdown.rs:
##########
@@ -30,49 +29,73 @@ use crate::physical_plan::sorts::sort::SortExec;
use crate::physical_plan::tree_node::PlanContext;
use crate::physical_plan::{ExecutionPlan, ExecutionPlanProperties};
-use datafusion_common::tree_node::Transformed;
+use datafusion_common::tree_node::{ConcreteTreeNode, Transformed,
TreeNodeRecursion};
use datafusion_common::{plan_err, JoinSide, Result};
use datafusion_expr::JoinType;
use datafusion_physical_expr::expressions::Column;
use datafusion_physical_expr::{
LexRequirementRef, PhysicalSortExpr, PhysicalSortRequirement,
};
+#[derive(Default, Clone)]
+pub struct ParentRequirements {
+ ordering_requirement: Option<Vec<PhysicalSortRequirement>>,
+ fetch: Option<usize>,
+}
+
/// This is a "data class" we use within the [`EnforceSorting`] rule to push
/// down [`SortExec`] in the plan. In some cases, we can reduce the total
/// computational cost by pushing down `SortExec`s through some executors. The
/// object carries the parent required ordering as its data.
///
/// [`EnforceSorting`]:
crate::physical_optimizer::enforce_sorting::EnforceSorting
Review Comment:
```suggestion
/// This is a "data class" we use within the [`EnforceSorting`] rule to push
/// down [`SortExec`] in the plan. In some cases, we can reduce the total
/// computational cost by pushing down `SortExec`s through some executors.
The
/// object carries the parent required ordering as its data.
///
/// [`EnforceSorting`]:
crate::physical_optimizer::enforce_sorting::EnforceSorting
#[derive(Default, Clone)]
pub struct ParentRequirements {
ordering_requirement: Option<Vec<PhysicalSortRequirement>>,
fetch: Option<usize>,
}
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]