You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2021/04/23 18:35:31 UTC

[GitHub] [arrow] zeroshade commented on a change in pull request #10142: ARROW-12517: [Go][Flight] Expose app metadata in flight client and server

zeroshade commented on a change in pull request #10142:
URL: https://github.com/apache/arrow/pull/10142#discussion_r619423782



##########
File path: go/arrow/flight/record_batch_writer.go
##########
@@ -46,17 +47,39 @@ func (f *flightPayloadWriter) WritePayload(payload ipc.Payload) error {
 
 	payload.SerializeBody(&f.buf)
 	f.fd.DataBody = f.buf.Bytes()
+
 	return f.w.Send(&f.fd)
 }
 
 func (f *flightPayloadWriter) Close() error { return nil }
 
+type Writer struct {
+	*ipc.Writer
+	pw *flightPayloadWriter
+}
+
+// ClearAppMetadata sets the writers app metadata to nil so that subsequent records
+// will not contain App Metadata until another call is made to WriteWithAppMetadata.
+func (w *Writer) ClearAppMetadata() {
+	w.pw.fd.AppMetadata = nil
+}

Review comment:
       fair point. I've updated this without the ClearAppMetadata and made it no longer "sticky". Metadata only sticks around for a single write.




-- 
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:
users@infra.apache.org