As discussed in #19426 currently evaluation of stable functions is handled in ScalarUDFImpl::simplify().
It would be nicer if it could be handled in ScalarUDFImpl::invoke_with_args:
- If no simplifier is run the function can have runtime behavior, e.g. returning the fixed execution time.
- If a simplifier is run the simplifier can call
invoke_with_args to hit the same code path.
This seems to require refactoring PhysicalExpr::evaluate(RecordBatch) into PhysicalExpr::evaluate_with_args(EvaluateArgs) where EvaluateArgs is symmetrical to ScalarFunctionArgs