koriyoshi2041 opened a new pull request, #26755:
URL: https://github.com/apache/datafusion/pull/26755

   ## Which issue does this PR close?
   
   - Closes #26754.
   
   ## Rationale for this change
   
   `datafusion-cli` silently omitted later record batches from CSV, TSV, JSON, 
and NDJSON output when a bounded query returned more than `--maxrows` rows. 
Those formats are expected to print the complete result; `--maxrows` only 
limits table display.
   
   ## What changes are included in this PR?
   
   The executor now applies the collection limit only when the effective output 
format is `table`. Non-table formats collect every batch before writing, while 
table output keeps its existing bounded collection behavior.
   
   ## What is the testing strategy for this PR?
   
   Added a parameterized CLI integration test for CSV, TSV, JSON, and NDJSON. 
Each case uses two record batches and verifies that the final row is present 
despite `--maxrows 1`. Reverting the format-aware collection condition makes 
all four cases fail.
   
   Locally verified with:
   
   - `cargo test -p datafusion-cli --test cli_integration 
test_non_table_formats_ignore_maxrows`
   - `cargo clippy -p datafusion-cli --all-targets --all-features -- -D 
warnings`
   - `cargo fmt --all -- --check`
   
   ## Are there any user-facing changes?
   
   CSV, TSV, JSON, and NDJSON output now includes every result row regardless 
of `--maxrows`, matching the documented behavior. Table output is unchanged.
   


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