sankalpsthakur opened a new pull request, #1383:
URL: https://github.com/apache/arrow-go/pull/1383

   ### Rationale for this change
   
   #732 added server-side coverage for `CreatePreparedSubstraitPlan`, but the 
review on that PR noted that the client path (`Client.PrepareSubstrait` and 
`Txn.PrepareSubstrait`) had no dedicated tests. `FlightSqlClientSuite` only 
exercised SQL prepared statements, so a regression in how the Substrait action 
is built or how its result is parsed would go unnoticed.
   
   ### What changes are included in this PR?
   
   Four new cases in `FlightSqlClientSuite` in 
`arrow/flight/flightsql/client_test.go`, using the same mocked `DoAction` 
stream pattern as the existing `TestPreparedStatement*` tests:
   
   - `TestPrepareSubstrait`: the `CreatePreparedSubstraitPlan` action carries 
the plan bytes and Substrait version; the returned handle, dataset schema and 
parameter schema are parsed; `IsUpdate` reports no hint when `is_update` is 
absent; the statement executes through the shared 
`CommandPreparedStatementQuery` path and closes cleanly.
   - `TestPrepareSubstraitWithIsUpdateFalse` and 
`TestPrepareSubstraitWithIsUpdateTrue`: the `is_update` hint survives the round 
trip for both values, mirroring the server-side `TestExecutePreparedSubstrait*` 
cases.
   - `TestTxnPrepareSubstrait`: `Txn.PrepareSubstrait` sends the transaction ID 
from `BeginTransaction` together with the plan.
   
   A small helper, `mockCreatePreparedSubstraitPlan`, registers the create and 
close expectations so the four cases stay short. Query and update execution are 
not duplicated here, as noted in the issue, since Substrait and SQL prepared 
statements share the same execution paths after creation.
   
   ### Are these changes tested?
   
   Yes, this PR only adds tests.
   
   - `go test ./arrow/flight/flightsql/... -run TestFlightSqlClient`: ok (29 
subtests, 4 new)
   - `go vet ./arrow/flight/flightsql/` and `gofmt -l arrow/flight/flightsql`: 
clean
   
   ### Are there any user-facing changes?
   
   No.
   
   Closes #1267
   
   ### AI/LLM disclosure
   
   - AI coding tools (Claude Code) were used to write these tests and this 
description.
   - The tests were reviewed and the commands above were run locally before 
submitting.
   


-- 
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]

Reply via email to