seddonm1 commented on pull request #9976:
URL: https://github.com/apache/arrow/pull/9976#issuecomment-817237604
@jorgecarleitao
So my challenge is this function signature:
```rust
/// Scalar function
pub type ScalarFunctionImplementation = Arc<dyn Fn(&[ColumnarValue]) ->
Result<ColumnarValue> + Send + Sync>;
```
which is required for the physical expression:
```rust
/// Physical expression of a scalar function
pub struct ScalarFunctionExpr {
fun: ScalarFunctionImplementation,
name: String,
args: Vec<Arc<dyn PhysicalExpr>>,
return_type: DataType,
}
```
I can either change this type alias to accept additional parameters (in this
case I could also pass the `LogicalPlan`) which would require changes to all
`BuiltinScalarFunction`s or I have to create a second implementation of
`ScalarFunctionExpr` like `ScalarFunctionPlanExpr` which passes in the plan
with the modified type signature. Both are do-able but have drawbacks.
Thoughts?
--
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:
[email protected]