zeroshade commented on issue #41284:
URL: https://github.com/apache/arrow/issues/41284#issuecomment-2066756736
There isn't currently a fully convenient one like we have for structs
currently, but you can easily do so by using the `array.Data` object directly:
```go
newValues := convertFunction(listArr.ListValues())
defer newValues.Release()
newListData := array.NewData(listArr.DataType(), listArr.Len(),
listArr.Data().Buffers(), []arrow.ArrayData{newValues.Data()}, listArr.NullN(),
/* offset=*/0)
defer newListData.Release()
newListArr := array.NewListData(newListData)
```
Similarly you can construct map arrays, which are physically laid out as
equivalent to a `list<element: struct<key: K, value: V>>`
That said, I think it would be a reasonable ask to add new convenience
functions for this to make it easier for consumers to construct new list arrays
and map arrays without having to manipulate the Data object themselves directly.
--
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]