emkornfield commented on a change in pull request #10142:
URL: https://github.com/apache/arrow/pull/10142#discussion_r619876276
##########
File path: go/arrow/flight/record_batch_reader.go
##########
@@ -60,15 +68,41 @@ func (d *dataMessageReader) Release() {
if d.msg != nil {
d.msg.Release()
d.msg = nil
+ d.lastAppMetadata = nil
}
}
}
+type Reader struct {
+ *ipc.Reader
+ dmr *dataMessageReader
+}
+
+func (r *Reader) Retain() {
Review comment:
here and below, these are public methods? It would be nice to add some
documentation.
##########
File path: go/arrow/flight/flight_test.go
##########
@@ -311,3 +312,65 @@ func TestServer(t *testing.T) {
t.Fatalf("got %d, want %d", numRows, fi.TotalRecords)
}
}
+
+type flightMetadataWriterServer struct{}
+
+func (f *flightMetadataWriterServer) DoGet(tkt *flight.Ticket, fs
flight.FlightService_DoGetServer) error {
+ recs := arrdata.Records[string(tkt.GetTicket())]
+
+ w := flight.NewRecordWriter(fs, ipc.WithSchema(recs[0].Schema()))
+ defer w.Close()
+ for idx, r := range recs {
+ w.WriteWithAppMetadata(r, []byte(fmt.Sprintf("%d_%s", idx,
string(tkt.GetTicket()))))
Review comment:
nit: not sure go convention here. But in other langauges I find it
useful to document literal like parameters (the second parameter in this case
indicating the second parameter name.
i.e. `/*metadata=*/[]byte(fmt.Sprintf("%d_%s", idx, string(tkt.GetTicket())`
--
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.
For queries about this service, please contact Infrastructure at:
[email protected]