zeroshade commented on code in PR #13770:
URL: https://github.com/apache/arrow/pull/13770#discussion_r935774215
##########
go/arrow/array/list_test.go:
##########
@@ -211,3 +211,190 @@ func TestListArraySlice(t *testing.T) {
t.Fatalf("got=%q, want=%q", got, want)
}
}
+
+func TestLargeListArray(t *testing.T) {
+ pool := memory.NewCheckedAllocator(memory.NewGoAllocator())
+ defer pool.AssertSize(t, 0)
+
+ var (
+ vs = []int32{0, 1, 2, 3, 4, 5, 6}
+ lengths = []int{3, 0, 4}
+ isValid = []bool{true, false, true}
+ offsets = []int64{0, 3, 3, 7}
+ )
+
+ lb := array.NewLargeListBuilder(pool, arrow.PrimitiveTypes.Int32)
+ defer lb.Release()
+
+ for i := 0; i < 10; i++ {
+ vb := lb.ValueBuilder().(*array.Int32Builder)
+ vb.Reserve(len(vs))
+
+ pos := 0
+ for i, length := range lengths {
+ lb.Append(isValid[i])
+ for j := 0; j < length; j++ {
+ vb.Append(vs[pos])
+ pos++
+ }
+ }
+
+ arr := lb.NewArray().(*array.LargeList)
+ defer arr.Release()
+
+ arr.Retain()
+ arr.Release()
+
+ if got, want := arr.DataType().ID(), arrow.LARGE_LIST; got !=
want {
+ t.Fatalf("got=%v, want=%v", got, want)
Review Comment:
It does, and you can see it used elsewhere in the tests. I just took the
shortcut here to copy and paste the existing tests and shifted the type IDs to
be LARGE_LIST lol.
But you're right, I should simplify this to utilize the framework better
instead. I'll do that.
--
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]