GH-51114: [FlightSQL][C++] Expose is_update field of PreparedStatement - #51133
ShivanshhhG wants to merge 6 commits into
Conversation
|
|
|
|
|
Thanks @lidavidm! Updated the PR title and description. Also added support to populate |
|
|
|
|
There was a problem hiding this comment.
I will do a deeper review tomorrow as I'm still familiarizing myself with the C++ codebase.
However, I don't see the same semantics as other PRs here. We need more than is_update being true/false, we need a presence check to know if the field was ever sent. This is important for backward compatibility (I assume most servers will not send this field).
The updates done to the tests also seem to not leave any test that doesn't set the field. IMO this is the most important test (again for backward compatibility).
@SHIVANSH-ux-ys I would like to preserve the true/false/unset semantics if possible.
|
Thanks for the cc @lidavidm |
|
Thanks for the feedback @ennuite! Updated |
ennuite
left a comment
There was a problem hiding this comment.
Thanks for the changes @SHIVANSH-ux-ys, it's looking better!
A few things that still weren't addressed from my initial review:
- There is no test that covers the case where the server doesn't set the new field. As I mentioned, this is the most critical test for backwards compatibility, as most servers won't implement the protocol change once it is released.
- On the server side, the current implementation always sets the flag. I'm not sure that this is the intended behavior: given that the field is optional, servers should be allowed to not set it.
…atement Signed-off-by: SHIVANSH-ux-ys <singaser78@gmail.com>
326db49 to
8f4de17
Compare
|
Thanks for the thorough review @ennuite! Addressed both items from your review:
Ready for re-review! |
ennuite
left a comment
There was a problem hiding this comment.
@SHIVANSH-ux-ys the commit you made does not contain the changes you said it had.
…sult::is_update optional and add unit test for unset case Signed-off-by: SHIVANSH-ux-ys <singaser78@gmail.com>
|
Apologies @ennuite! The local commit with |
ennuite
left a comment
There was a problem hiding this comment.
Hi @SHIVANSH-ux-ys
The direction taken with the implementation LGTM, but the test has serious problems. It doesn't even seem to compile.
I strongly encourage you to take a look at
https://arrow.apache.org/docs/developers/overview.html#ai-generated-code and ensure that you are following the guidelines if you are using AI for contributing.
Given that this is your first PR in the Arrow community, I understand this might be a lot to take in.
Can you describe in your own words what we are trying to accomplish with these tests, and how they fit in with the protocol change? Were you able to take a look at the Arrow-Go PR before starting your own?
…ult unset test compilation Signed-off-by: SHIVANSH-ux-ys <singaser78@gmail.com>
|
Hi @ennuite! Thanks for the feedback and guidance! To answer your questions directly:
Appreciate your guidance on my first C++ Flight SQL contribution! Ready for re-review whenever convenient. |
|
@ShivanshhhG Can you engage with me? I am ok with you using AI but your responses don't indicate to me that you are reading what I am writing or what you are posting. I want to help, but I need to make sure you are learning. |
|
hey, really sorry about that! i've been using AI to help me navigate the C++ codebase since it's my first time contributing here, but i realize i should have engaged more directly with your review instead of just pasting bot responses. to be totally honest, i'm still wrapping my head around the i'll stop relying on the AI to write my replies. is there anything specific in |
|
@ShivanshhhG perfect! It's normal for things to take time to wrap our head around (I've never done much C++ work before, in this or another codebase, so I'm learning as I go myself). I'm very happy you came around, it shows great character to do so. The optional semantics seem fine to me. The current test already compiles, but when I run it, it crashes with a segfault. Can you try to run it and tell me if you also hit the segfault? Do you understand why it segfaults? Hint: look at your nullptr use. Apart from the actual code correctness, the new test is not testing what we want. We want end to end tests in that file. It will help if you take a look at https://arrow.apache.org/docs/format/FlightSql.html#id3 focusing on the interaction in point 1. The idea is that the client sends the query in For end to end tests, we want to test all 3 scenarios. Your test for Compare it with In the client sends a To do this, you will need a server that does not set the field. Note that your change in Let me know if this helps and if you have further questions! I'll be AFK the next week, and I'll answer when I come back. |
Fixes #51114.
Exposes the
is_updateboolean field in the C++ Flight SQL layer:is_updatefield toActionCreatePreparedStatementResultinserver.hand updatedPackActionResultinserver.cc.bool is_update = falseparameter andis_update() constaccessor toPreparedStatementinclient.h/client.cc.PreparedStatement::ParseResponseto extractis_update.sqlite_server.cc) to populateis_updateviasqlite3_stmt_readonly.server_test.ccfor both query (ASSERT_FALSE) and update (ASSERT_TRUE) prepared statements.