Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion vortex-array/src/arrow/record_batch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ impl TryFrom<&ArrayRef> for RecordBatch {
};

vortex_ensure!(
matches!(struct_array.validity()?, Validity::AllValid),
struct_array.validity()?.no_nulls(),
"RecordBatch can only be constructed from StructArray with no nulls"
);

Expand Down
7 changes: 7 additions & 0 deletions vortex-array/src/validity.rs
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,13 @@ impl Validity {
}
}

/// Returns `true` if this validity guarantees no null values, i.e. it is either
/// [`Validity::NonNullable`] or [`Validity::AllValid`].
#[inline]
pub fn no_nulls(&self) -> bool {
matches!(self, Self::NonNullable | Self::AllValid)
}

/// The union nullability and validity.
#[inline]
pub fn union_nullability(self, nullability: Nullability) -> Self {
Expand Down
Loading