Enum validation#105
Open
hadley wants to merge 2 commits into
Open
Conversation
Error when an `enum` column contains a non-null value outside its declared `values` (issue #72). Parses the allowed values into the model (list items or map keys), builds a canonical set, and checks membership during the data scan via the existing ColumnCheck pipeline. The footer can't settle set membership, so the meta check is always inconclusive for enum columns and defers to the scan.
Enums are almost always dictionary-encoded, so a column chunk's distinct values sit in one small dictionary page. When every dictionary entry is in the allowed set and every data page draws from the dictionary, the column conforms without scanning its values; any doubt falls back to the full scan (which also reports offending rows). ~500x faster on a conforming 10M-row enum column (0.004s vs 1.5s). The parquet-rs writer omits page_encoding_stats, so the data-page check uses those stats when present and otherwise inspects each page's encoding directly (cheap: index pages are tiny and never decoded here).
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.
Validate that no enum values are outside of the specified set. Has a fast pass where that's true, and then a slower pass to report locations of invalid values.
Fixes #72