@@ -6,8 +6,8 @@ use arrow_array::cast::AsArray;
66use arrow_schema:: DataType ;
77use arrow_schema:: Schema ;
88use vortex_error:: VortexResult ;
9+ use vortex_session:: VortexSession ;
910
10- use crate :: LEGACY_SESSION ;
1111use crate :: VortexSessionExecute ;
1212use crate :: array:: IntoArray ;
1313use crate :: arrays:: StructArray ;
@@ -17,11 +17,12 @@ impl StructArray {
1717 pub fn into_record_batch_with_schema (
1818 self ,
1919 schema : impl AsRef < Schema > ,
20+ session : & VortexSession ,
2021 ) -> VortexResult < RecordBatch > {
2122 let data_type = DataType :: Struct ( schema. as_ref ( ) . fields . clone ( ) ) ;
2223 let array_ref = self
2324 . into_array ( )
24- . execute_arrow ( Some ( & data_type) , & mut LEGACY_SESSION . create_execution_ctx ( ) ) ?;
25+ . execute_arrow ( Some ( & data_type) , & mut session . create_execution_ctx ( ) ) ?;
2526 Ok ( RecordBatch :: from ( array_ref. as_struct ( ) ) )
2627 }
2728}
@@ -35,6 +36,7 @@ mod tests {
3536 use arrow_schema:: FieldRef ;
3637 use arrow_schema:: Schema ;
3738
39+ use crate :: LEGACY_SESSION ;
3840 use crate :: arrow:: record_batch:: StructArray ;
3941 use crate :: builders:: ArrayBuilder ;
4042 use crate :: builders:: ListBuilder ;
@@ -69,7 +71,9 @@ mod tests {
6971 DataType :: LargeListView ( FieldRef :: new( Field :: new_list_field( DataType :: Int32 , false ) ) ) ,
7072 true ,
7173 ) ] ) ) ;
72- let rb = array. into_record_batch_with_schema ( arrow_schema) . unwrap ( ) ;
74+ let rb = array
75+ . into_record_batch_with_schema ( arrow_schema, & LEGACY_SESSION )
76+ . unwrap ( ) ;
7377
7478 let xs = rb. column ( 0 ) ;
7579 assert_eq ! (
0 commit comments