askalt commented on code in PR #19806:
URL: https://github.com/apache/datafusion/pull/19806#discussion_r2690541833
##########
datafusion/physical-plan/src/execution_plan.rs:
##########
@@ -1384,6 +1385,28 @@ pub fn check_not_null_constraints(
Ok(batch)
}
+/// Make plan ready to be re-executed returning its clone with state reset for
all nodes.
+///
+/// Some plans will change their internal states after execution, making them
unable to be executed again.
+/// This function uses [`ExecutionPlan::reset_state`] to reset any internal
state within the plan.
+///
+/// An example is `CrossJoinExec`, which loads the left table into memory and
stores it in the plan.
+/// However, if the data of the left table is derived from the work table, it
will become outdated
+/// as the work table changes. When the next iteration executes this plan
again, we must clear the left table.
+///
+/// # Note
+///
+/// While this function enables plan reuse, it does not allow the same plan to
be executed concurrently if
Review Comment:
```suggestion
/// While this function enables plan reuse, it does not allow the same plan
to be executed if
```
--
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]