You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2022/03/31 07:27:48 UTC

[GitHub] [arrow] westonpace commented on pull request #12590: ARROW-15639 [C++][Python] UDF Scalar Function Implementation

westonpace commented on pull request #12590:
URL: https://github.com/apache/arrow/pull/12590#issuecomment-1084197255


   @vibhatha I'm not entirely clear on the concern.  I don't mind if we have an inheritence tree of object structs.  For example, this would be ok (this is totally made up and likely is not correct for aggregate UDFs at all):
   
   ```
   namespace arrow {
   namespace py {
   namespace compute {
   
   struct UdfOptions {
     cp::Function::Kind kind;
     cp::Arity arity;
     const cp::FunctionDoc func_doc;
     std::vector<cp::InputType> in_types;
     cp::OutputType out_type;
     cp::MemAllocation::type mem_allocation;
     cp::NullHandling::type null_handling;
   };
   
   struct ScalarUdfOptions : public UdfOptions {
     std::string func_name;
   };
   
   struct AggregateUdfOptions : public UdfOptions {
     std::string init_func_name;
     std::string map_func_name;
     std::string reduce_func_name;
   };
   
   Status MakeScalarFunction(PyObject* function, const ScalarUdfOptions& options);
   Status MakeAggregateFunction(PyObject* function, const AggregateUdfOptions& options);
   ```


-- 
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-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org