alamb commented on code in PR #11708: URL: https://github.com/apache/datafusion/pull/11708#discussion_r1698286280
########## datafusion/physical-plan/src/repartition/mod.rs: ########## @@ -256,30 +255,25 @@ impl BatchPartitioner { Box::new(std::iter::once(Ok((idx, batch)))) } BatchPartitionerState::Hash { - random_state, - exprs, + random_state: _, + exprs: _, num_partitions: partitions, - hash_buffer, + hash_buffer: _, } => { // Tracking time required for distributing indexes across output partitions let timer = self.timer.timer(); - let arrays = exprs - .iter() - .map(|expr| expr.evaluate(&batch)?.into_array(batch.num_rows())) - .collect::<Result<Vec<_>>>()?; - - hash_buffer.clear(); - hash_buffer.resize(batch.num_rows(), 0); - - create_hashes(&arrays, random_state, hash_buffer)?; - let mut indices: Vec<_> = (0..*partitions) .map(|_| UInt64Builder::with_capacity(batch.num_rows())) .collect(); - for (index, hash) in hash_buffer.iter().enumerate() { - indices[(*hash % *partitions as u64) as usize] + let hash_values = batch + .column_by_name("hash_value") Review Comment: nice -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org For additional commands, e-mail: github-h...@datafusion.apache.org