zeroshade commented on a change in pull request #10106:
URL: https://github.com/apache/arrow/pull/10106#discussion_r619890493
##########
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:
the current implementation of `StructOf` does not provide a name for the
resulting struct, it only creates a datatype, rather than a Field. The DataType
can then be used to create a Field and thus Name the struct.
The same is true for the current implementation of `ListOf` here. The result
is a `DataType` not a field and thus doesn't have a name.
--
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]