You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2021/05/06 20:05:24 UTC

[GitHub] [arrow-datafusion] Dandandan commented on issue #237: Extend & generalize constant folding / evaluation in logical optimizer

Dandandan commented on issue #237:
URL: https://github.com/apache/arrow-datafusion/issues/237#issuecomment-833824075


   @alamb just picking your brain here - do you think this should be part of the logical optimizations or physical optimizations? 
   I think the suggested route (re-use evaluation code) is only feasible for the physical optimization, not the logical optimization rules.
   
   A way that could work within the current setup for `PhysicalExpr`:
   * Evaluation is implemented for `PhysicalExpr`s not `Exprs`. An empty `RecordBatch` could be used to call into the code and extract the scalar values (if any).
   
   This makes it a bit less useful (still useful nonetheless), as some other optimizations might benefit from constant folding
   
   I am wondering here in general, whether we can/should unify `LogicalPlan`/`PhysicalPlan` `Expr`/`PhysicalExpr` a bit more in order to not have to write two versions of the same thing or being limited in the optimizations / optimization order.


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org