Skip to content

Commit eff57e6

Browse files
committed
Add UnsafeAppendBoolToBitmap() to dict and REE builders
These builder implementations were inheriting the default implementation from `Builder`, which does not bump the length of the inner builders. This would leave the builder in an inconsistent state where the top-level builder had the correct length but the inner builder doesn't.
1 parent cbf8f65 commit eff57e6

2 files changed

Lines changed: 15 additions & 0 deletions

File tree

arrow/array/dictionary.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -623,6 +623,12 @@ func (b *dictionaryBuilder) Release() {
623623
}
624624
}
625625

626+
func (b *dictionaryBuilder) UnsafeAppendBoolToBitmap(v bool) {
627+
b.length += 1
628+
b.nulls += 1
629+
b.idxBuilder.UnsafeAppendBoolToBitmap(v)
630+
}
631+
626632
func (b *dictionaryBuilder) AppendNull() {
627633
b.length += 1
628634
b.nulls += 1

arrow/array/encoded.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -386,6 +386,15 @@ func (b *RunEndEncodedBuilder) ContinueRun(n uint64) {
386386
b.addLength(n)
387387
}
388388

389+
func (b *RunEndEncodedBuilder) UnsafeAppendBoolToBitmap(v bool) {
390+
if !v {
391+
b.finishRun()
392+
}
393+
394+
b.values.UnsafeAppendBoolToBitmap(v)
395+
b.addLength(1)
396+
}
397+
389398
func (b *RunEndEncodedBuilder) AppendNull() {
390399
b.finishRun()
391400
b.values.AppendNull()

0 commit comments

Comments
 (0)