@@ -456,6 +456,14 @@ impl TryFrom<&FFI_ArrowSchema> for DataType {
456456 let c_child = c_schema. child ( 0 ) ;
457457 DataType :: LargeList ( Arc :: new ( Field :: try_from ( c_child) ?) )
458458 }
459+ "+vl" => {
460+ let c_child = c_schema. child ( 0 ) ;
461+ DataType :: ListView ( Arc :: new ( Field :: try_from ( c_child) ?) )
462+ }
463+ "+vL" => {
464+ let c_child = c_schema. child ( 0 ) ;
465+ DataType :: LargeListView ( Arc :: new ( Field :: try_from ( c_child) ?) )
466+ }
459467 "+s" => {
460468 let fields = c_schema. children ( ) . map ( Field :: try_from) ;
461469 DataType :: Struct ( fields. collect :: < Result < _ , ArrowError > > ( ) ?)
@@ -657,6 +665,8 @@ impl TryFrom<&DataType> for FFI_ArrowSchema {
657665 let children = match dtype {
658666 DataType :: List ( child)
659667 | DataType :: LargeList ( child)
668+ | DataType :: ListView ( child)
669+ | DataType :: LargeListView ( child)
660670 | DataType :: FixedSizeList ( child, _)
661671 | DataType :: Map ( child, _) => {
662672 vec ! [ FFI_ArrowSchema :: try_from( child. as_ref( ) ) ?]
@@ -746,6 +756,8 @@ fn get_format_string(dtype: &DataType) -> Result<Cow<'static, str>, ArrowError>
746756 DataType :: Interval ( IntervalUnit :: MonthDayNano ) => Ok ( "tin" . into ( ) ) ,
747757 DataType :: List ( _) => Ok ( "+l" . into ( ) ) ,
748758 DataType :: LargeList ( _) => Ok ( "+L" . into ( ) ) ,
759+ DataType :: ListView ( _) => Ok ( "+vl" . into ( ) ) ,
760+ DataType :: LargeListView ( _) => Ok ( "+vL" . into ( ) ) ,
749761 DataType :: Struct ( _) => Ok ( "+s" . into ( ) ) ,
750762 DataType :: Map ( _, _) => Ok ( "+m" . into ( ) ) ,
751763 DataType :: RunEndEncoded ( _, _) => Ok ( "+r" . into ( ) ) ,
@@ -874,6 +886,16 @@ mod tests {
874886 DataType :: Int16 ,
875887 false ,
876888 ) ) ) ) ;
889+ round_trip_type ( DataType :: ListView ( Arc :: new ( Field :: new (
890+ "a" ,
891+ DataType :: Int16 ,
892+ false ,
893+ ) ) ) ) ;
894+ round_trip_type ( DataType :: LargeListView ( Arc :: new ( Field :: new (
895+ "a" ,
896+ DataType :: Int16 ,
897+ false ,
898+ ) ) ) ) ;
877899 round_trip_type ( DataType :: Struct ( Fields :: from ( vec ! [ Field :: new(
878900 "a" ,
879901 DataType :: Utf8 ,
0 commit comments