zeroshade commented on code in PR #13770:
URL: https://github.com/apache/arrow/pull/13770#discussion_r935853660


##########
go/arrow/array/concat_test.go:
##########
@@ -158,6 +159,32 @@ func (cts *ConcatTestSuite) generateArr(size int64, 
nullprob float64) arrow.Arra
                bldr := array.NewListBuilder(memory.DefaultAllocator, 
arrow.PrimitiveTypes.Int8)
                defer bldr.Release()
 
+               valid := make([]bool, len(offsetsVector)-1)
+               for i := range valid {
+                       valid[i] = true
+               }
+               bldr.AppendValues(offsetsVector, valid)
+               vb := bldr.ValueBuilder().(*array.Int8Builder)
+               for i := 0; i < values.Len(); i++ {
+                       if values.IsValid(i) {
+                               vb.Append(values.Value(i))
+                       } else {
+                               vb.AppendNull()
+                       }
+               }
+               return bldr.NewArray()
+       case arrow.LARGE_LIST:
+               valuesSize := size * 8

Review Comment:
   `size` is the number of elements in the list array (which is why 
`cts.largeOffsets` outputs a slice with `size+1` elements because offsets 
should be 1 + #of elems). I multiplied by 8 here just to have a larger child 
array than I was using with the initial List cases, thus the lengths of the 
list elements will be *on average* larger than the previous case.
   
   TL;DR: `size` is the number of list elements (and `size+1` is the number of 
offsets). `valuesSize` is the total length of the child array which will get 
sliced up into those list elements randomly.



-- 
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]

Reply via email to