askalt commented on PR #20337:
URL: https://github.com/apache/datafusion/pull/20337#issuecomment-4046149509

   > 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? 🤔
   
   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:
   
   ```rust
   struct MapExpressionsArgs<'a> {
       f: &'a dyn FnMut(&Arc<dyn PhysicalExpr>) -> Result<Arc<dyn 
PhysicalExpr>>,
       preserve_properties: bool,
   }
   ```
   
   Like is done here:  
https://github.com/apache/datafusion/blob/8d9b080882179b618a2057e042fc32865f6484b4/datafusion/catalog/src/table.rs#L366-L372
   
   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