File tree Expand file tree Collapse file tree
datafusion/datasource-avro/src Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -115,14 +115,14 @@ impl AvroSource {
115115}
116116
117117fn coerce_batch_to_schema (
118- batch : RecordBatch ,
118+ batch : & RecordBatch ,
119119 target_schema : SchemaRef ,
120120) -> Result < RecordBatch > {
121121 let mut columns = Vec :: with_capacity ( target_schema. fields ( ) . len ( ) ) ;
122122 for field in target_schema. fields ( ) {
123123 let array: ArrayRef = match batch. schema ( ) . column_with_name ( field. name ( ) ) {
124124 Some ( ( idx, _) ) => {
125- let source_array = batch. column ( idx) . clone ( ) ;
125+ let source_array = Arc :: clone ( batch. column ( idx) ) ;
126126 if source_array. data_type ( ) == field. data_type ( ) {
127127 source_array
128128 } else {
@@ -255,7 +255,7 @@ mod private {
255255 . map ( move |r| {
256256 r. map_err ( Into :: into) . and_then ( |batch| {
257257 coerce_batch_to_schema (
258- batch,
258+ & batch,
259259 Arc :: clone ( & projected_file_schema) ,
260260 )
261261 } )
@@ -278,7 +278,7 @@ mod private {
278278 . map ( move |r| {
279279 r. map_err ( Into :: into) . and_then ( |batch| {
280280 coerce_batch_to_schema (
281- batch,
281+ & batch,
282282 Arc :: clone ( & projected_file_schema) ,
283283 )
284284 } )
You can’t perform that action at this time.
0 commit comments