comphead commented on code in PR #1730:
URL: https://github.com/apache/datafusion-comet/pull/1730#discussion_r2085773798
##########
native/core/src/execution/shuffle/shuffle_writer.rs:
##########
@@ -650,96 +653,97 @@ impl ShufflePartitioner for
MultiPartitionShuffleRepartitioner {
/// This function will slice input batch according to configured batch
size and then
/// shuffle rows into corresponding partition buffer.
async fn insert_batch(&mut self, batch: RecordBatch) -> Result<()> {
- let _ = TraceGuard::new("insert_batch", self.tracing_enabled);
- let start_time = Instant::now();
- let mut start = 0;
- while start < batch.num_rows() {
- let end = (start + self.batch_size).min(batch.num_rows());
- let batch = batch.slice(start, end - start);
- self.partitioning_batch(batch).await?;
- start = end;
- }
- self.metrics.input_batches.add(1);
- self.metrics
- .baseline
- .elapsed_compute()
- .add_duration(start_time.elapsed());
- Ok(())
+ with_trace_async("shuffle_insert_batch", self.tracing_enabled, ||
async {
+ let start_time = Instant::now();
+ let mut start = 0;
+ while start < batch.num_rows() {
+ let end = (start + self.batch_size).min(batch.num_rows());
+ let batch = batch.slice(start, end - start);
+ self.partitioning_batch(batch).await?;
+ start = end;
+ }
+ self.metrics.input_batches.add(1);
+ self.metrics
+ .baseline
+ .elapsed_compute()
+ .add_duration(start_time.elapsed());
+ Ok(())
+ })
+ .await
}
/// Writes buffered shuffled record batches into Arrow IPC bytes.
async fn shuffle_write(&mut self) -> Result<()> {
- let _ = TraceGuard::new("shuffle_write", self.tracing_enabled);
+ with_trace("shuffle_write", self.tracing_enabled, || {
Review Comment:
```suggestion
with_trace_async("shuffle_write", self.tracing_enabled, || {
```
?
--
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]