Matt, I just created the JIRA: https://issues.apache.org/jira/browse/ARROW-12517 . I'd be happy to pick it up as well but since it sounds like you're already in the code at the moment and it's a small change, I'll leave it to you. Thanks for your work on the Go library already!
For anyone else who comes across this in the interim, here's a gist with the workaround I'm using: https://gist.github.com/pgwhalen/ed768e18917610b2de7942144068f205 (not particularly well tested and a little sloppy design, but seems to work). Paul On Thu, Apr 22, 2021 at 9:30 AM Matthew Topol <mto...@factset.com> wrote: > You're absolutely correct and not missing anything, this is definitely an > opportunity to make the flight record reader a bit more useful. I like the > idea of the getLatestMetadata that you mentioned is on the java side. Can > you file a JIRA issue for this? Given that I'm doing a lot of updates to > the Go library already (and I'm the one who wrote the flight client/server > for Go) I can see about adding that functionality. > > --Matt > > -----Original Message----- > From: Paul Whalen <pgwha...@gmail.com> > Sent: Wednesday, April 21, 2021 12:44 PM > To: dev@arrow.apache.org > Subject: [Go] Flight client app metadata access > > Hi all, > > I'm using the Go Flight client, working off of this example: > > https://urldefense.com/v3/__https://github.com/apache/arrow/blob/master/go/arrow/flight/flight_test.go__;!!PBKjc0U4!an-4cxncu8LAtExIU1-l-ckt5GrUyLBo39gJpdZwITpDu7jhoxUXufwl9IfIt4k$ > > I've found that there isn't a very convenient way to access the app > metadata from a Flight stream, because the ipc.Reader you get from calling > flight.NewRecordReader() only exposes the array.Record as you read data > from it. This makes sense to me because only Flight defines the App > Metadata concept, not the Arrow IPC format on its own. I've been able to > work around it by dropping down a level, and building an alternate > flight.dataMessageReader but this seems subpar. > > Am I missing something? Or is there an opportunity to make the result of > flight.NewRecordReader() a bit more useful such that it includes the app > metadata? Perhaps a type more specific to Flight, not just IPC in > general. On the Java side I see that FlightStream has getLatestMetadata() > which seems like a pattern worth following. > > Thanks, > Paul >