Scalar functions post-integration changes (1.5)#649
Merged
staticlibs merged 1 commit intoduckdb:v1.5-variegatafrom Apr 12, 2026
Merged
Scalar functions post-integration changes (1.5)#649staticlibs merged 1 commit intoduckdb:v1.5-variegatafrom
staticlibs merged 1 commit intoduckdb:v1.5-variegatafrom
Conversation
This is a backport of the PR duckdb#637 to `v1.5-variegata` stable branch. This is a follow-up to PR duckdb#630. It makes the following changes to newly added Scalar Functions Java API: - moves exception and registered shell classes into the `DuckDBFunction.java` - removes abstract classes for vector reader and writer - removes `DuckDBScalarContext` and `DuckDBScalarRow` in favour of streaming plain indices (as a `LongStream`) from the input data chunk; the row object inteface appeared to have an unintended overhead of creating a Java object for every input row that we would like to avoid. And without it the context abstraction appeared to be unnecessary Null-propagation handling is changed the following way: - null propagation on Java side is enabled only for primitive callbacks (set automatically) and not exposed to the user, null propagation support for object callbacks is removed - null propagation on DuckDB engine side ( `duckdb_scalar_function_set_special_handling` C API call skip) is also enabled automatically only for primitive callbacks, but it is additionally exposed to users as `withNullInNullOut()` builder call (replaces awkwardly named `withSpecialHandling()`); in some cases NULLs still can be passed to callbacks wheh `withNullInNullOut()` is set so callback still must check for nulls Testing: more tests added aroung the null handling
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is a backport of the PR #637 to
v1.5-variegatastable branch.This is a follow-up to PR #630.
It makes the following changes to newly added Scalar Functions Java API:
DuckDBFunction.javaDuckDBScalarContextandDuckDBScalarRowin favour of streaming plain indices (as aLongStream) from the input data chunk; the row object inteface appeared to have an unintended overhead of creating a Java object for every input row that we would like to avoid. And without it the context abstraction appeared to be unnecessaryNull-propagation handling is changed the following way:
duckdb_scalar_function_set_special_handlingC API call skip) is also enabled automatically only for primitive callbacks, but it is additionally exposed to users aswithNullInNullOut()builder call (replaces awkwardly namedwithSpecialHandling()); in some cases NULLs still can be passed to callbacks whehwithNullInNullOut()is set so callback still must check for nullsTesting: more tests added aroung the null handling