Skip to content

Commit

Permalink
avoid clone
Browse files Browse the repository at this point in the history
  • Loading branch information
andygrove committed Jun 11, 2021
1 parent 2073ecb commit 1551d32
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions ballista/rust/core/src/execution_plans/shuffle_reader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@ impl ExecutionPlan for ShuffleReaderExec {
) -> Result<Pin<Box<dyn RecordBatchStream + Send + Sync>>> {
info!("ShuffleReaderExec::execute({})", partition);

let x = self.partition[partition].clone();
let result = future::join_all(x.into_iter().map(fetch_partition))
let partition_locations = &self.partition[partition];
let result = future::join_all(partition_locations.iter().map(fetch_partition))
.await
.into_iter()
.collect::<Result<Vec<_>>>()?;
Expand Down Expand Up @@ -135,10 +135,10 @@ impl ExecutionPlan for ShuffleReaderExec {
}

async fn fetch_partition(
location: PartitionLocation,
location: &PartitionLocation,
) -> Result<Pin<Box<dyn RecordBatchStream + Send + Sync>>> {
let metadata = location.executor_meta;
let partition_id = location.partition_id;
let metadata = &location.executor_meta;
let partition_id = &location.partition_id;
let mut ballista_client =
BallistaClient::try_new(metadata.host.as_str(), metadata.port as u16)
.await
Expand Down

0 comments on commit 1551d32

Please sign in to comment.