Repository navigation
Change extension dtype nullability without validating again - #11012
Conversation
Merging this PR will degrade performance by 13.98%2 warnings
Warning Please fix the performance issues or acknowledge them on CodSpeed. Performance Changes
Tip Investigate this regression by commenting Comparing |
963b7ec to
35c68ec
Compare
|
So this is definitely wrong, and it seems like we need to do a bit more design work around storage dtypes and nullability |
An extension type cannot restrict whether its values can be null, so `ExtVTable::validate_dtype` must not depend on the top-level nullability of the storage dtype. `ExtDType::with_nullability` now relies on that contract and rebuilds the dtype without validating again, so nullability changes in `take`, `mask` and `min_max` cannot panic. Also fixes `Debug for ExtDTypeRef`, which printed the metadata before the struct and then `metadata: Ok(())`. Signed-off-by: Connor Tsui <[email protected]>
35c68ec to
f2c669e
Compare
Signed-off-by: Connor Tsui <[email protected]>
Signed-off-by: Connor Tsui <[email protected]>
U2, U3, U4, U6, U7 and U8 merged on 2026-11-02 in #11012, #11014 and #11016, and the DataFusion literal fix #11067 merged right after U2. So order constraint 1 holds, and phase 1 starts from develop. The graph shows these nodes as merged, and parts 2 and 4 name the PR that fixed each finding. #10953 now keeps i32 days and widens only the days part to i64 when a value does not fit. It has no review, and it conflicts with the DateTimeParts compare kernel that U2 changed. #11056 still waits on its request for changes. #10661 replaces the closed #10482 for file sort statistics. In the type roadmap, only the N1 sentence changes. Signed-off-by: Connor Tsui <[email protected]>
Summary
takeandmaskcan make an extension array nullable, whilemin_maxbuilds non-null result dtypes. These operations need to change nullability without failing. Previously,ExtDType::with_nullabilitycalled the plugin validator again and panicked if it returned an error.An extension type must accept either top-level nullability, so an already valid dtype can be reused with that flag changed.
with_nullabilitynow relies on this contract instead of validating again.Changes
Keeps metadata and storage types intact when changing nullability. Also fixes erased dtype
Debugoutput, which wrote metadata before the struct and displayedmetadata: Ok(())in its place.Regression tests cover both nullabilities, validation call counts, and compact and pretty
Debugoutput. Checks for the style cleanup are left to CI.API Changes
Documents that
ExtVTable::validate_dtypemust be independent of the storage dtype's top-level nullability. Validators can still constrain nullability inside nested storage types.