Conversation
Signed-off-by: 1fanwang <1fannnw@gmail.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #25389 +/- ##
==========================================
- Coverage 81.93% 81.93% -0.01%
==========================================
Files 1136 1136
Lines 429152 429215 +63
Branches 429152 429215 +63
==========================================
+ Hits 351633 351679 +46
- Misses 56475 56487 +12
- Partials 21044 21049 +5 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
Which issue does this PR close?
Closes #25293.
Rationale for this change
Unnesting a NULL struct can expose its stored child values. A non-nullable child field can also make a valid query fail. Both cases now produce NULL values.
What changes are included in this PR?
Output fields include the parent's nullability. The executor applies the parent mask through Arrow and reuses the original child arrays when the parent has no nulls.
What is the testing strategy for this PR?
SQL and native-array regressions cover schema nullability and child validity, including nested and encoded children.
Run these commands from the repository root:
The JSON writer omits NULL-valued fields.
Before, the first query exposes values and the second fails:
After the same two commands:
Raw schema diagnostic
The SQL regression also catches the incorrect output nullability before the fix:
cargo test --locked --profile ci --test sqllogictests -- unnest_struct_nulls.sltRaw before-fix excerpt:
Are there any user-facing changes?
Yes. NULL structs now unnest into NULL fields rather than values or an error.