niyue opened a new issue, #38589:
URL: https://github.com/apache/arrow/issues/38589

   ### Describe the enhancement requested
   
   **Describe the enhancement requested**
   
   # Description
   In issue https://github.com/apache/arrow/issues/37753, Gandiva provides the 
support to register external functions so that developers can register third 
party functions to use in Gandiva expressions. However, the supported external 
functions need to be compiled to LLVM IR so that they can be registered and 
used. This limitation causes troubles sometimes, in particular when the third 
party function has some non trivial dependency such as an HTTP library, because 
it requires compiling all dependent libraries into LLVM IR and compile all the 
IRs during runtime, which is slow.
   
   # Proposal
   To address this limitation, I propose to allow registering external C 
interface functions to Gandiva, so that Gandiva expression can use these 
functions without relying on compiling third party functions into LLVM IR. 
Within Gandiva project, there are already such functions, and they are called 
`stub function` internally, but this capability is not exposed to external 
functions yet.
   
   The following APIs are proposed to be added to the `FunctionRegistry` API 
for this purpose:
   *  `arrow::Status Register(NativeFunction func, void* stub_function_ptr)`
     *  register a stub function into the function registry
   * `const std::vector<std::pair<NativeFunction, void*>>& GetStubFunctions() 
const`
     *  get a list of stub functions saved in the registry
   
   # Notes
   * Gandiva internally calls this capability `stub function`, but I am not 
sure if this a proper name externally, and I call it "C interface function" 
currently, please let me know if there is a better name
     
   
   
   ### Component(s)
   
   C++ - Gandiva


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