fix(nimble): Fix null population when abandoning the dictionary - #18628
Open
HuamengJiang wants to merge 1 commit into
Open
fix(nimble): Fix null population when abandoning the dictionary#18628HuamengJiang wants to merge 1 commit into
HuamengJiang wants to merge 1 commit into
Conversation
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
✅ Deploy Preview for meta-velox canceled.
|
Contributor
|
@HuamengJiang has exported this pull request. If you are a Meta employee, you can view the originating Diff in D116928592. |
Selective Build Plan
Fast path • Graph from main@2c661fc83bf7 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
filterDictionaryIndicescompacts the output afterwards down to the passing rows. It cleared the result null bitmap only up to the new, smallernumValues_. 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 withaddValue, which writes the value but never the null bit, and the buffer-wide clear inprepareNullsis 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