JanKaul commented on issue #17719:
URL: https://github.com/apache/datafusion/issues/17719#issuecomment-3375967951

   We are talking about this in the context of creating an API for query 
optimization. It looks like the query optimization logic will be part of the 
`into_plan` method.
   
   To be able to plug in custom implementations we somehow need an 
interface(trait) for that. I could think of the following ways to do this:
   
   ## Additional `JoinGraphPlanner` trait
   ```rust
   trait JoinGraphPlanner{
     fn plan_join_graph(join_graph: JoinGraph) -> Result<LogicalPlan>
   }
   ```
   
   ## `JoinGraph` as a trait
   ```rust
   trait JoinGraph {
     fn new_from_plan(logical_plan: LogicalPlan) -> Result<Self> {
       ... default implementation
     }
   ...
     fn into_plan(self) -> Result<LogicalPlan> {
       ... provide custom implementation
     }
   }
   ```
   
   ## `plan_join_graph` function
   Extension point for datafusion to accept a function with the following 
signature:
   ```rust
   Fn(join_graph: JoinGraph) -> Result<LogicalPlan>
   ```


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