Skip to content

feat(java/driver/jni): implement binding of streams - #4359

Merged
lidavidm merged 2 commits into
apache:mainfrom
lidavidm:jni-bind
Jun 7, 2026
Merged

lidavidm merged 2 commits into
apache:mainfrom
lidavidm:jni-bind

Conversation

@lidavidm

@lidavidm lidavidm commented Jun 4, 2026

Copy link
Copy Markdown
Member

Depends on #4357.
Closes #4358.

@lidavidm
lidavidm marked this pull request as ready for review June 4, 2026 01:43
@lidavidm
lidavidm requested review from amoeba, Copilot and zeroshade June 4, 2026 01:43

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR adds support in the Java JNI driver for binding parameter/ingest data from an ArrowReader (i.e., a stream of record batches) by exporting it as a C Data ArrowArrayStream and calling the corresponding ADBC C API binding entrypoint.

Changes:

  • Add AdbcStatement#bind(ArrowReader) API (default method) with clarified ownership semantics for bind(VectorSchemaRoot) vs bind(ArrowReader).
  • Implement stream binding in JniStatement via Data.exportArrayStream(...)/AdbcStatementBindStream.
  • Add new integration tests for Postgres and SQL Server intended to cover stream binding.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
java/driver/jni/src/main/java/org/apache/arrow/adbc/driver/jni/JniStatement.java Implements bind(ArrowReader) and exports/binds an ArrowArrayStream before execution.
java/driver/jni/src/main/java/org/apache/arrow/adbc/driver/jni/impl/NativeAdbc.java Exposes the JNI native statementBindStream entrypoint (now referenced).
java/driver/jni/src/main/java/org/apache/arrow/adbc/driver/jni/impl/JniLoader.java Adds a typed wrapper method for statementBindStream.
java/driver/jni-validation/src/test/java/org/apache/arrow/adbc/driver/jni/SqlServerIntegrationTest.java Adds a new bindStream() test for SQL Server (currently needs to execute/assert).
java/driver/jni-validation/src/test/java/org/apache/arrow/adbc/driver/jni/PostgresIntegrationTest.java Adds a new bindStream() test for Postgres (currently needs to execute/assert).
java/core/src/main/java/org/apache/arrow/adbc/core/AdbcStatement.java Adds bind(ArrowReader) and documents ownership semantics.
java/core/src/main/java/org/apache/arrow/adbc/core/AdbcException.java Adds AdbcException.internal(...) constructor used by JNI statement cleanup paths.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@lidavidm
lidavidm merged commit 4c58128 into apache:main Jun 7, 2026
14 checks passed
@lidavidm lidavidm added this to the ADBC Libraries 24 milestone Jul 22, 2026
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: enable binding of streams

3 participants