@@ -29,7 +29,7 @@ use vortex_error::{VortexExpect as _, vortex_panic};
2929use vortex_scalar:: i256;
3030
3131use crate :: arrays:: {
32- BoolArray , DecimalArray , FixedSizeListArray , ListArray , ListViewArray , NullArray ,
32+ BoolArray , DecimalArray , DictArray , FixedSizeListArray , ListArray , ListViewArray , NullArray ,
3333 PrimitiveArray , StructArray , TemporalArray , VarBinArray , VarBinViewArray ,
3434} ;
3535use crate :: arrow:: FromArrowArray ;
@@ -492,6 +492,36 @@ impl FromArrowArray<&dyn ArrowArray> for ArrayRef {
492492 DataType :: Decimal256 ( ..) => {
493493 Self :: from_arrow ( array. as_primitive :: < Decimal256Type > ( ) , nullable)
494494 }
495+ DataType :: Dictionary ( key_type, _) => match key_type. as_ref ( ) {
496+ DataType :: Int8 => {
497+ DictArray :: from_arrow ( array. as_dictionary :: < Int8Type > ( ) , nullable) . into_array ( )
498+ }
499+ DataType :: Int16 => {
500+ DictArray :: from_arrow ( array. as_dictionary :: < Int16Type > ( ) , nullable) . into_array ( )
501+ }
502+ DataType :: Int32 => {
503+ DictArray :: from_arrow ( array. as_dictionary :: < Int32Type > ( ) , nullable) . into_array ( )
504+ }
505+ DataType :: Int64 => {
506+ DictArray :: from_arrow ( array. as_dictionary :: < Int64Type > ( ) , nullable) . into_array ( )
507+ }
508+ DataType :: UInt8 => {
509+ DictArray :: from_arrow ( array. as_dictionary :: < UInt8Type > ( ) , nullable) . into_array ( )
510+ }
511+ DataType :: UInt16 => {
512+ DictArray :: from_arrow ( array. as_dictionary :: < UInt16Type > ( ) , nullable)
513+ . into_array ( )
514+ }
515+ DataType :: UInt32 => {
516+ DictArray :: from_arrow ( array. as_dictionary :: < UInt32Type > ( ) , nullable)
517+ . into_array ( )
518+ }
519+ DataType :: UInt64 => {
520+ DictArray :: from_arrow ( array. as_dictionary :: < UInt64Type > ( ) , nullable)
521+ . into_array ( )
522+ }
523+ key_dt => vortex_panic ! ( "Unsupported dictionary key type: {key_dt}" ) ,
524+ } ,
495525 dt => vortex_panic ! ( "Array encoding not implemented for Arrow data type {dt}" ) ,
496526 }
497527 }
0 commit comments