rtpsw commented on code in PR #14043: URL: https://github.com/apache/arrow/pull/14043#discussion_r966094077
########## cpp/src/arrow/compute/exec.h: ########## @@ -442,5 +443,44 @@ Result<Datum> CallFunction(const std::string& func_name, const ExecBatch& batch, /// @} +/// \defgroup compute-function-executor One-shot calls to obtain function executors +/// +/// @{ + +/// \brief One-shot executor provider for all types of functions. +/// +/// Does kernel dispatch and argument checking, while iteration of ChunkedArray inputs +/// and wrapping of outputs are deferred to the executor. +ARROW_EXPORT +Result<std::shared_ptr<FunctionExecutor>> GetFunctionExecutor( + const std::string& func_name, const std::vector<Datum>& args, + const FunctionOptions* options, ExecContext* ctx = NULLPTR); + +/// \brief Variant of GetFunctionExecutor which uses a function's default options. +/// +/// NB: Some functions require FunctionOptions be provided. +ARROW_EXPORT +Result<std::shared_ptr<FunctionExecutor>> GetFunctionExecutor( + const std::string& func_name, const std::vector<Datum>& args, + ExecContext* ctx = NULLPTR); Review Comment: I'm not sure myself. What I can say is that for my UDF purposes I need to a reusable executor that is both resolved and initialized; in particular, the initialization involves invoking a UDF (which should not be repeatedly invoked on each execution). From your comments here, my understanding is you want a reusable executor that is just resolved. So, in my mind, both are useful. A possible solution for hiding the concepts of kernel resolution and initialization from the user is to have just one interface, `FunctionExecutor`, that can be obtained with (resp. without) a `FunctionOptions` argument that is valid for execution without (resp. with) a `FunctionOptions` argument. -- 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-unsubscr...@arrow.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org