geoffreyclaude commented on code in PR #2521:
URL: https://github.com/apache/iceberg-rust/pull/2521#discussion_r3332717784


##########
crates/integrations/datafusion/src/physical_plan/scan.rs:
##########
@@ -237,6 +260,19 @@ async fn get_batch_stream(
     Ok(Box::pin(stream))
 }
 
+fn stream_with_baseline_metrics(
+    mut stream: Pin<Box<dyn Stream<Item = DFResult<RecordBatch>> + Send>>,
+    baseline_metrics: BaselineMetrics,
+) -> Pin<Box<dyn Stream<Item = DFResult<RecordBatch>> + Send>> {
+    futures::stream::poll_fn(move |cx| {
+        let baseline_metrics = baseline_metrics.clone();

Review Comment:
   Good catch. Removed the per-poll `clone()` in 19db703.
   
   This is cleaner and also avoids dropping a cloned `BaselineMetrics` on every 
poll, which could record `end_timestamp` earlier than intended.



-- 
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]

Reply via email to