apache / arrow-java

Official Java implementation of Apache Arrow
https://arrow.apache.org/
Apache License 2.0
4 stars 4 forks source link

[Java][FlightSQL] Arrow Flight SQL JDBC Driver returns -1 for getUpdateCount() #83

Open rcprcp opened 6 months ago

rcprcp commented 6 months ago

Describe the bug, including details regarding any error messages, version, and platform.

Tested on Arrow Flight JDBC 15, 15.02 and with a locally-built Arrow Flight SQL JDBC Driver 17.0.0-SNAPSHOT.

When using a JDBC statement to execute an UPDATE, the getUpdateCount() method seems to always return -1. This seems to be incorrect. The getUpdateCount() should return the number of rows UPDATEd.

For a data source, we're using the Voltron docker container

In this debugger image, you can see the return counts from the getUpdateCount() and from the actual result set (the update returns one row, with one column, that indicates the number of UPDATEd rows.

Screenshot 2024-05-20 at 14 10 23

Here is a screen grab of the output data:

Screenshot 2024-05-20 at 14 11 39

And, in this screengrab, I used the Postgres driver to update a table in postgres:latest Docker image:

Screenshot 2024-05-07 at 17 30 55

The data in the Postgres table is different, but the getUpdateCount() method returned 1 which is correct for that data. The test program I used is checked into this Github repo: ZD128958

Thank you!

Component(s)

Java

rcprcp commented 6 months ago

Hi Team, any thoughts on this ticket? Thank you!

scottkwalker commented 6 months ago

+1 My team has also seen this issue in the Arrow Flight SQL JDBC Driver. We see the same negative result with the older version 10.0.0 and the newer version 16.0.0. It would be great if someone can look at this issue for an upcoming release.

lidavidm commented 6 months ago

It appears it's just not implemented. PRs would be welcome, I believe the Java maintainers (myself included) are mostly busy these days.

rcprcp commented 3 months ago

Hi Team,

Have there been any discussions about this request, and whether anyone might have a pointer on where to start to implement this feature? Thanks

lidavidm commented 3 months ago

There's no formal team maintaining the JDBC driver.

You might be able to trace through what's going on with a debugger.