universalmind303 opened a new issue, #10018:
URL: https://github.com/apache/arrow-datafusion/issues/10018

   ### Is your feature request related to a problem or challenge?
   
   
   if you have some structs that you want to loosely couple to datafusion, it 
is now impossible. 
   
   for example with <37
   
   
   ```rs
   #[derive(Debug, Clone)]
   pub struct MyStruct {
       projection: Arc<Schema>,
       predicate_projection: Arc<Schema>,
       // ...
   }
   ```
   
   and then you can just implement the trait as one would expect
   ```
   impl ExecutionPlan for MyStruct {
   
       fn output_partitioning(&self) -> Partitioning {
           Partitioning::UnknownPartitioning(1)
       }
   
       fn output_ordering(&self) -> 
Option<&[datafusion::physical_expr::PhysicalSortExpr]> {
           None
       }
    // ...   
   }
   
   ```
   
   But with datafusion 37, the datafusion specific components are now leaked 
into the outer struct, and force the user to modify the struct to contain 
`PlanProperties`. 
   
   
   ```rs
   impl ExecutionPlan for MyStruct {
     fn properties(&self) -> &PlanProperties {
       // no possible way to create `&PlanProperties`. 
       // the only option is to add it as a field on `MyStruct`
       // which breaks the encapsulation of `ExecutionPlan`
     }
   }
   ```
   
   
   ### Describe the solution you'd like
   
   modify `ExecutionPlan` to not have any methods that return a reference. 
Specifically `ExecutionPlan::properties`
   
   If a reference is wanted for performance reasons, we should instead use 
`Cow<PlanProperties>`.
   
   
   ### Describe alternatives you've considered
   
   NA
   
   ### Additional context
   
   _No response_


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

Reply via email to