File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -17,19 +17,17 @@ use crate::VortexSessionExecute;
1717use crate :: array:: IntoArray ;
1818use crate :: arrays:: StructArray ;
1919use crate :: arrow:: ArrowArrayExecutor ;
20- use crate :: validity:: Validity ;
21-
22- // deprecated(note = "Use ArrowArrayExecutor::execute_record_batch instead")
2320impl TryFrom < & ArrayRef > for RecordBatch {
2421 type Error = VortexError ;
2522
23+ #[ deprecated( note = "Use ArrowArrayExecutor::execute_record_batch instead" ) ]
2624 fn try_from ( value : & ArrayRef ) -> VortexResult < Self > {
2725 let Canonical :: Struct ( struct_array) = value. to_canonical ( ) ? else {
2826 vortex_bail ! ( "RecordBatch can only be constructed from " )
2927 } ;
3028
3129 vortex_ensure ! (
32- matches! ( struct_array. validity( ) ?, Validity :: AllValid ) ,
30+ struct_array. validity( ) ?. no_nulls ( ) ,
3331 "RecordBatch can only be constructed from StructArray with no nulls"
3432 ) ;
3533
Original file line number Diff line number Diff 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 {
You can’t perform that action at this time.
0 commit comments