Skip to content

fix(nimble): Fix null population when abandoning the dictionary - #18628

Open
HuamengJiang wants to merge 1 commit into
facebookincubator:mainfrom
HuamengJiang:export-D116928592
Open

fix(nimble): Fix null population when abandoning the dictionary#18628
HuamengJiang wants to merge 1 commit into
facebookincubator:mainfrom
HuamengJiang:export-D116928592

Conversation

@HuamengJiang

Copy link
Copy Markdown
Contributor

Summary:
A selective Nimble read of a string column returned NULL for rows that hold a real string. Reproducing it needs a filter pushed down onto the string column and dictionary preservation enabled. With both on, one 5.1M-row file yielded 4 wrong rows at a batch size of 100 and 7 at a batch size of 1000; the same scan without pushdown was correct. Only the null flags were wrong. The values, the output row count, and the surviving row set all matched the reference read.

The dictionary path reads its prefix with the filter suppressed, so filterDictionaryIndices compacts the output afterwards down to the passing rows. It cleared the result null bitmap only up to the new, smaller numValues_. The vacated tail kept the null bits of the pre-compaction layout. If the read then reaches a chunk that is not dictionary-encoded, it abandons the dictionary and a flat continuation appends over that same tail. That continuation stores each value with addValue, which writes the value but never the null bit, and the buffer-wide clear in prepareNulls is skipped once the prefix has reported a null. Nothing else clears the leftover bits, so they surface as nulls. Both compaction branches now clear the whole range they compacted.

Differential Revision: D116928592

Summary:
A selective Nimble read of a string column returned NULL for rows that hold a real string. Reproducing it needs a filter pushed down onto the string column and dictionary preservation enabled. With both on, one 5.1M-row file yielded 4 wrong rows at a batch size of 100 and 7 at a batch size of 1000; the same scan without pushdown was correct. Only the null flags were wrong. The values, the output row count, and the surviving row set all matched the reference read.

The dictionary path reads its prefix with the filter suppressed, so `filterDictionaryIndices` compacts the output afterwards down to the passing rows. It cleared the result null bitmap only up to the new, smaller `numValues_`. The vacated tail kept the null bits of the pre-compaction layout. If the read then reaches a chunk that is not dictionary-encoded, it abandons the dictionary and a flat continuation appends over that same tail. That continuation stores each value with `addValue`, which writes the value but never the null bit, and the buffer-wide clear in `prepareNulls` is skipped once the prefix has reported a null. Nothing else clears the leftover bits, so they surface as nulls. Both compaction branches now clear the whole range they compacted.

Differential Revision: D116928592
@netlify

netlify Bot commented Aug 21, 2026

Copy link
Copy Markdown

Deploy Preview for meta-velox canceled.

Name Link
🔨 Latest commit 620706a
🔍 Latest deploy log https://app.netlify.com/projects/meta-velox/deploys/6a88c248c497190008c55a62

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Aug 21, 2026
@meta-codesync

meta-codesync Bot commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

@HuamengJiang has exported this pull request. If you are a Meta employee, you can view the originating Diff in D116928592.

@github-actions

Copy link
Copy Markdown

Selective Build Plan

Linux release with adapters is running a full build (no build targets matched the changed files). See the CI workflows README for what this means.


Fast path • Graph from main@2c661fc83bf7

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

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. meta-exported

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant