askalt commented on code in PR #20228:
URL: https://github.com/apache/datafusion/pull/20228#discussion_r2788247999
##########
datafusion/physical-plan/src/joins/hash_join/exec.rs:
##########
@@ -1476,12 +1517,32 @@ impl ExecutionPlan for HashJoinExec {
filter: dynamic_filter,
build_accumulator: OnceLock::new(),
}),
+ fetch: self.fetch,
});
result = result.with_updated_node(new_node as Arc<dyn
ExecutionPlan>);
}
}
Ok(result)
}
+
+ fn supports_limit_pushdown(&self) -> bool {
+ // Hash join execution plan does not support pushing limit down
through to children
+ // because the children don't know about the join condition and can't
+ // determine how many rows to produce
+ false
+ }
+
+ fn fetch(&self) -> Option<usize> {
+ self.fetch
+ }
+
+ fn with_fetch(&self, limit: Option<usize>) -> Option<Arc<dyn
ExecutionPlan>> {
+ HashJoinExecBuilder::from(self)
Review Comment:
Builder was added to have an ability to build `HashJoinExec` using:
1. `projection: Option<Vec<usize>>` (not break existing `try_new` API)
2. shared projection `Option<ProjectionRef>` (to share projection if exec is
created from another one and the projection is preserved).
The reason to not use `impl Option<Into<ProjectionRef>>` as `try_new` arg
here: it requires to specify `None` type explicitly when pass `None`. The
reason to not add an another `try_new_with_shared_projection`: it looks
confusing as we don't want to create a new constructor each time when some arg
need to be either one thing or another.
If we keep the builder, to reduce hidden semantics as much as possible, it
should keep all existing fields when constructed from the existing exec,
allowing customizing things that must be rest. I will make a patch for it.
--
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]