aiguofer commented on code in PR #38404:
URL: https://github.com/apache/arrow/pull/38404#discussion_r1372116329


##########
java/flight/flight-sql/src/main/java/org/apache/arrow/flight/sql/FlightSqlClient.java:
##########
@@ -951,12 +951,11 @@ public static class PreparedStatement implements 
AutoCloseable {
      *                             {@code PreparedStatement} setters.
      */
     public void setParameters(final VectorSchemaRoot parameterBindingRoot) {
-      if (this.parameterBindingRoot != null) {
-        if (this.parameterBindingRoot.equals(parameterBindingRoot)) {
-          return;
-        }
-        this.parameterBindingRoot.close();
+      if (parameterBindingRoot.equals(this.parameterBindingRoot)) {

Review Comment:
   I was just reorganizing this logic a bit but used the same comparison that 
was there. It does look like a VSR `equals` method does a deep comparison, and 
from my understanding of the purpose of this method what we want is a reference 
check. Happy to make the change!



-- 
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