extension-template icon indicating copy to clipboard operation
extension-template copied to clipboard

Support for multiple languages

Open buremba opened this issue 2 years ago • 3 comments

This is a great start, I admire what you folks are doing! I wonder if there is any plan to provide an API to register Python functions as UDF or UDTFs that we can call from SQL. The Python binding has a map that lets us process the data in Python but the SQL interface doesn't support registering Python support yet AFAIK and the only way to support UDF & UDTF's seems to be native duckdb-extensions if I'm not mistaken.

buremba avatar Feb 12 '23 17:02 buremba

I wonder if it would be possible to use Webassembly to support multiple languages. SingleStore (1) has something similar, and given that Duckdb already has a wasm adapter for running it in the browser, it might be an easier path.

1: https://docs.singlestore.com/managed-service/en/reference/code-engine---powered-by-wasm.html

buremba avatar Feb 15 '23 19:02 buremba

The DuckDB python bindings now have support for UDF's - does this fulfil your requirements?

Mause avatar May 15 '23 02:05 Mause

That's great! I have been testing the scalar UDFs and they're pretty neat. However; we don't support the table & aggregate functions, right? Do you think that we should use Arrow for UDAF and UDTF? If yes, I believe it fulfills my requirement.

If the scalar UDFs are stop-gap before having more efficient solution, let's keep the issue open maybe? WDYT @Mause ?

buremba avatar May 18 '23 17:05 buremba