Skip to content

Drop null patch elements when sparse lists share their elements - #11182

Merged
mhk197 merged 1 commit into
developfrom
mk/sparse-list-empty-nulls
Nov 4, 2026
Merged

mhk197 merged 1 commit into
developfrom
mk/sparse-list-empty-nulls

Conversation

@mhk197

@mhk197 mhk197 commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Since #11173, sparse lists with a null or empty fill reuse the patch lists' elements in their output. When the patch lists are already zero-copy to a list, MakeExact only trims the ends, so null patch lists keep their elements. Those elements are exported and written.

This PR uses MakeExactWithEmptyNulls on the null or empty fill path so that null patches are lists of length 0.

Changes

  • The shared-elements path rebuilds the patch lists with MakeExactWithEmptyNulls.
  • If null lists hold nothing, the rebuild returns the array as is; otherwise the elements become a lazy filter over the ranges valid lists use.
  • empty_fill_reuses_elements test now uses a null patch with no elements.

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog/performance A performance improvement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants