From 6ce964edd5847c679148afe7adddc7c71179669b Mon Sep 17 00:00:00 2001 From: wiedld Date: Wed, 10 Jul 2024 08:46:46 -0700 Subject: [PATCH] chore: cleanup to remove unnecessary reservation management steps --- datafusion/core/src/datasource/file_format/parquet.rs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/datafusion/core/src/datasource/file_format/parquet.rs b/datafusion/core/src/datasource/file_format/parquet.rs index 557b0d5f97c5..694c94928537 100644 --- a/datafusion/core/src/datasource/file_format/parquet.rs +++ b/datafusion/core/src/datasource/file_format/parquet.rs @@ -762,7 +762,6 @@ impl DataSink for ParquetSink { .close() .await .map_err(DataFusionError::ParquetError)?; - drop(reservation); Ok((path, file_metadata)) }); } else { @@ -921,10 +920,9 @@ fn spawn_rg_join_and_finalize_task( let num_cols = column_writer_tasks.len(); let mut finalized_rg = Vec::with_capacity(num_cols); for task in column_writer_tasks.into_iter() { - let (writer, col_reservation) = task.join_unwind().await?; + let (writer, _col_reservation) = task.join_unwind().await?; let encoded_size = writer.get_estimated_total_bytes(); rg_reservation.grow(encoded_size); - drop(col_reservation); finalized_rg.push(writer.close()?); } @@ -1062,7 +1060,6 @@ async fn concatenate_parallel_row_groups( object_store_writer .write_all(buff_to_flush.as_slice()) .await?; - rg_reservation.shrink(buff_to_flush.len()); buff_to_flush.clear(); file_reservation.try_resize(buff_to_flush.len())?; // will set to zero }