alamb commented on code in PR #26270:
URL: https://github.com/apache/datafusion/pull/26270#discussion_r4791679698


##########
datafusion/execution/src/task.rs:
##########
@@ -53,6 +69,71 @@ pub struct TaskContext {
     window_functions: HashMap<String, Arc<WindowUDF>>,
     /// Runtime environment associated with this task context
     runtime: Arc<RuntimeEnv>,
+    /// State that operators keep for one run of a plan
+    run_state: Arc<RunState>,

Review Comment:
   If we went with an approach like this it seems to me like we would want some 
general way to associate a plan node with its "state" in some way that could be 
shared with other nodes
   
   For example, in a dynamic filter, we would need some way for both the 
producer (e.g. topk) and cosumer (e.g. scan) to find the same state
   
   ```
   (SortExec -- dynamic filter producer) 
     ...
       (Scan -- dynamic filter consumer)
   ```
   
   One way could be something like a generic
   `NodeId` or `StateId` field that was assigned at plan time (so the SortExec 
would have NodeId=100 say, and the scan would have NodeId=200, but also know 
that its dynamic filter came from NodeId=100
   
   
   The actaul state I would imagine in an `Arc<dyn Any + Send + Sync>` type 
situation



-- 
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]

Reply via email to