lidavidm commented on code in PR #409:
URL: https://github.com/apache/arrow-adbc/pull/409#discussion_r1094947811


##########
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:
   `// stuff` is the hard part because you can't generically reconstruct the 
type instance, right?



-- 
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]

Reply via email to