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


##########
cpp/src/arrow/compute/function.cc:
##########
@@ -167,6 +180,109 @@ const Kernel* DispatchExactImpl(const Function* func,
   return nullptr;
 }
 
+struct FunctionExecutorImpl : public FunctionExecutor {
+  FunctionExecutorImpl(std::vector<TypeHolder> in_types, const Kernel* kernel,
+                       std::unique_ptr<detail::KernelExecutor> executor,
+                       const Function& func)
+      : in_types(std::move(in_types)),
+        kernel(kernel),
+        kernel_ctx(),
+        executor(std::move(executor)),
+        func(func),
+        state(),
+        options(NULLPTR) {}
+  virtual ~FunctionExecutorImpl() {}
+
+  Status KernelInit(const FunctionOptions* options) {
+    if (!kernel_ctx) {
+      return Status::Invalid("function executor with null kernel context");
+    }
+    if (options == nullptr) {
+      RETURN_NOT_OK(CheckOptions(func, options));
+      options = func.default_options();
+    }

Review Comment:
   I think this should be done like in `MetaFunction::Execute` later in this 
file. The current PR code here is close to this; I'll make it the same.



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