bkietz commented on a change in pull request #7318:
URL: https://github.com/apache/arrow/pull/7318#discussion_r434162682



##########
File path: cpp/src/arrow/compute/function.h
##########
@@ -229,5 +233,22 @@ class ARROW_EXPORT ScalarAggregateFunction
       const std::vector<ValueDescr>& values) const;
 };
 
+/// \brief A function that dispatches to other functions. Must override
+/// Function::Execute.
+///
+/// For Array, ChunkedArray, and Scalar Datum kinds, may rely on the execution
+/// of concrete Function types, but must handle other Datum kinds on its own.
+class ARROW_EXPORT MetaFunction : public Function {
+ public:
+  int num_kernels() const override { return 0; }
+
+  Result<Datum> Execute(const std::vector<Datum>& args, const FunctionOptions* 
options,
+                        ExecContext* ctx) const override;
+
+ protected:

Review comment:
       Instead of refusing the bequest by default, I think it'd be better to 
provide a pure virtual function for MetaFunction subclasses to override:
   ```suggestion
     Result<Datum> Execute(const std::vector<Datum>& args, const 
FunctionOptions* options,
                           ExecContext* ctx) const override {
       return ExecuteImpl(args, options, ctx);
     }
   
    protected:
     virtual Result<Datum> ExecuteImpl(const std::vector<Datum>& args, const 
FunctionOptions* options,
                           ExecContext* ctx) const = 0;
   ```




----------------------------------------------------------------
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:
us...@infra.apache.org


Reply via email to