crepererum commented on code in PR #8895:
URL: https://github.com/apache/arrow-datafusion/pull/8895#discussion_r1457179034


##########
datafusion-cli/src/print_format.rs:
##########
@@ -161,23 +161,29 @@ impl PrintFormat {
         maxrows: MaxRows,
         with_header: bool,
     ) -> Result<()> {
-        if batches.is_empty() || batches[0].num_rows() == 0 {
+        // filter out any empty batches
+        let batches: Vec<_> = batches
+            .iter()
+            .filter(|b| b.num_rows() > 0)
+            .cloned()
+            .collect();
+        if batches.is_empty() {

Review Comment:
   > Will this print nothing at all, not even the table outline?
   
   Right, it will NOT print the outline / header. Also see 
https://github.com/apache/arrow-datafusion/pull/8895#discussion_r1455440663 , 
i.e. I also find this rather confusing. However this PR here just fixes the 
status quo to not swallow the output for aggregates. I personally think we 
should change the behavior in a follow-up to at least print the table outline / 
header even for empty results.



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

Reply via email to