xinyiZzz opened a new issue, #38785:
URL: https://github.com/apache/arrow/issues/38785
### Describe the bug, including details regarding any error messages,
version, and platform.
I use the following code to connect to flight sql server to execute query,
two unexpected behaviors occur:
1. `acceptPutPreparedStatementUpdate` of the flight server is called, and
`flightStream.getRoot().getRowCount() == 0` is true. but query is not an Update
statement.
- Shouldn't `acceptPutPreparedStatementUpdate` be called?
I'm using Python DB-API 2.0 `cursor.execute(sql)` and
`cursor.fetchallarrow()` which does not call `acceptPutPreparedStatementUpdate`
after calling `createPreparedStatement`.
2. The FlightEndpoint returned by `getFlightInfoPreparedStatement` is
another flight server, but not fetch result from other flight server. Instead,
`getStreamStatement` of the current flight server is called.
- Why is there no fetch result from another flight server?
- Why is `getStreamStatement` called instead of `getStreamPreparedStatement`?
Actual calling sequence:
1. `createPreparedStatement`
2. `acceptPutPreparedStatementUpdate`
4. `getFlightInfoPreparedStatement`
5. `getStreamStatement`
6. `closePreparedStatement`
I'm looking for help, thanks!
```
Connection conn = null;
Statement stmt = null;
Class.forName("org.apache.arrow.driver.jdbc.ArrowFlightJdbcDriver");
try {
conn =
DriverManager.getConnection("jdbc:arrow-flight-sql://xx:xx?useServerPrepStmts=false&cachePrepStmts=true&useSSL=false&useEncryption=false",
"root", "");
String sql = "select * from clickbench.hits limit 50";
stmt = conn.createStatement();
ResultSet rs = stmt.executeQuery(sql);
int rowNum = rs.getRow();
System.out.println(rowNum);
rs.close();
stmt.close();
conn.close();
} catch (SQLException e) {
throw new RuntimeException(e);
}
```
### Component(s)
FlightRPC
--
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]