Skip to content

Conversation

@lidavidm
Copy link
Member

The Java API lacks a way to bind a stream, due to the general lack of a good interface for a stream in Java. So that isn't supported.

Fixes #3369.

@lidavidm lidavidm marked this pull request as ready for review August 29, 2025 01:17
@github-actions github-actions bot added this to the ADBC Libraries 20 milestone Aug 29, 2025
The Java API lacks a way to bind a stream, due to the general
lack of a good interface for a stream in Java.  So that isn't
supported.

Fixes apache#3369.
public void bind(VectorSchemaRoot root) throws AdbcException {
try (final ArrowArray batch = ArrowArray.allocateNew(allocator);
final ArrowSchema schema = ArrowSchema.allocateNew(allocator)) {
// TODO(lidavidm): we may need a way to separately provide a dictionary provider
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this mean we should error in the dictionary cases?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It will already error since we don't provide a dictionary provider. But the APIs here need to be reconsidered a bit

static native void statementBind(long handle, long values, long schema) throws AdbcException;

// TODO(lidavidm): we need a way to bind an ArrowReader (or some other suitable interface that
// doesn't exist in arrow-java; see the discussion around the Avro reader about how ArrowReader
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we link to the discussion you're referencing here?

@lidavidm lidavidm merged commit 3749731 into apache:main Sep 1, 2025
12 checks passed
@lidavidm lidavidm deleted the gh-3369 branch September 1, 2025 03:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

java/driver/jni: implement binding

2 participants