Skip to content

Panic on UnsafeAppendBoolToBitmap for dictionary and REE builders#758

Open
serramatutu wants to merge 1 commit intoapache:mainfrom
serramatutu:serramatutu/UnsafeAppendBoolToBitmap-ree
Open

Panic on UnsafeAppendBoolToBitmap for dictionary and REE builders#758
serramatutu wants to merge 1 commit intoapache:mainfrom
serramatutu:serramatutu/UnsafeAppendBoolToBitmap-ree

Conversation

@serramatutu
Copy link
Copy Markdown

@serramatutu serramatutu commented Apr 10, 2026

Rationale for this change

For more context: https://github.com/apache/arrow-go/pull/558/changes#r2758798540

The Builders for REE and dict-encoded arrays were inheriting the UnsafeAppendBoolToBitmap() from the Builder interface defined in arrow/array/builder.go. The default implementation does not bump the length of the inner idxBuilder or runEndsBuilder, which causes it to be in an inconsistent state where the parent has greater length than the index/run-ends builder. This causes a panic when instancing a record batch.

What changes are included in this PR?

This commit makes UnsafeAppendBoolToBitmap() for dictionaryBuilder and RunEndEncodedBuilder panic.

Are these changes tested?

No.

Are there any user-facing changes?

No.

For more context: https://github.com/apache/arrow-go/pull/558/changes#r2758798540

This commit makes `UnsafeAppendBoolToBitmap()` for `dictionaryBuilder`
and `RunEndEncodedBuilder` panic. The current implementation pulled
from `arrow/array/builder.go` would leave the builders in invalid states
that would panic when trying to finish a record batch.
@serramatutu serramatutu force-pushed the serramatutu/UnsafeAppendBoolToBitmap-ree branch from c2b7711 to 374a42f Compare April 10, 2026 23:26
@serramatutu serramatutu changed the title Implement UnsafeAppendBoolToBitmap for dictionary and REE builders Panic on UnsafeAppendBoolToBitmap for dictionary and REE builders Apr 10, 2026
@serramatutu serramatutu marked this pull request as ready for review April 10, 2026 23:28
@serramatutu serramatutu requested a review from zeroshade as a code owner April 10, 2026 23:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant