@@ -34,15 +34,10 @@ use crate::array::ArrayId;
3434use crate :: array:: ArrayInner ;
3535use crate :: array:: ArraySlots ;
3636use crate :: array:: DynArrayData ;
37- use crate :: arrays:: Bool ;
3837use crate :: arrays:: Constant ;
3938use crate :: arrays:: DictArray ;
4039use crate :: arrays:: FilterArray ;
41- use crate :: arrays:: Null ;
42- use crate :: arrays:: Primitive ;
4340use crate :: arrays:: SliceArray ;
44- use crate :: arrays:: VarBin ;
45- use crate :: arrays:: VarBinView ;
4641use crate :: buffer:: BufferHandle ;
4742use crate :: builders:: ArrayBuilder ;
4843use crate :: dtype:: DType ;
@@ -443,15 +438,6 @@ impl ArrayRef {
443438 nbytes
444439 }
445440
446- /// Returns whether this array is an arrow encoding.
447- pub fn is_arrow ( & self ) -> bool {
448- self . is :: < Null > ( )
449- || self . is :: < Bool > ( )
450- || self . is :: < Primitive > ( )
451- || self . is :: < VarBin > ( )
452- || self . is :: < VarBinView > ( )
453- }
454-
455441 /// Whether the array is of a canonical encoding.
456442 pub fn is_canonical ( & self ) -> bool {
457443 self . is :: < AnyCanonical > ( )
@@ -801,3 +787,30 @@ impl<V: VTable> Matcher for V {
801787 Some ( unsafe { ArrayView :: new_unchecked ( array, & inner. data ) } )
802788 }
803789}
790+
791+ #[ cfg( test) ]
792+ mod tests {
793+ use vortex_buffer:: buffer;
794+
795+ use super :: * ;
796+ use crate :: arrays:: Decimal ;
797+ use crate :: arrays:: DecimalArray ;
798+ use crate :: arrays:: Primitive ;
799+ use crate :: dtype:: DecimalDType ;
800+
801+ #[ test]
802+ fn fixed_width_arrays_match_their_logical_vtable ( ) {
803+ let primitive = buffer ! [ 1i32 ] . into_array ( ) ;
804+ let decimal = DecimalArray :: new (
805+ buffer ! [ 1i32 ] ,
806+ DecimalDType :: new ( 1 , 0 ) ,
807+ Validity :: NonNullable ,
808+ )
809+ . into_array ( ) ;
810+
811+ assert ! ( primitive. is:: <Primitive >( ) ) ;
812+ assert ! ( !primitive. is:: <Decimal >( ) ) ;
813+ assert ! ( decimal. is:: <Decimal >( ) ) ;
814+ assert ! ( !decimal. is:: <Primitive >( ) ) ;
815+ }
816+ }
0 commit comments