feat: add Java scalar and table UDF runtime APIs#598
feat: add Java scalar and table UDF runtime APIs#598lfkpoa wants to merge 1 commit intoduckdb:mainfrom
Conversation
|
Hi, thanks for the PR! This is a highly requested feature. I will need a few days to do a full review, just a quick question so far: is a there a fundamental reason to have functions like |
|
Hi! Thank you for the feedback. I really want this feature, that's why I tried to build it.
But if you rather have them in DuckBindings *.cpp files, I can try to refactor it, but I think it has to stay at C side. |
|
Thanks for the details!
No, under
The ideal direction will be to do everything (or almost everything) on Java side calling C API methods from
I would think we can just attach DuckDB native threads to JVM? I mean when calling
On error translation - I would think that may be enough to catch exceptions in a Java wrapper and call
The problem here is that we want to get rid of native calls in Again, it is possible that I don't understand properly all the involved complexity of the required translation, as the above is written from the general desired approach about JDBC. So if you can immediately see the blockers with this approach - lets look into the details of these blockers. |
|
Thanks a lot for the detailed feedback — this is very helpful. I understand your point now: the goal is to keep DuckDBBindings.java as the main Java-side surface for C API usage, with minimal JNI-specific additions, and avoid adding new DuckDBNative calls unless absolutely necessary. That direction makes sense to me. I’ll do a deeper pass on the current UDF registration path and evaluate how much of the orchestration can be moved/refactored toward the DuckDBBindings approach you described, while keeping only the unavoidable native callback plumbing. |
Summary
UDF.MDandREADME.md.TestBindingsandTestDuckDBJDBC, and include runtime fixes required for Variant and appender/thread-safety integration.