feat(java/driver/jni): implement binding of streams#4359
Open
lidavidm wants to merge 2 commits into
Open
Conversation
There was a problem hiding this comment.
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 forbind(VectorSchemaRoot)vsbind(ArrowReader). - Implement stream binding in
JniStatementviaData.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.
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.
Depends on #4357.
Closes #4358.