break: add Validity::definitely_all_null() method - #8447
Conversation
Introduce a cheap, conservative `Validity::definitely_all_null()` helper that returns true only for `Validity::AllInvalid`, mirroring the existing `definitely_no_nulls`. Replace the `matches!(.., Validity::AllInvalid)` fast-path checks across the array, cuda, and duckdb crates with it, and drop the now-unused `Validity` imports. Signed-off-by: Joe Isaacs <joe.isaacs@live.co.uk>
Spell out that the method reports whether the validity is definitely all-null, that a `false` result does not prove any value is valid, and point callers at executing the validity into a `Mask` and checking `Mask::all_false` for a definitive answer. Signed-off-by: Joe Isaacs <joe.isaacs@live.co.uk>
Validity::definitely_all_null() method
Merging this PR will not alter performance
|
| Mode | Benchmark | BASE |
HEAD |
Efficiency | |
|---|---|---|---|---|---|
| ❌ | Simulation | encode_varbin[(1000, 2)] |
157.9 µs | 177.3 µs | -10.96% |
| ⚡ | Simulation | bitwise_not_vortex_buffer_mut[128] |
215.3 ns | 186.1 ns | +15.67% |
| ⚡ | Simulation | bitwise_not_vortex_buffer_mut[1024] |
275.6 ns | 246.4 ns | +11.84% |
Tip
Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.
Comparing claude/dazzling-tesla-o2wa4w (89de607) with develop (9b5447a)
Footnotes
-
10 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩
Summary
This PR introduces a new
Validity::definitely_all_null()method that provides a fast path to check if a validity is definitively all-null (i.e.,Validity::AllInvalid). This is the counterpart to the existingdefinitely_no_nulls()method.This is a rename, but not a change in semantics