alamb opened a new pull request #1700:
URL: https://github.com/apache/arrow-datafusion/pull/1700


   # Which issue does this PR close?
   
   Closes https://github.com/apache/arrow-datafusion/issues/1690
   
    # Rationale for this change
   
   There are several reasonable usecases for creating `PhysicalExpr`s from an 
`Expr` outside the context of `DefaultPhysicalPlanner` 
   such as predicate pruning and constant evaluation. 
   
   To create a `PhysicalExpr` on main, requires `ExecutionContextState` which 
is non trivially large (several HashMaps, and Vecs, and newly a `MemoryManager` 
and `DiskManager`). 
   
   This means that the overhead of creating physical expressions is quite large 
and getting larger!
   
   
   
   # What changes are included in this PR?
   
   Changes:
   1. Pull the `PhysicalExpr` creation logic into a free function that requires 
`ExecutionProps` rather than an entire `ExecutionContextState`
   3. Move var provider from `ExecutionContextState` into `ExecutionProps` and 
create the hash table on demand, but leave the interface on `ExecutionContext` 
the same
   2. Refactor pruning and constant evaluation to avoid creating 
`ExecutionContextState` (the real reason for this PR)
   
   
   I think in a follow on PR I would move the code into its own module but for 
this one I left it in the same one for easier diffing
   
   # Are there any user-facing changes?
   <!--
   If there are user-facing changes then we may require documentation to be 
updated before approving the PR.
   -->
   
   <!--
   If there are any breaking changes to public APIs, please add the `api 
change` label.
   -->
   


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