LiaCastaneda commented on issue #20899:
URL: https://github.com/apache/datafusion/issues/20899#issuecomment-4055006443

   Bringing some discussions from the `apply_expressions` PR:
   
   > I think we can reuse the properties of the rest of the plan (avoiding 
::new()), similar to how 
[LogicalPlan::map_expressions](https://github.com/apache/datafusion/blob/8d9b080882179b618a2057e042fc32865f6484b4/datafusion/expr/src/logical_plan/tree_node.rs#L499)
 does it.
   > 
   > I created this issue https://github.com/apache/datafusion/issues/20899. I 
haven't started working on it yet and probably won't have much time this week, 
so I'll likely give it a try next week, but feel free to take it if you'd like'
   
   > Actually, now that I think about it, there are some cases where we would 
need to recompute properties right? for example, if a user changes an 
expression from a > something to a < something. How do we specify in this API 
whether we want to recompute properties or not? should map_expressions have a 
recompute_properties: bool argument? 🤔
   
   
   From @askalt
   
   > Yes, it may be useful to explicitly ask for properties re-computation. And 
it seems for me that by default the safest option is to force properties to be 
re-computed.
   > 
   > Another way to satisfy it is to introduce "args struct" like:
   > 
   > struct MapExpressionsArgs<'a> {
   >     f: &'a dyn FnMut(&Arc<dyn PhysicalExpr>) -> Result<Arc<dyn 
PhysicalExpr>>,
   >     preserve_properties: bool,
   > }
   > Like is done here:
   > 
   > 
[datafusion/datafusion/catalog/src/table.rs](https://github.com/apache/datafusion/blob/8d9b080882179b618a2057e042fc32865f6484b4/datafusion/catalog/src/table.rs#L366-L372)
   > 
   > Lines 366 to 372 in 
[8d9b080](https://github.com/apache/datafusion/commit/8d9b080882179b618a2057e042fc32865f6484b4)
   > 
   >  /// Arguments for scanning a table with 
[`TableProvider::scan_with_args`]. 
   >  #[derive(Debug, Clone, Default)] 
   >  pub struct ScanArgs<'a> { 
   >      filters: Option<&'a [Expr]>, 
   >      projection: Option<&'a [usize]>, 
   >      limit: Option<usize>, 
   >  } 
   > to not add a bool argument each time when the method semantics is 
extended. But maybe this is overkill here and bool parameter will be enough.


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