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 2022/08/03 13:25:43 UTC

[GitHub] [arrow-datafusion] alamb commented on issue #3014: Add single-step versions of ExecutionPlan::execute() and PhysicalExpr::evaluate() methods

alamb commented on issue #3014:
URL: https://github.com/apache/arrow-datafusion/issues/3014#issuecomment-1203948317

   @iajoiner  I don't quite follow what you want to do...
   
   Is it like you want a way to override `PhysicalExpr::execute` for all nodes?
   
   Have you considered a wrapper that does your side effect, something like:
   
   ```rust
   
   struct PhysicalExprWithEffects {
     inner: Arc<dyn PhysicalExpr> 
   }
   
   impl PhysicalExpr for PhysicalExprWithEffects
       fn evaluate(&self, batch: &RecordBatch) -> Result<ColumnarValue> {
         // TODO: add your side effects here
         // then call the inner expr:
         self.inner.evaluate(batch)
       } 
     ...
   }
   ```
   


-- 
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: github-unsubscribe@arrow.apache.org

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