You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "lidavidm (via GitHub)" <gi...@apache.org> on 2025/08/29 00:43:25 UTC

[PR] feat(java/driver/jni): implement parameter binding [arrow-adbc]

lidavidm opened a new pull request, #3370:
URL: https://github.com/apache/arrow-adbc/pull/3370

   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.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat(java/driver/jni): implement parameter binding [arrow-adbc]

Posted by "lidavidm (via GitHub)" <gi...@apache.org>.
lidavidm commented on code in PR #3370:
URL: https://github.com/apache/arrow-adbc/pull/3370#discussion_r2312827418


##########
java/driver/jni/src/main/java/org/apache/arrow/adbc/driver/jni/JniStatement.java:
##########
@@ -40,6 +44,18 @@ public void setSqlQuery(String query) throws AdbcException {
     JniLoader.INSTANCE.statementSetSqlQuery(handle, query);
   }
 
+  @Override
+  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

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



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat(java/driver/jni): implement parameter binding [arrow-adbc]

Posted by "lidavidm (via GitHub)" <gi...@apache.org>.
lidavidm merged PR #3370:
URL: https://github.com/apache/arrow-adbc/pull/3370


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat(java/driver/jni): implement parameter binding [arrow-adbc]

Posted by "zeroshade (via GitHub)" <gi...@apache.org>.
zeroshade commented on code in PR #3370:
URL: https://github.com/apache/arrow-adbc/pull/3370#discussion_r2310362107


##########
java/driver/jni/src/main/java/org/apache/arrow/adbc/driver/jni/JniStatement.java:
##########
@@ -40,6 +44,18 @@ public void setSqlQuery(String query) throws AdbcException {
     JniLoader.INSTANCE.statementSetSqlQuery(handle, query);
   }
 
+  @Override
+  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

Review Comment:
   Does this mean we should error in the dictionary cases?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat(java/driver/jni): implement parameter binding [arrow-adbc]

Posted by "zeroshade (via GitHub)" <gi...@apache.org>.
zeroshade commented on code in PR #3370:
URL: https://github.com/apache/arrow-adbc/pull/3370#discussion_r2310363900


##########
java/driver/jni/src/main/java/org/apache/arrow/adbc/driver/jni/impl/NativeAdbc.java:
##########
@@ -37,4 +37,12 @@ static native NativeDatabaseHandle openDatabase(int version, String[] parameters
   static native NativeQueryResult statementExecuteQuery(long handle) throws AdbcException;
 
   static native void statementSetSqlQuery(long handle, String query) throws AdbcException;
+
+  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

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



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org