zeroshade commented on issue #37633:
URL: https://github.com/apache/arrow/issues/37633#issuecomment-1718215656

   So I was able to replicate the error you were getting and with some 
debugging it looks like the JDBC driver is definitely sending 
`CommandPreparedStatementUpdate` when it *should* be sending 
`CommandPreparedStatementQuery`. 
   
   After a bit of digging, I found 
https://github.com/apache/arrow/blob/main/java/flight/flight-sql-jdbc-core/src/main/java/org/apache/arrow/driver/jdbc/client/ArrowFlightSqlClientHandler.java#L185.
 So the reason why it's sending a `CommandPreparedStatementUpdate` is because 
the current version of the Go FlightSQL Sqlite server doesn't return a schema 
with the `GetFlightInfoStatement` call, and the JDBC driver assumes that if 
there are no fields in the returned schema, it must be an Update query, not a 
SELECT query.
   
   @lidavidm Would that be considered a bug/issue with the JDBC driver to make 
that assumption? On the Go SQLite example the reason why it doesn't return a 
schema is because there isn't a way to retrieve the schema for a prepared 
statement with the current SQLite impl I'm using, so I can't know the schema 
until after it is executed.


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