@@ -474,10 +474,15 @@ mod tests {
474474 let metrics = SpillMetrics :: new ( & ExecutionPlanMetricsSet :: new ( ) , 0 ) ;
475475 let spill_manager = SpillManager :: new ( env, metrics, Arc :: clone ( & schema) ) ;
476476
477- let spill_file = spill_manager
478- . spill_record_batch_by_size ( & batch1, "Test Spill" , 1 ) ?
477+ let ( spill_file, max_batch_mem) = spill_manager
478+ . spill_record_batch_by_size_and_return_max_batch_memory (
479+ & batch1,
480+ "Test Spill" ,
481+ 1 ,
482+ ) ?
479483 . unwrap ( ) ;
480484 assert ! ( spill_file. path( ) . exists( ) ) ;
485+ assert ! ( max_batch_mem > 0 ) ;
481486
482487 let stream = spill_manager. read_spill_as_stream ( spill_file) ?;
483488 assert_eq ! ( stream. schema( ) , schema) ;
@@ -850,16 +855,20 @@ mod tests {
850855 let completed_file = spill_manager. spill_record_batch_and_finish ( & [ ] , "Test" ) ?;
851856 assert ! ( completed_file. is_none( ) ) ;
852857
853- // Test write empty batch with interface `spill_record_batch_by_size ()`
858+ // Test write empty batch with interface `spill_record_batch_by_size_and_return_max_batch_memory ()`
854859 let empty_batch = RecordBatch :: try_new (
855860 Arc :: clone ( & schema) ,
856861 vec ! [
857862 Arc :: new( Int32Array :: from( Vec :: <Option <i32 >>:: new( ) ) ) ,
858863 Arc :: new( StringArray :: from( Vec :: <Option <& str >>:: new( ) ) ) ,
859864 ] ,
860865 ) ?;
861- let completed_file =
862- spill_manager. spill_record_batch_by_size ( & empty_batch, "Test" , 1 ) ?;
866+ let completed_file = spill_manager
867+ . spill_record_batch_by_size_and_return_max_batch_memory (
868+ & empty_batch,
869+ "Test" ,
870+ 1 ,
871+ ) ?;
863872 assert ! ( completed_file. is_none( ) ) ;
864873
865874 Ok ( ( ) )
0 commit comments