VanshajPoonia opened a new pull request, #1686: URL: https://github.com/apache/arrow-go/pull/1686
### Rationale for this change There is no example of `DoPut` in `arrow/flight`. `ExampleRegisterFlightServiceServer` only says in a comment to override methods "like DoGet, DoPut, etc." The issue mentioned is asking for this. Closes #143. ### What changes are included in this PR? A new `Example_doPut` in `arrow/flight/example_doput_test.go`. The server embeds `BaseFlightServer` and overrides `DoPut`. It reads the stream with `flight.NewRecordReader` then counts the rows and answers with a `PutResult`. The flow is that the client opens `DoPut`, sets a path descriptor on a `flight.NewRecordWriter` then writes three record batches, closes the writer and the send side, then reads the result. ### Are these changes tested? The example has an `// Output:` block, so `go test` checks it. It passes with `go test ./arrow/flight/ -run Example -race -count=1` (3 runs) and with `-tags assert,test`. `go vet` and `gofmt` are clean. Like every test in this package it is skipped under `-short` (see `main_test.go`). ### Are there any user-facing changes? No. It is a new example that shows up on pkg.go.dev. ### Was AI used for this PR? **PR code and description written by:** - [x] Human - [x] AI **Reviewed before submission by:** - [x] Human - [ ] AI - [ ] Not reviewed AI drafted the example code and I reviewed it. I co-edited the description with AI. -- 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]
