Repository navigation
fix bugs in dot expressions with union-missings - #7478
Merged
Merged
Conversation
This commit fixes how dot expressions handle missing-field errors by recognizing the only place these come from are either from fields missing in a plain record or union-missings that are none::union fusion values. This code path is simple and elegant now and will be easier to maintain. There is still a problem with fusion projections but this change hides that bug away from all our tests. We will fix this in a subsequent PR. Fixes #7469
nwt
approved these changes
Oct 14, 2026
Comment on lines
+227
to
+228
| noneTag := findNone(union.Values()) | ||
| if noneTag < 0 { |
Collaborator
There was a problem hiding this comment.
Nit: I think the intention here would be clearer if you could see the length check.
Suggested change
| noneTag := findNone(union.Values()) | |
| if noneTag < 0 { | |
| noneTag := union.Typ.TagOf(super.TypeNone) | |
| if noneTag < 0 || union.Values()[noneTag].Len() == 0 { |
Collaborator
Author
There was a problem hiding this comment.
Values tags and type tags are not aligned
| if noneTag < 0 { | ||
| return vec | ||
| } | ||
| var pick, tags []uint32 |
Collaborator
There was a problem hiding this comment.
Nit: We usually call this thing index.
Suggested change
| var pick, tags []uint32 | |
| var index, tags []uint32 |
| --- | ||
|
|
||
| script: | | ||
| super -f bsup -o in.bsup in.json |
Collaborator
There was a problem hiding this comment.
Nit:
Suggested change
| super -f bsup -o in.bsup in.json | |
| super -o in.bsup in.json |
| case *vector.Fusion: | ||
| return hasMissingUnion(vec.Values) | ||
| case *vector.Dynamic: | ||
| return slices.IndexFunc(vec.Values, hasMissingUnion) >= 0 |
Collaborator
There was a problem hiding this comment.
Suggested change
| return slices.IndexFunc(vec.Values, hasMissingUnion) >= 0 | |
| return slices.ContainsFunc(vec.Values, hasMissingUnion) |
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.
This commit fixes how dot expressions handle missing-field errors by recognizing the only place these come from are either from fields missing in a plain record or union-missings that are none::union fusion values. This code path is simple and elegant now and will be easier to maintain.
There is still a problem with fusion projections but this change hides that bug away from all our tests. We will fix this in a subsequent PR.
Fixes #7469