kamcheungting-db commented on code in PR #589:
URL: https://github.com/apache/iceberg-cpp/pull/589#discussion_r3179690558


##########
src/iceberg/table_scan.cc:
##########
@@ -533,7 +542,75 @@ Result<std::vector<std::shared_ptr<FileScanTask>>> 
DataTableScan::PlanFiles() co
   if (context_.ignore_residuals) {
     manifest_group->IgnoreResiduals();
   }
-  return manifest_group->PlanFiles();
+
+  ICEBERG_ASSIGN_OR_RAISE(auto tasks, manifest_group->PlanFiles());
+
+  // Report scan metrics if a reporter is configured
+  if (context_.reporter) {
+    auto scan_end = std::chrono::steady_clock::now();
+    auto duration = std::chrono::duration_cast<DurationNs>(scan_end - 
scan_start);
+
+    ScanReport report;
+    report.table_name = context_.table_name;
+    report.snapshot_id = snapshot->snapshot_id;
+    report.schema_id = schema_ ? schema_->schema_id() : kInvalidSchemaId;
+    if (context_.filter) {
+      report.filter = context_.filter;
+    }
+    report.scan_metrics.total_planning_duration = duration;
+
+    // Manifest counts from ManifestGroup counters
+    const auto& counters = manifest_group->scan_counters();
+    report.scan_metrics.total_data_manifests =
+        static_cast<int64_t>(data_manifests.size());
+    report.scan_metrics.total_delete_manifests =
+        static_cast<int64_t>(delete_manifests.size());

Review Comment:
   if the source of the data are not int64_t, why do we declare them as int64_t 
?
   It looke like unnecessary type casting?



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