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


##########
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:
   What will happen for queries that return empty results?
   
   e.g.
   
   ```sql
   select * from table where 1=0
   ```
   
   Will this print nothing at all, not even the table outline?



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