rtpsw commented on code in PR #14043:
URL: https://github.com/apache/arrow/pull/14043#discussion_r966061589


##########
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:
   The `FunctionOptions` are cached during kernel initialization, at 
`FunctionExecutor.Init`. I think we could only have a variant with a 
`FunctionOptions` argument only in case kernel resolution has occurred, but not 
in case kernel initialization has also occurred. So, it might be clearer to 
define two interfaces, `ResolvedKernelExecutor` and `InitedKernelExecutor`, to 
distinguish the two cases. WDYT?



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