gabotechs commented on PR #18168:
URL: https://github.com/apache/datafusion/pull/18168#issuecomment-3536269209

   > My only feedback for review is if we should add a new argument with 
Extensions or make the argument OptimizerContext so that we can make future 
changes without it being breaking
   
   I'm trying to look for inspiration in the docs for this, and I found:
   
https://docs.rs/datafusion/latest/datafusion/execution/context/struct.SessionContext.html#relationship-between-sessioncontext-sessionstate-and-taskcontext
   
   > ##  Relationship between SessionContext, SessionState, and TaskContext
   > The state required to optimize, and evaluate queries is broken into three 
levels to allow tailoring
   > 
   > The objects are:
   >
   > 
[SessionContext](https://docs.rs/datafusion/latest/datafusion/execution/context/struct.SessionContext.html):
 Most users should use a SessionContext. It contains all information required 
to execute queries including high level APIs such as 
[SessionContext::sql](https://docs.rs/datafusion/latest/datafusion/execution/context/struct.SessionContext.html#method.sql).
 All queries run with the same SessionContext share the same configuration and 
resources (e.g. memory limits).
   >
   > 
[SessionState](https://docs.rs/datafusion/latest/datafusion/execution/session_state/struct.SessionState.html):
 contains information required to plan and execute an individual query (e.g. 
creating a 
[LogicalPlan](https://docs.rs/datafusion/latest/datafusion/logical_expr/enum.LogicalPlan.html)
 or 
[ExecutionPlan](https://docs.rs/datafusion/latest/datafusion/physical_plan/trait.ExecutionPlan.html)).
 Each query is planned and executed using its own SessionState, which can be 
created with 
[SessionContext::state](https://docs.rs/datafusion/latest/datafusion/execution/context/struct.SessionContext.html#method.state).
 SessionState allows finer grained control over query execution, for example 
disallowing DDL operations such as CREATE TABLE.
   >
   > 
[TaskContext](https://docs.rs/datafusion/latest/datafusion/execution/struct.TaskContext.html)
 contains the state required for query execution (e.g. 
[ExecutionPlan::execute](https://docs.rs/datafusion/latest/datafusion/physical_plan/trait.ExecutionPlan.html#tymethod.execute)).
 It contains a subset of information in 
[SessionState](https://docs.rs/datafusion/latest/datafusion/execution/session_state/struct.SessionState.html).
 TaskContext allows executing 
[ExecutionPlan](https://docs.rs/datafusion/latest/datafusion/physical_plan/trait.ExecutionPlan.html)s
 
[PhysicalExpr](https://docs.rs/datafusion/latest/datafusion/physical_expr/trait.PhysicalExpr.html)s
 without requiring a full 
[SessionState](https://docs.rs/datafusion/latest/datafusion/execution/session_state/struct.SessionState.html).
   
   Following that same pattern, for the same reason that a `TaskContext` exists 
for execution, one could argue that an equivalent `OptimizerContext` struct for 
optimization steps could make sense.
   
   WDYT?


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