@@ -35,12 +35,9 @@ use vortex_array::scalar::Scalar;
3535use vortex_array:: validity:: Validity ;
3636use vortex_array:: vtable:: child_to_validity;
3737use vortex_array:: vtable:: validity_to_child;
38- #[ expect(
39- deprecated,
40- reason = "TODO(aduffy): figure out what to do with Parquet Variant"
41- ) ]
42- use vortex_arrow:: ArrowArrayExecutor ;
38+ use vortex_arrow:: ArrowExportOptions ;
4339use vortex_arrow:: ArrowSession ;
40+ use vortex_arrow:: ArrowSessionExt ;
4441use vortex_arrow:: to_arrow_null_buffer;
4542use vortex_buffer:: BitBuffer ;
4643use vortex_error:: VortexExpect ;
@@ -440,19 +437,22 @@ pub trait ParquetVariantArrayExt:
440437 }
441438
442439 /// Converts this storage array to Arrow's canonical Parquet Variant extension storage.
443- #[ expect(
444- deprecated,
445- reason = "TODO(aduffy): figure out what to do with Parquet Variant"
446- ) ]
447- fn to_arrow ( & self , ctx : & mut ExecutionCtx ) -> VortexResult < ArrowVariantArray > {
440+ fn to_arrow (
441+ & self ,
442+ options : & ArrowExportOptions ,
443+ ctx : & mut ExecutionCtx ,
444+ ) -> VortexResult < ArrowVariantArray > {
445+ let session = ctx. session ( ) . clone ( ) ;
446+ let arrow = session. arrow ( ) ;
447+ let exporter = arrow. exporter ( options) ;
448448 let metadata = self . metadata ( ) ;
449449 let len = metadata. len ( ) ;
450450 let nulls = to_arrow_null_buffer ( self . parquet_variant_validity ( ) , len, ctx) ?;
451451
452452 let mut fields = Vec :: with_capacity ( 3 ) ;
453453 let mut arrays: Vec < ArrowArrayRef > = Vec :: with_capacity ( 3 ) ;
454454
455- let metadata_arrow = metadata. clone ( ) . execute_arrow ( None , ctx) ?;
455+ let metadata_arrow = exporter . execute_arrow ( metadata. clone ( ) , None , ctx) ?;
456456 fields. push ( Arc :: new ( Field :: new (
457457 "metadata" ,
458458 metadata_arrow. data_type ( ) . clone ( ) ,
@@ -461,7 +461,7 @@ pub trait ParquetVariantArrayExt:
461461 arrays. push ( metadata_arrow) ;
462462
463463 if let Some ( value) = self . value ( ) {
464- let value_arrow = value. clone ( ) . execute_arrow ( None , ctx) ?;
464+ let value_arrow = exporter . execute_arrow ( value. clone ( ) , None , ctx) ?;
465465 fields. push ( Arc :: new ( Field :: new (
466466 "value" ,
467467 value_arrow. data_type ( ) . clone ( ) ,
@@ -471,7 +471,7 @@ pub trait ParquetVariantArrayExt:
471471 }
472472
473473 if let Some ( typed_value) = self . typed_value ( ) {
474- let tv_arrow = typed_value. clone ( ) . execute_arrow ( None , ctx) ?;
474+ let tv_arrow = exporter . execute_arrow ( typed_value. clone ( ) , None , ctx) ?;
475475 fields. push ( Arc :: new ( Field :: new (
476476 "typed_value" ,
477477 tv_arrow. data_type ( ) . clone ( ) ,
@@ -518,6 +518,7 @@ mod tests {
518518 use vortex_array:: dtype:: DType ;
519519 use vortex_array:: dtype:: Nullability ;
520520 use vortex_array:: validity:: Validity ;
521+ use vortex_arrow:: ArrowExportOptions ;
521522 use vortex_arrow:: ArrowSessionExt ;
522523 use vortex_buffer:: buffer;
523524 use vortex_error:: VortexResult ;
@@ -543,7 +544,7 @@ mod tests {
543544 . ok_or_else ( || vortex_err ! ( "expected parquet variant child" ) ) ?;
544545
545546 let mut ctx = SESSION . create_execution_ctx ( ) ;
546- let roundtripped = inner. to_arrow ( & mut ctx) ?;
547+ let roundtripped = inner. to_arrow ( & ArrowExportOptions :: default ( ) , & mut ctx) ?;
547548 let roundtripped = roundtripped. inner ( ) ;
548549
549550 assert_eq ! ( struct_array. len( ) , roundtripped. len( ) ) ;
@@ -651,7 +652,7 @@ mod tests {
651652 let pv_array = ParquetVariant :: try_new ( Validity :: NonNullable , metadata, Some ( value) , None ) ?;
652653
653654 let mut ctx = SESSION . create_execution_ctx ( ) ;
654- let variant_arr = pv_array. to_arrow ( & mut ctx) ?;
655+ let variant_arr = pv_array. to_arrow ( & ArrowExportOptions :: default ( ) , & mut ctx) ?;
655656 let struct_arr = variant_arr. inner ( ) ;
656657
657658 assert_eq ! ( struct_arr. num_columns( ) , 2 ) ;
@@ -673,7 +674,7 @@ mod tests {
673674 ) ?;
674675
675676 let mut ctx = SESSION . create_execution_ctx ( ) ;
676- let variant_arr = pv_array. to_arrow ( & mut ctx) ?;
677+ let variant_arr = pv_array. to_arrow ( & ArrowExportOptions :: default ( ) , & mut ctx) ?;
677678 let struct_arr = variant_arr. inner ( ) ;
678679
679680 assert_eq ! ( struct_arr. num_columns( ) , 3 ) ;
@@ -760,7 +761,7 @@ mod tests {
760761 assert ! ( parquet_array. typed_value( ) . is_some( ) ) ;
761762
762763 let mut ctx = SESSION . create_execution_ctx ( ) ;
763- let roundtripped = parquet_array. to_arrow ( & mut ctx) ?;
764+ let roundtripped = parquet_array. to_arrow ( & ArrowExportOptions :: default ( ) , & mut ctx) ?;
764765 let roundtripped = roundtripped. inner ( ) ;
765766 assert_eq ! (
766767 roundtripped. column_names( ) ,
0 commit comments