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


##########
crates/datafusion/src/read/file_scan_task_provider/eager.rs:
##########
@@ -97,8 +99,10 @@ impl FileScanTaskProvider for EagerFileScanTaskProvider {
             rows.checked_add(usize::try_from(task.record_count()?).ok()?)
         });
         // Predicates and deletes may reduce a positive count, but cannot add 
rows.
+        let exact = groups.iter().flatten().all(returns_every_record);

Review Comment:
   Small, non-blocking nit: I'd inline 
`groups.iter().flatten().all(returns_every_record)` in the match guard. That 
keeps the reason for `Exact` next to the result and skips the second pass when 
the count is zero or unknown.
   



##########
crates/datafusion/src/read/file_scan_task_provider/eager.rs:
##########
@@ -97,8 +99,10 @@ impl FileScanTaskProvider for EagerFileScanTaskProvider {
             rows.checked_add(usize::try_from(task.record_count()?).ok()?)
         });
         // Predicates and deletes may reduce a positive count, but cannot add 
rows.
+        let exact = groups.iter().flatten().all(returns_every_record);

Review Comment:
   style nit: Rather then hanging this bool, we could do
   ```rust
   let num_rows = match rows {
       Some(0) => Precision::Exact(0),
       Some(n) if groups.iter().flatten().all(returns_every_record) => 
Precision::Exact(n),
       Some(n) => Precision::Inexact(n),
       None => Precision::Absent,
   };
   ```
   That keeps the reason for Exact next to the result and skips the second pass 
when the count is zero or unknown.



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