Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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: 2 additions & 0 deletions vortex-array/public-api.lock
Original file line number Diff line number Diff line change
Expand Up @@ -19038,6 +19038,8 @@ pub fn vortex_array::validity::Validity::mask_eq(&self, other: &vortex_array::va

pub fn vortex_array::validity::Validity::maybe_len(&self) -> core::option::Option<usize>

pub fn vortex_array::validity::Validity::no_nulls(&self) -> bool

pub fn vortex_array::validity::Validity::not(&self) -> vortex_error::VortexResult<Self>

pub fn vortex_array::validity::Validity::nullability(&self) -> vortex_array::dtype::Nullability
Expand Down
3 changes: 1 addition & 2 deletions vortex-array/src/arrow/record_batch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ use crate::VortexSessionExecute;
use crate::array::IntoArray;
use crate::arrays::StructArray;
use crate::arrow::ArrowArrayExecutor;
use crate::validity::Validity;

// deprecated(note = "Use ArrowArrayExecutor::execute_record_batch instead")
impl TryFrom<&ArrayRef> for RecordBatch {
Expand All @@ -29,7 +28,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