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



##########
File path: go/arrow/datatype_nested.go
##########
@@ -148,6 +148,40 @@ func (t *StructType) FieldByName(name string) (Field, 
bool) {
        return t.fields[i], true
 }
 
+type MapType struct {
+       value      *ListType
+       KeysSorted bool
+}
+
+func MapOf(key, item DataType) *MapType {
+       if key == nil || item == nil {
+               panic("arrow: nil key or item type for MapType")
+       }
+
+       return &MapType{value: ListOf(StructOf(Field{Name: "key", Type: key}, 
Field{Name: "value", Type: item, Nullable: true}))}

Review comment:
       Ok, I confirmed that the names hardcoded here do not affect reading maps 
that name it differently. The assumption, as per the spec, is always that the 
first field is the keys and the second field is the values.




-- 
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:
[email protected]


Reply via email to