Skip to content

Enum validation#105

Open
hadley wants to merge 2 commits into
mainfrom
d03-enum-validation
Open

Enum validation#105
hadley wants to merge 2 commits into
mainfrom
d03-enum-validation

Conversation

@hadley

@hadley hadley commented Jul 2, 2026

Copy link
Copy Markdown
Member

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

hadley added 2 commits July 1, 2026 17:37
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).
@gaborcsardi gaborcsardi added this to the July sprint milestone Jul 6, 2026
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.

Validate values against data

2 participants