dwsmith1983 commented on code in PR #25657:
URL: https://github.com/apache/datafusion/pull/25657#discussion_r4123979282
##########
datafusion/physical-plan/src/topk/mod.rs:
##########
@@ -393,20 +393,10 @@ impl TopK {
/// Insert `batch`, remembering if any of its values are among
/// the top k seen so far.
- #[expect(clippy::needless_pass_by_value)]
pub fn insert_batch(&mut self, batch: RecordBatch) -> Result<()> {
// Updates on drop
- let baseline = self.metrics.baseline.clone();
- let _timer = baseline.elapsed_compute().timer();
-
- let mut sort_keys: Vec<ArrayRef> = self
- .expr
- .iter()
- .map(|expr| {
- let value = expr.expr.evaluate(&batch)?;
- value.into_array(batch.num_rows())
- })
- .collect::<Result<Vec<_>>>()?;
+ let elapsed_compute = self.metrics.baseline.elapsed_compute().clone();
Review Comment:
Done in 2c25298dc: PartitionedTopKRank and PartitionedTopKDenseRank now take
the same elapsed_compute handle as the other two insert paths. Also merged main.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]