Skip to content

Conversation

@amorynan
Copy link

For solving : #3859
Add methods to push struct-level validity into child fields:

  • push_validity_into_children(preserve_struct_validity: bool)
  • push_validity_into_children_default() - convenience method with preserve=false

The functionality propagates null information from struct level down to individual fields, with options to preserve or remove the struct-level validity.

Includes comprehensive tests covering all scenarios:

  • preserve_struct_validity = true
  • preserve_struct_validity = false (default)
  • no nulls edge case

Add methods to push struct-level validity into child fields:
- push_validity_into_children(preserve_struct_validity: bool)
- push_validity_into_children_default() - convenience method with preserve=false

The functionality propagates null information from struct level down to
individual fields, with options to preserve or remove the struct-level validity.

Includes comprehensive tests covering all scenarios:
- preserve_struct_validity = true
- preserve_struct_validity = false (default)
- no nulls edge case

Signed-off-by: amorynan <amorywang111@gmail.com>
@connortsui20 connortsui20 added the feature Release label indicating a new feature or request label Dec 27, 2025
@codecov
Copy link

codecov bot commented Dec 27, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 81.96%. Comparing base (1e0f608) to head (efcb565).
⚠️ Report is 7 commits behind head on develop.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Contributor

@connortsui20 connortsui20 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is a good first step, though I'm trying to figure out how we want to implement this behavior for the new operator world we are migrating to.

@gatesn mentioned this in the original issue:

Since this issue was filed, we now have a "Mask" expression that essentially performs intersection with validity.

So you could take a look at how you might take the validity from the struct array itself, and wrap up each child field in a mask expression (see builtins.rs), before constructing a new StructArray with or without the previous validity. These two are different behaviors.

This PR implements this feature correctly for the old (current) world, but we will likely want to implement the behavior described above very very soon, so soon that it might not even be worth merging this right now? @gatesn do you have any thoughts?

Comment on lines +506 to +508
pub fn push_validity_into_children_default(&self) -> VortexResult<Self> {
self.push_validity_into_children(false)
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we need to have this method, the one below should be sufficient since a the bool impl of Default is already false.



pub fn push_validity_into_children(&self, preserve_struct_validity: bool) -> VortexResult<Self> {
use crate::compute::mask;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you move this import to the top?

pub fn push_validity_into_children(&self, preserve_struct_validity: bool) -> VortexResult<Self> {
use crate::compute::mask;

// Get the struct-level validity mask
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: periods at the ends of sentences.

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

Labels

feature Release label indicating a new feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants