apache / arrow

Apache Arrow is a multi-language toolbox for accelerated data interchange and in-memory processing
https://arrow.apache.org/
Apache License 2.0
14.22k stars 3.47k forks source link

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

Open rcprcp opened 3 months ago

rcprcp commented 3 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 3 months ago

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

scottkwalker commented 3 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 3 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 1 week 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 1 week ago

There's no formal team maintaining the JDBC driver.

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