gene-bordegaray commented on code in PR #20901:
URL: https://github.com/apache/datafusion/pull/20901#discussion_r2989902471
##########
datafusion/physical-expr-common/src/physical_expr.rs:
##########
@@ -416,6 +416,28 @@ pub trait PhysicalExpr: Any + Send + Sync + Display +
Debug + DynEq + DynHash {
0
}
+ /// Bind runtime-specific data into this expression, if needed.
+ ///
+ /// This hook lets an expression replace itself with a runtime-bound
version using the given
+ /// `context` (e.g. binding a per-partition view).
+ ///
+ /// Binding is single-pass over the existing tree. If this method returns
a replacement
+ /// expression that itself contains additional bindable nodes, those newly
introduced nodes are
+ /// not rebound in the same call.
+ ///
+ /// You should not call this method directly as it does not handle
recursion. Instead use
+ /// [`bind_runtime_physical_expr`] to handle recursion and bind the full
expression tree.
+ ///
+ /// Note for implementers: this method should not handle recursion.
+ /// Recursion is handled in [`bind_runtime_physical_expr`].
+ fn bind_runtime(
Review Comment:
yes the intended call site is in `open()` since you know the runtime context
there for partitioning, but I added that this is generic because this function
is not limited to partition number, it could be anything you may want to put in
an expression at runtime.
--
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]