Dandandan commented on code in PR #24517:
URL: https://github.com/apache/datafusion/pull/24517#discussion_r3821944378
##########
datafusion/physical-plan/src/joins/sort_merge_join/exec.rs:
##########
@@ -589,7 +659,16 @@ impl ExecutionPlan for SortMergeJoinExec {
spill_manager,
context.runtime_env(),
)
- }
+ }?;
+
+ let Some(projection) = self.projection.clone() else {
+ return Ok(joined);
+ };
Review Comment:
Agreed, and thanks for saying it can be separate — I have left it out here.
For context on why it is not a small change: `SortMergeJoinExec` has no
`column_indices` field to remap. The projection is applied to the output batch,
while both streams assemble batches against the unprojected join schema in
several places and the materializing one interacts with deferred filter
correction. Threading the projection through that is what would let the join
stop building the columns it drops, which is where the actual speedup lives —
this PR only removes the operator above the join.
--
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]