You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "ennuite (via GitHub)" <gi...@apache.org> on 2026/03/10 16:52:29 UTC
[PR] GH-1063: Add is_update field to ActionCreatePreparedStatementResult [arrow-java]
ennuite opened a new pull request, #1064:
URL: https://github.com/apache/arrow-java/pull/1064
## What's Changed
A new field, `optional bool is_update = 4;`, was added to `message ActionCreatePreparedStatementResult`. When this field is sent by the server, its value indicates whether the proper network flow to execute the query that the driver should follow uses `CommandPreparedStatementQuery` or `CommandPreparedStatementUpdate`.
For outdated servers that don't send the field, the driver maintains its current behavior of using `CommandPreparedStatementQuery` when the `dataset_schema` is not empty, thus ensuring the backward compatibility of the new driver with old servers.
Closes #1063.
--
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: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] GH-1063: Add is_update field to ActionCreatePreparedStatementResult [arrow-java]
Posted by "ennuite (via GitHub)" <gi...@apache.org>.
ennuite commented on PR #1064:
URL: https://github.com/apache/arrow-java/pull/1064#issuecomment-4500393970
@alamb do you feel comfortable/interested in providing a vote in the mailing list thread? If not, is there any other PMC that you think I should contact?
This is the vote:
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: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] GH-1063: Add is_update field to ActionCreatePreparedStatementResult [arrow-java]
Posted by "ennuite (via GitHub)" <gi...@apache.org>.
ennuite commented on PR #1064:
URL: https://github.com/apache/arrow-java/pull/1064#issuecomment-4397529345
@alamb
> It would have to introspect into the SQL string to try
Precisely. I think having the server as the source of truth would be preferable to client-side inspection, hence this proposal.
--
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: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] GH-1063: Add is_update field to ActionCreatePreparedStatementResult [arrow-java]
Posted by "ennuite (via GitHub)" <gi...@apache.org>.
ennuite commented on PR #1064:
URL: https://github.com/apache/arrow-java/pull/1064#issuecomment-4039348111
Sounds good @lidavidm I updated this PR with a server side implementation and tests for Statement.execute() and PreparedStatement.execute()
I will implement an analogous PR in another driver. The only driver in apache/arrow is the ODBC driver but that is still unreleased and Windows only. Is it ok if I do it in the ADBC Python Flight SQL driver, which lives at apache/arrow-adbc? I can then move on to ODBC if the community tells me to go forward with the changes.
I note that these changes, while affecting the protocol, are mostly about drivers, so arrow-adbc makes more sense to me.
--
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: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] GH-1063: Add is_update field to ActionCreatePreparedStatementResult [arrow-java]
Posted by "alamb (via GitHub)" <gi...@apache.org>.
alamb commented on PR #1064:
URL: https://github.com/apache/arrow-java/pull/1064#issuecomment-4320092408
It seems reasonable to me but I don't fully understand the need -- if an application sends an UPDATE it will know i would think (as it would have to send a different schema with the DoPut).
--
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: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] GH-1063: Add is_update field to ActionCreatePreparedStatementResult [arrow-java]
Posted by "ennuite (via GitHub)" <gi...@apache.org>.
ennuite commented on PR #1064:
URL: https://github.com/apache/arrow-java/pull/1064#issuecomment-4033185190
@lidavidm this PR currently contains a client implementation of the changes proposed in https://lists.apache.org/thread/88msflnwkkw8t81czs2ndqhkn1fb1pxd
I can expand it with a server side implementation or we can use already use this as a starting point for the discussion, let me know what you think.
--
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: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] GH-1063: Add is_update field to ActionCreatePreparedStatementResult [arrow-java]
Posted by "lidavidm (via GitHub)" <gi...@apache.org>.
lidavidm commented on code in PR #1064:
URL: https://github.com/apache/arrow-java/pull/1064#discussion_r3377865726
##########
flight/flight-sql-jdbc-core/src/main/java/org/apache/arrow/driver/jdbc/client/ArrowFlightSqlClientHandler.java:
##########
@@ -388,6 +388,14 @@ public interface PreparedStatement extends AutoCloseable {
*/
Schema getParameterSchema();
+ /**
+ * Gets whether this {@link PreparedStatement} is an update statement.
+ *
+ * @return {@code true} if this is an update statement, {@code false} if it's a query, or {@code
+ * null} if the server did not provide this information.
+ */
+ Boolean isUpdate();
Review Comment:
```suggestion
@Nullable Boolean isUpdate();
```
##########
flight/flight-sql-jdbc-core/src/test/java/org/apache/arrow/driver/jdbc/utils/MockFlightSqlProducer.java:
##########
Review Comment:
Why do we need the V2? Maybe we can have an overload that takes `@Nullable Boolean` or something to put in the isUpdateMap?
--
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: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] GH-1063: Add is_update field to ActionCreatePreparedStatementResult [arrow-java]
Posted by "lidavidm (via GitHub)" <gi...@apache.org>.
lidavidm commented on PR #1064:
URL: https://github.com/apache/arrow-java/pull/1064#issuecomment-4105428485
The community meeting is unfortunately extremely late at night for me.
I am basically encouraging looking at https://github.com/apache/arrow/issues/41840
In particular whether a dedicated RPC for this purpose can be declared, instead of overloading more Flight RPC methods
--
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: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] GH-1063: Add is_update field to ActionCreatePreparedStatementResult [arrow-java]
Posted by "alamb (via GitHub)" <gi...@apache.org>.
alamb commented on PR #1064:
URL: https://github.com/apache/arrow-java/pull/1064#issuecomment-4389452988
> The problem is that the application has no way of knowing that this RPC call is the correct one to use.
I was thinking that the application would know what SQL it sent (and thus a a DDL or DML) and therefore it *would* know what to do (
However, I think I see your point if the "application" is the JDBC driver itself. It would have to introspect into the SQL string to try and guess what type of statement was being sent if the code calling into the driver didn't use a specific API
--
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: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] GH-1063: Add is_update field to ActionCreatePreparedStatementResult [arrow-java]
Posted by "ennuite (via GitHub)" <gi...@apache.org>.
ennuite commented on PR #1064:
URL: https://github.com/apache/arrow-java/pull/1064#issuecomment-4061823509
Yeah, I talked with the rest of the guys at the last meeting. I will implement the same change in ADBC Python Flight SQL, I'll try to get to it this week. Then I'll send the spec change PR in apache/arrow, the PRs in Go and Python and this one to the mailing list for a vote.
--
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: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] GH-1063: Add is_update field to ActionCreatePreparedStatementResult [arrow-java]
Posted by "lidavidm (via GitHub)" <gi...@apache.org>.
lidavidm commented on PR #1064:
URL: https://github.com/apache/arrow-java/pull/1064#issuecomment-4035393769
Ah you did link this already; thanks. In that case I think we just need to demonstrate the server side, etc.
--
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: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] GH-1063: Add is_update field to ActionCreatePreparedStatementResult [arrow-java]
Posted by "lidavidm (via GitHub)" <gi...@apache.org>.
lidavidm commented on PR #1064:
URL: https://github.com/apache/arrow-java/pull/1064#issuecomment-4035360967
That said we can use this for discussion, if you want to link it from the mailing list thread.
--
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: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] GH-1063: Add is_update field to ActionCreatePreparedStatementResult [arrow-java]
Posted by "lidavidm (via GitHub)" <gi...@apache.org>.
lidavidm commented on PR #1064:
URL: https://github.com/apache/arrow-java/pull/1064#issuecomment-4294255907
@jarohen does this seem reasonable from an XTDB perspective?
Ditto @alamb w.r.t InfluxDB
--
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: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] GH-1063: Add is_update field to ActionCreatePreparedStatementResult [arrow-java]
Posted by "lidavidm (via GitHub)" <gi...@apache.org>.
lidavidm commented on PR #1064:
URL: https://github.com/apache/arrow-java/pull/1064#issuecomment-4062295045
What happened to the idea of revising the Execute methods to allow returning either data/row count instead of having to separate the two?
--
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: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] GH-1063: Add is_update field to ActionCreatePreparedStatementResult [arrow-java]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #1064:
URL: https://github.com/apache/arrow-java/pull/1064#issuecomment-4032955845
<!-- label_helper_comment -->
Thank you for opening a pull request!
Please label the PR with one or more of:
- bug-fix
- chore
- dependencies
- documentation
- enhancement
Also, add the 'breaking-change' label if appropriate.
See [CONTRIBUTING.md](https://github.com/apache/arrow-java/blob/main/CONTRIBUTING.md) for details.
--
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: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] GH-1063: Add is_update field to ActionCreatePreparedStatementResult [arrow-java]
Posted by "ennuite (via GitHub)" <gi...@apache.org>.
ennuite commented on PR #1064:
URL: https://github.com/apache/arrow-java/pull/1064#issuecomment-4105098717
@lidavidm I still think that's a good idea, we talked about it during the last community meeting. I'm going to propose this fix first as it is low-hanging fruit, and we should continue to discuss that way in the mailing list.
Can you expand in the mailing list on what exactly are you proposing? Do you want to use [DoExchange](https://arrow.apache.org/docs/format/Flight.html#exchanging-data)? A new RPC?
If you find it easier and you have the availability, show up in the next community meeting and we can discuss. I've been looking into how we could do this with DoExchange and have some ideas.
--
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: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] GH-1063: Add is_update field to ActionCreatePreparedStatementResult [arrow-java]
Posted by "alamb (via GitHub)" <gi...@apache.org>.
alamb commented on PR #1064:
URL: https://github.com/apache/arrow-java/pull/1064#issuecomment-4320094239
Basically my questioni is "when would an actual application not know which command to send"?
--
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: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] GH-1063: Add is_update field to ActionCreatePreparedStatementResult [arrow-java]
Posted by "lidavidm (via GitHub)" <gi...@apache.org>.
lidavidm commented on PR #1064:
URL: https://github.com/apache/arrow-java/pull/1064#issuecomment-4035358682
This should be done on apache/arrow, not apache/arrow-java, which only has a copy of the spec
We will need a client and server implementation, preferably in at least two languages
--
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: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] GH-1063: Add is_update field to ActionCreatePreparedStatementResult [arrow-java]
Posted by "lidavidm (via GitHub)" <gi...@apache.org>.
lidavidm commented on PR #1064:
URL: https://github.com/apache/arrow-java/pull/1064#issuecomment-4042955158
I assume you can and would need to make changes to arrow-go, arrow-cpp, etc? We can start there.
--
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: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] GH-1063: Add is_update field to ActionCreatePreparedStatementResult [arrow-java]
Posted by "ennuite (via GitHub)" <gi...@apache.org>.
ennuite commented on PR #1064:
URL: https://github.com/apache/arrow-java/pull/1064#issuecomment-4107337477
Ok @lidavidm, thanks for the pointer to that issue. I will look into it once I finish the PRs for this change, and then I'll send an email with my findings.
--
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: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] GH-1063: Add is_update field to ActionCreatePreparedStatementResult [arrow-java]
Posted by "ennuite (via GitHub)" <gi...@apache.org>.
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: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org