File tree Expand file tree Collapse file tree 2 files changed +16
-1
lines changed Expand file tree Collapse file tree 2 files changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -31,6 +31,10 @@ const (
3131
3232// Builder provides an interface to build arrow arrays.
3333type Builder interface {
34+ // Retain increases the reference count by 1.
35+ // Retain may be called simultaneously from multiple goroutines.
36+ Retain ()
37+
3438 // Release decreases the reference count by 1.
3539 Release ()
3640
@@ -47,6 +51,14 @@ type Builder interface {
4751 // AppendNull adds a new null value to the array being built.
4852 AppendNull ()
4953
54+ // Reserve ensures there is enough space for appending n elements
55+ // by checking the capacity and calling Resize if necessary.
56+ Reserve (n int )
57+
58+ // Resize adjusts the space allocated by b to n elements. If n is greater than b.Cap(),
59+ // additional memory will be allocated. If n is smaller, the allocated memory may reduced.
60+ Resize (n int )
61+
5062 // NewArray creates a new array from the memory buffers used
5163 // by the builder and resets the Builder so it can be used to build
5264 // a new array.
Original file line number Diff line number Diff line change @@ -86,10 +86,13 @@ func (b *NullBuilder) AppendNull() {
8686 b .builder .nulls ++
8787}
8888
89+ func (* NullBuilder ) Reserve (size int ) {}
90+ func (* NullBuilder ) Resize (size int ) {}
91+
8992func (* NullBuilder ) init (cap int ) {}
9093func (* NullBuilder ) resize (newBits int , init func (int )) {}
9194
92- // NewArray creates a List array from the memory buffers used by the builder and resets the NullBuilder
95+ // NewArray creates a Null array from the memory buffers used by the builder and resets the NullBuilder
9396// so it can be used to build a new array.
9497func (b * NullBuilder ) NewArray () Interface {
9598 return b .NewNullArray ()
You can’t perform that action at this time.
0 commit comments