You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 301d3d8
Browse filesBrowse the repository at this point in the historyBrowse files
GH-1063: Add is_update field to ActionCreatePreparedStatementResult (#1064)
## What's Changed
A new field, `optional bool is_update = 4;`, was added to `message
ActionCreatePreparedStatementResult`. When this field is sent by the
server, its value indicates whether the proper network flow to execute
the query that the driver should follow uses
`CommandPreparedStatementQuery` or `CommandPreparedStatementUpdate`.
For outdated servers that don't send the field, the driver maintains its
current behavior of using `CommandPreparedStatementQuery` when the
`dataset_schema` is not empty, thus ensuring the backward compatibility
of the new driver with old servers.
This change was created with AI assistance (Augment Code and Claude
code). All lines were manually reviewed by a human. The output is not
copyrightable subject matter.
- Closes#1063
---------
Co-authored-by: David Li <li.davidm96@gmail.com>
Copy file name to clipboardExpand all lines: flight/flight-sql-jdbc-core/src/main/java/org/apache/arrow/driver/jdbc/ArrowFlightJdbcFlightStreamResultSet.java
Copy file name to clipboardExpand all lines: flight/flight-sql-jdbc-core/src/main/java/org/apache/arrow/driver/jdbc/ArrowFlightJdbcVectorSchemaRootResultSet.java
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -73,7 +73,7 @@ public static ArrowFlightJdbcVectorSchemaRootResultSet fromVectorSchemaRoot(
Copy file name to clipboardExpand all lines: flight/flight-sql-jdbc-core/src/main/java/org/apache/arrow/driver/jdbc/client/ArrowFlightSqlClientHandler.java
+19Lines changed: 19 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -388,6 +388,14 @@ public interface PreparedStatement extends AutoCloseable {
388
388
*/
389
389
SchemagetParameterSchema();
390
390
391
+
/**
392
+
* Gets whether this {@link PreparedStatement} is an update statement.
393
+
*
394
+
* @return {@code true} if this is an update statement, {@code false} if it's a query, or {@code
395
+
* null} if the server did not provide this information.
396
+
*/
397
+
@NullableBooleanisUpdate();
398
+
391
399
voidsetParameters(VectorSchemaRootparameters);
392
400
393
401
@Override
@@ -456,6 +464,12 @@ public long executeUpdate() {
456
464
457
465
@Override
458
466
publicStatementTypegetType() {
467
+
// If the server provided the is_update field, use it to determine the statement type
Copy file name to clipboardExpand all lines: flight/flight-sql-jdbc-core/src/test/java/org/apache/arrow/driver/jdbc/ArrowFlightPreparedStatementTest.java
+48Lines changed: 48 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -98,6 +98,40 @@ public void testSimpleQueryNoParameterBindingWithExecute() throws SQLException {
Copy file name to clipboardExpand all lines: flight/flight-sql-jdbc-core/src/test/java/org/apache/arrow/driver/jdbc/ArrowFlightStatementExecuteTest.java
+66Lines changed: 66 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -62,6 +62,9 @@ public class ArrowFlightStatementExecuteTest {
0 commit comments