Skip to content

Commit

Permalink
chore: cleanup to remove unnecessary reservation management steps
Browse files Browse the repository at this point in the history
  • Loading branch information
wiedld committed Jul 10, 2024
1 parent eaa5925 commit 6ce964e
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions datafusion/core/src/datasource/file_format/parquet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -762,7 +762,6 @@ impl DataSink for ParquetSink {
.close()
.await
.map_err(DataFusionError::ParquetError)?;
drop(reservation);
Ok((path, file_metadata))
});
} else {
Expand Down Expand Up @@ -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()?);
}

Expand Down Expand Up @@ -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
}
Expand Down

0 comments on commit 6ce964e

Please sign in to comment.