@@ -320,7 +320,7 @@ impl FlightDataEncoder {
320
320
let schema = match & self . schema {
321
321
Some ( schema) => schema. clone ( ) ,
322
322
// encode the schema if this is the first time we have seen it
323
- None => self . encode_schema ( & batch. schema ( ) ) ,
323
+ None => self . encode_schema ( batch. schema_ref ( ) ) ,
324
324
} ;
325
325
326
326
// encode the batch
@@ -565,12 +565,12 @@ mod tests {
565
565
566
566
let batch = RecordBatch :: try_from_iter ( vec ! [ ( "a" , Arc :: new( c1) as ArrayRef ) ] )
567
567
. expect ( "cannot create record batch" ) ;
568
- let schema = batch. schema ( ) ;
568
+ let schema = batch. schema_ref ( ) ;
569
569
570
570
let ( _, baseline_flight_batch) = make_flight_data ( & batch, & options) ;
571
571
572
572
let big_batch = batch. slice ( 0 , batch. num_rows ( ) - 1 ) ;
573
- let optimized_big_batch = prepare_batch_for_flight ( & big_batch, Arc :: clone ( & schema) , false )
573
+ let optimized_big_batch = prepare_batch_for_flight ( & big_batch, Arc :: clone ( schema) , false )
574
574
. expect ( "failed to optimize" ) ;
575
575
let ( _, optimized_big_flight_batch) = make_flight_data ( & optimized_big_batch, & options) ;
576
576
@@ -581,7 +581,7 @@ mod tests {
581
581
582
582
let small_batch = batch. slice ( 0 , 1 ) ;
583
583
let optimized_small_batch =
584
- prepare_batch_for_flight ( & small_batch, Arc :: clone ( & schema) , false )
584
+ prepare_batch_for_flight ( & small_batch, Arc :: clone ( schema) , false )
585
585
. expect ( "failed to optimize" ) ;
586
586
let ( _, optimized_small_flight_batch) = make_flight_data ( & optimized_small_batch, & options) ;
587
587
0 commit comments