zeroshade commented on code in PR #409:
URL: https://github.com/apache/arrow-adbc/pull/409#discussion_r1094946334
##########
go/adbc/driver/flightsql/record_reader.go:
##########
@@ -201,3 +208,23 @@ func (r *reader) Schema() *arrow.Schema {
func (r *reader) Record() arrow.Record {
return r.rec
}
+
+func removeSchemaMetadata(schema *arrow.Schema) *arrow.Schema {
+ fields := make([]arrow.Field, len(schema.Fields()))
+ for i, field := range schema.Fields() {
+ fields[i] = removeFieldMetadata(&field)
+ }
+ return arrow.NewSchema(fields, nil)
+}
+
+func removeFieldMetadata(field *arrow.Field) arrow.Field {
+ // XXX: this should recurse into the child fields, but there's not
+ // an easy way to navigate this generically - we can improve this
+ // upstream
+ return arrow.Field{
+ Name: field.Name,
+ Type: field.Type,
+ Nullable: field.Nullable,
+ Metadata: arrow.Metadata{},
+ }
Review Comment:
Could do:
```go
if n, ok := field.Type.(arrow.NestedType); ok {
for i, f := range n.Fields() {
// stuff
}
}
```
?
Though upstream we should make an `EqualWithoutMetadata` for fields or
something of the like....
--
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]