Dandandan commented on code in PR #15423: URL: https://github.com/apache/datafusion/pull/15423#discussion_r2013701354
########## datafusion/physical-plan/src/repartition/mod.rs: ########## @@ -316,6 +326,71 @@ impl BatchPartitioner { Ok((partition, batch)) }); + Box::new(it) + } + BatchPartitionerState::HashSelectVector { + random_state, + exprs, + num_partitions, + hash_buffer, + } => { + let timer = self.timer.timer(); + let arrays = exprs + .iter() + .map(|expr| expr.evaluate(&batch)?.into_array(batch.num_rows())) + .collect::<Result<Vec<_>>>()?; + + create_hashes(&arrays, random_state, hash_buffer)?; + + let hash_vector = hash_buffer + .iter() + .map(|hash| *hash % *num_partitions as u64) + .collect::<Vec<_>>(); Review Comment: You can `collect` this directly to a `BooleanArray` -- 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