@@ -36,6 +36,7 @@ use crate::array::ArraySlots;
3636use crate :: array:: DynArrayData ;
3737use crate :: arrays:: Bool ;
3838use crate :: arrays:: Constant ;
39+ use crate :: arrays:: Decimal ;
3940use crate :: arrays:: DictArray ;
4041use crate :: arrays:: FilterArray ;
4142use crate :: arrays:: Null ;
@@ -448,6 +449,7 @@ impl ArrayRef {
448449 self . is :: < Null > ( )
449450 || self . is :: < Bool > ( )
450451 || self . is :: < Primitive > ( )
452+ || self . is :: < Decimal > ( )
451453 || self . is :: < VarBin > ( )
452454 || self . is :: < VarBinView > ( )
453455 }
@@ -801,3 +803,30 @@ impl<V: VTable> Matcher for V {
801803 Some ( unsafe { ArrayView :: new_unchecked ( array, & inner. data ) } )
802804 }
803805}
806+
807+ #[ cfg( test) ]
808+ mod tests {
809+ use vortex_buffer:: buffer;
810+
811+ use super :: * ;
812+ use crate :: arrays:: DecimalArray ;
813+ use crate :: dtype:: DecimalDType ;
814+
815+ #[ test]
816+ fn fixed_width_arrays_match_their_logical_vtable ( ) {
817+ let primitive = buffer ! [ 1i32 ] . into_array ( ) ;
818+ let decimal = DecimalArray :: new (
819+ buffer ! [ 1i32 ] ,
820+ DecimalDType :: new ( 1 , 0 ) ,
821+ Validity :: NonNullable ,
822+ )
823+ . into_array ( ) ;
824+
825+ assert ! ( primitive. is:: <Primitive >( ) ) ;
826+ assert ! ( !primitive. is:: <Decimal >( ) ) ;
827+ assert ! ( decimal. is:: <Decimal >( ) ) ;
828+ assert ! ( !decimal. is:: <Primitive >( ) ) ;
829+ assert ! ( primitive. is_arrow( ) ) ;
830+ assert ! ( decimal. is_arrow( ) ) ;
831+ }
832+ }
0 commit comments