ennuite commented on PR #1064:
URL: https://github.com/apache/arrow-java/pull/1064#issuecomment-4384675046

   Hi @alamb, sorry, I missed your reply until today.
   
   > when would an actual application not know which command to send
   
   The situation arises in API calls that allow executing both DML/DDL and 
SELECT. There is an extended list in the mailing list, but for PEP-249 drivers 
it's `cursor.execute()` and for JDBC it's `Statement.execute()` and 
`PreparedStatement.execute()`. At the driver API level it's not known which 
kind of query it is.
   
   > if an application sends an UPDATE it will know i would think (as it would 
have to send a different schema with the DoPut).
   
   To be clear, which `DoPut` are you referring to here? Binding parameters or 
the one to execute DML/DDL? I believe you're referring to the one to execute 
DML/DDL (with `CommandPreparedStatementUpdate`). 
   
   The problem is that the application has no way of knowing that this RPC call 
is the correct one to use. 
   
   After the creation of the prepared statement, the application needs to 
choose between `DoPut` or `GetFlightInfo`+`DoGet` for query execution. How the 
application makes this decision is undetermined in Flight SQL, with conflicting 
implementations across drivers. 
   
   Links to the mailing list:
   0- https://lists.apache.org/thread/88msflnwkkw8t81czs2ndqhkn1fb1pxd original 
discussion thread
   1- https://lists.apache.org/thread/53dtvjs1xcg4wgxg938lvqffnj7djss4 spinoff 
thread of the first one, where @prmoore77 reports that Gizmo users faced this 
issue and they resorted to having a wrapper on top of the ADBC driver. For 
JDBC, they have their own fork with extra code to handle the same problem: 
https://github.com/gizmodata/gizmosql-jdbc-driver/commit/90e9bef6e0a4694155e3d6601a0d08fbecbb66b2#diff-af1bbfdaf2e920478a0225424da0c9115a5a03656c8fa7c525f0fdbe8800ed2eR214
   2- https://lists.apache.org/thread/x2l10lsprc2fpzj08zd0vggqvop1zl4z


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