Skip to content

Build list literals from primitive and string arrays in one JNI call - #11491

Merged
robert3005 merged 1 commit into
developfrom
rk/jni-list-literals
Nov 16, 2026
Merged

robert3005 merged 1 commit into
developfrom
rk/jni-list-literals

Conversation

@robert3005

@robert3005 robert3005 commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Expression.literalList takes one Java Expression for each element, and each element is a native literal of its own. A set of thousands of values, such as the keys of a runtime join filter, pays that cost in every task that converts the filter.

Changes

New methods on Expression build the whole list literal from one Java array in one native call:

Method Java array
literalBooleanList boolean[]
literalByteList byte[]
literalShortList short[]
literalIntList int[]
literalLongList long[]
literalFloatList float[]
literalDoubleList double[]
literalStringList String[]
  • Each takes (elementType, withNull, values). As in literalList, each value is cast to the dtype of elementType, so a long[] can build an i32 set. A value that does not fit the element dtype fails.
  • withNull adds one null element. The elements are nullable only when it is set.
  • On the native side, one macro defines the method for each primitive array type, and all of them share bulk_list_literal.

Expression.literalList takes one Java expression per element, and each
element is a native literal of its own. A set of thousands of values,
such as the keys of a runtime join filter, pays that cost for each task.

Expression.literalBooleanList, literalByteList, literalShortList,
literalIntList, literalLongList, literalFloatList, literalDoubleList and
literalStringList build the whole list from one Java array in one native
call. Each value is cast to the element dtype.

Signed-off-by: Robert Kruszewski <github@robertk.io>
@robert3005 robert3005 added the changelog/feature A new feature label Nov 16, 2026
@robert3005
robert3005 marked this pull request as ready for review November 16, 2026 11:37
@robert3005
robert3005 merged commit 61dacd7 into develop Nov 16, 2026
158 checks passed
@robert3005
robert3005 deleted the rk/jni-list-literals branch November 16, 2026 12:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog/feature A new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants