askalt commented on code in PR #20276:
URL: https://github.com/apache/datafusion/pull/20276#discussion_r2807701664
##########
datafusion/physical-plan/src/joins/hash_join/exec.rs:
##########
@@ -288,63 +297,92 @@ impl HashJoinExecBuilder {
/// Set projection from the shared reference.
pub fn with_projection_ref(mut self, projection: Option<ProjectionRef>) ->
Self {
- self.projection = projection;
+ self.exec.projection = projection;
+ self.preserve_properties = false;
self
}
/// Set optional filter.
pub fn with_filter(mut self, filter: Option<JoinFilter>) -> Self {
- self.filter = filter;
+ self.exec.filter = filter;
+ self
+ }
+
+ /// Set expressions to join on.
+ pub fn with_on(mut self, on: Vec<(PhysicalExprRef, PhysicalExprRef)>) ->
Self {
+ self.exec.on = on;
+ self.preserve_properties = false;
self
}
/// Set partition mode.
pub fn with_partition_mode(mut self, mode: PartitionMode) -> Self {
- self.partition_mode = mode;
+ self.exec.mode = mode;
+ self.preserve_properties = false;
self
}
/// Set null equality property.
pub fn with_null_equality(mut self, null_equality: NullEquality) -> Self {
- self.null_equality = null_equality;
+ self.exec.null_equality = null_equality;
self
}
/// Set null aware property.
pub fn with_null_aware(mut self, null_aware: bool) -> Self {
- self.null_aware = null_aware;
+ self.exec.null_aware = null_aware;
self
}
+ /// Require to recompute plan properties.
+ pub fn recompute_properties(mut self) -> Self {
+ self.preserve_properties = false;
+ self
+ }
+
+ /// Replace children.
+ pub fn with_new_children(
+ mut self,
+ mut children: Vec<Arc<dyn ExecutionPlan>>,
+ ) -> Result<Self> {
+ assert_or_internal_err!(
+ children.len() == 2,
+ "wrong number of children passed into `HashJoinExecBuilder`"
+ );
+ self.exec.right = children.swap_remove(1);
+ self.exec.left = children.swap_remove(0);
+ self.preserve_properties = false;
+ Ok(self)
+ }
+
+ /// Reset node state.
+ pub fn reset_state(mut self) -> Self {
Review Comment:
Currently builder preserves runtime features until `reset_state(...)` is
called. i.e., `HashJoinExecBuilder::from(exec).build()` will keep them as is.
--
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]