emkornfield commented on a change in pull request #11359:
URL: https://github.com/apache/arrow/pull/11359#discussion_r741383722



##########
File path: go/arrow/array/struct.go
##########
@@ -105,6 +107,36 @@ func (a *Struct) setData(data *Data) {
        }
 }
 
+func (a *Struct) getOneForMarshal(i int) interface{} {
+       if a.IsNull(i) {
+               return nil
+       }
+
+       tmp := make(map[string]interface{})
+       fieldList := a.data.dtype.(*arrow.StructType).Fields()
+       for j, d := range a.fields {
+               tmp[fieldList[j].Name] = d.getOneForMarshal(i)

Review comment:
       I don't think the arrow spec says struct names need to be unique, it 
might be worth checking for that case here and throwing an error OR using a 
list of tuple representation in that case.




-- 
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: github-unsubscr...@arrow.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to