Skip to content

Commit 8ab2ff2

Browse files
committed
fix
Signed-off-by: Joe Isaacs <joe.isaacs@live.co.uk>
1 parent 12f63a4 commit 8ab2ff2

2 files changed

Lines changed: 8 additions & 1 deletion

File tree

vortex-array/src/arrow/record_batch.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ impl TryFrom<&ArrayRef> for RecordBatch {
2929
};
3030

3131
vortex_ensure!(
32-
matches!(struct_array.validity()?, Validity::AllValid),
32+
struct_array.validity()?.no_nulls(),
3333
"RecordBatch can only be constructed from StructArray with no nulls"
3434
);
3535

vortex-array/src/validity.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,13 @@ impl Validity {
112112
}
113113
}
114114

115+
/// Returns `true` if this validity guarantees no null values, i.e. it is either
116+
/// [`Validity::NonNullable`] or [`Validity::AllValid`].
117+
#[inline]
118+
pub fn no_nulls(&self) -> bool {
119+
matches!(self, Self::NonNullable | Self::AllValid)
120+
}
121+
115122
/// The union nullability and validity.
116123
#[inline]
117124
pub fn union_nullability(self, nullability: Nullability) -> Self {

0 commit comments

Comments
 (0)