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


##########
datafusion-cli/src/print_format.rs:
##########
@@ -161,7 +161,7 @@ impl PrintFormat {
         maxrows: MaxRows,
         with_header: bool,
     ) -> Result<()> {
-        if batches.is_empty() || batches[0].num_rows() == 0 {
+        if batches.is_empty() {

Review Comment:
   To keep the intended behavior, I think this should probably be:
   
   ```suggestion
           if batches.is_empty() || batches.iter().all(|b| b.num_rows() == 0) {
   ```
   
   However, I think the intention is wrong. We should totally print the header 
even if there's no data. This entire "don't print anything if the result is 
empty" is super confusing, at least in my opinion.



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