zeroshade commented on PR #13574:
URL: https://github.com/apache/arrow/pull/13574#issuecomment-1180771944
@lquerel In that situation, couldn't the user just construct the individual
columns and then build the final struct column without needing the explicit
struct builder? something like:
```go
children := make([]arrow.ArrayData, len(builders))
for i, b := range builders {
arr := b.NewArray()
defer arr.Release()
children[i] = arr.Data()
}
data := array.NewData(arrow.StructOf(fields...), children[0].Len(),
[]*memory.Buffers{nil, nil}, children, 0, 0)
defer data.Release()
final := array.NewStructData(data)
```
the `StructBuilder` is really just a convenience wrapper around a slice of
builders and building the top level null-bitmap. So, if you have the slice of
builders to use your this new Unsafe function then you have one of two
situations:
1. you have the type information already (from however you constructed the
builders) and can create the struct type
2. you have already populated the builders, which means you can just grab
the final arrays and construct the struct column easily
Worst case, you could turn the above code snippet into a helper function.
Does this make sense?
--
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]