raulcd commented on PR #46261:
URL: https://github.com/apache/arrow/pull/46261#issuecomment-2875391493

   > I wonder if this initiative enables free integration of third-party 
compute functions/kernels? That is, users are able to register there own 
compute functions/kernels from the application, without having to put them into 
arrow-compute codebase (and recompiling)
   
   This is something that can be done today just by leveraging the 
`FunctionRegistry->AddFunction` functionality from an external codebase by 
using the existing APIs:
   
   ```c++
               // Define and register custom compute functions
               auto func = std::make_shared<ScalarFunction>("custom_add", 
Arity::Binary(),
                                                    
/*doc=*/FunctionDoc::Empty());
               // Add Int64 kernel
               ScalarKernel kernel64;
               // ExecAddInt64 function not shown for simplicity
               kernel64.exec = ExecAddInt64;
               kernel64.signature = KernelSignature::Make({int64(), int64()}, 
int64());
               ARROW_RETURN_NOT_OK(func->AddKernel(kernel64));
   
               // Add kernel implementation
               ARROW_RETURN_NOT_OK(registry->AddFunction(std::move(func)));
   ```
   The current PR won't change that behavior.
   


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

Reply via email to