alexanderbianchi commented on code in PR #124:
URL: 
https://github.com/apache/datafusion-iceberg/pull/124#discussion_r4637142044


##########
crates/datafusion/src/read/scan.rs:
##########
@@ -240,12 +243,32 @@ impl DataSource for IcebergDataSource {
                 task_context: &context,
             },
         )?;
+        let files_opened = MetricBuilder::new(&self.metrics)
+            .with_category(MetricCategory::Rows)
+            .counter("files_opened", partition);
+        let bytes_scanned = MetricBuilder::new(&self.metrics)
+            .with_type(MetricType::Summary)
+            .with_category(MetricCategory::Bytes)
+            .gauge("bytes_scanned", partition);
+
+        // Count tasks as the reader pulls them, including read-ahead for 
LIMIT.
+        // Update reader bytes on batches and EOF, even when no rows match.
         let stream = self
             .reader
             .clone()
-            .read(tasks)
+            .read(tasks.inspect_ok(move |_| files_opened.add(1)).boxed())

Review Comment:
   actually I think i'm going to go with this.



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