geoffreyclaude commented on code in PR #26118:
URL: https://github.com/apache/datafusion/pull/26118#discussion_r4375688655
##########
datafusion/physical-optimizer/src/ensure_requirements/enforce_sorting/sort_pushdown.rs:
##########
@@ -661,8 +623,21 @@ fn pushdown_requirement_to_children(
}
} else if let Some(hash_join) = plan.downcast_ref::<HashJoinExec>() {
handle_hash_join(hash_join, parent_required)
+ } else if plan.is::<BufferExec>()
+ || plan.is::<CooperativeExec>()
+ || plan.is::<OutputRequirementExec>()
+ || plan.is::<ScalarSubqueryExec>()
+ {
+ // These operators expose the first child's columns without
transformation.
+ // Scalar subquery children compute side inputs and do not contribute
rows.
+ let mut child_requirements = vec![None; plan.children().len()];
+ child_requirements[0] = Some(parent_required);
+ Ok(Some(child_requirements))
} else {
- handle_custom_pushdown(plan, parent_required, &maintains_input_order)
+ // Preserving row positions does not identify the input expressions
needed
Review Comment:
Thanks, I went with your suggestion. The fallback now checks the node’s
input requirements and recomputed output ordering before accepting pushdown, so
transparent custom nodes keep the optimization.
--
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]