Skip to content

Arrow: Fix NullabilityHolder.reset() to clear the isNull array #15809

Open
thswlsqls wants to merge 1 commit intoapache:mainfrom
thswlsqls:fix/arrow-nullability-holder-reset
Open

Arrow: Fix NullabilityHolder.reset() to clear the isNull array #15809
thswlsqls wants to merge 1 commit intoapache:mainfrom
thswlsqls:fix/arrow-nullability-holder-reset

Conversation

@thswlsqls
Copy link
Copy Markdown
Contributor

@thswlsqls thswlsqls commented Mar 28, 2026

Closes #15808

reset() clears numNulls but not the isNull byte array. Current callers always overwrite all positions on the next batch, so stale data is not observed today - but reset() should restore a clean initial state to avoid a trap for future callers.

Fix: add Arrays.fill(isNull, (byte) 0) in reset(). The other two arrays (nulls, nonNulls) are immutable arraycopy source buffers and do not need clearing.

NullabilityHolder.reset() only reset the numNulls counter to zero
but did not clear the isNull byte array, leaving stale null markers
from the previous batch. This could cause isNullAt() to return
incorrect results after a reset if the caller did not explicitly
overwrite every position.

Clear the isNull array in reset() to ensure consistent state.
@github-actions github-actions bot added the arrow label Mar 28, 2026
@huaxingao
Copy link
Copy Markdown
Contributor

Could you add AI disclosure to this PR? Same for all your other PRs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

NullabilityHolder.reset() does not clear the isNull array

2 participants