fix: filter garbage entries from null maps during encoding#5591
Merged
wjones127 merged 3 commits intolance-format:mainfrom Dec 31, 2025
Merged
fix: filter garbage entries from null maps during encoding#5591wjones127 merged 3 commits intolance-format:mainfrom
wjones127 merged 3 commits intolance-format:mainfrom
Conversation
wjones127
approved these changes
Dec 30, 2025
Contributor
wjones127
left a comment
There was a problem hiding this comment.
Nice work. I have minor suggestion, if you want to simplify some implementation. Otherwise, I'll merge this tomorrow.
| } | ||
|
|
||
| impl MapArrayExt for MapArray { | ||
| fn filter_garbage_nulls(&self) -> Self { |
Contributor
There was a problem hiding this comment.
Physically, MapArray is a ListArray. Part of my wonders if this would be simpler to just do let trimmed = ListArray::from(self.clone()).filter_garbage_nulls() and the convert back into a MapArray.
Contributor
Author
There was a problem hiding this comment.
Thanks for the suggestion. Just updated.
Null map entries can have non-zero length with garbage values that should be ignored. MapStructuralEncoder was passing all entries to the child encoder, but repdef only counted valid entries, which caused errors to occur when encoding Structs with Map values. Add MapArrayExt trait (mirroring ListArrayExt) with filter_garbage_nulls() and trimmed_entries() methods, and use them in MapStructuralEncoder.
6c34b98 to
2ab3e7c
Compare
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
wjones127
approved these changes
Dec 31, 2025
jackye1995
pushed a commit
to jackye1995/lance
that referenced
this pull request
Jan 21, 2026
…mat#5591) Null map entries can have non-zero length with garbage values that should be ignored. MapStructuralEncoder was passing all entries to the child encoder, but repdef only counted valid entries, which caused errors to occur when encoding Structs with Map values. Add MapArrayExt trait (mirroring ListArrayExt) with filter_garbage_nulls() and trimmed_entries() methods, and use them in MapStructuralEncoder.
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.
Null map entries can have non-zero length with garbage values that should be ignored. MapStructuralEncoder was passing all entries to the child encoder, but repdef only counted valid entries, which caused errors to occur when encoding Structs with Map values.
Add MapArrayExt trait (mirroring ListArrayExt) with filter_garbage_nulls() and trimmed_entries() methods, and use them in MapStructuralEncoder.