xborder commented on code in PR #1090:
URL: https://github.com/apache/arrow-java/pull/1090#discussion_r3147451015


##########
flight/flight-sql-jdbc-core/src/main/java/org/apache/arrow/driver/jdbc/ArrowFlightStatement.java:
##########
@@ -42,20 +49,140 @@ public ArrowFlightConnection getConnection() throws 
SQLException {
     return (ArrowFlightConnection) super.getConnection();
   }
 
+  @Override
+  public ExecuteResult prepareAndExecute(
+      final String query,
+      final long maxRowCount,
+      final int maxRowsInFirstFrame,
+      final PrepareCallback callback)
+      throws SQLException {
+    // Keep Avatica Statement.execute(String) behavior: Avatica calls 
Meta.prepareAndExecute,
+    // which resolves to this statement hook.
+    this.closeStatement();
+
+    return ArrowFlightPreparedStatement.builder(getConnection())
+        .withQuery(query)
+        .withExistingStatement(this)
+        .build()
+        .prepareAndExecute(callback);

Review Comment:
   Good catch. This issue existed before the refactor. I've created an issue 
#1129 to be addressed separately



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to