Skip to content

fix: Prevent CLI crash on wide tables#21721

Merged
comphead merged 1 commit intoapache:mainfrom
Geethapranay1:fix-cli-crash-wide-table-21709
Apr 18, 2026
Merged

fix: Prevent CLI crash on wide tables#21721
comphead merged 1 commit intoapache:mainfrom
Geethapranay1:fix-cli-crash-wide-table-21709

Conversation

@Geethapranay1
Copy link
Copy Markdown
Contributor

Which issue does this PR close?

Rationale for this change

The keep_only_maxrows function panics on wide tables, format string treats the spaces variable as an index and the new code repeats the space character directly. This prevents the format argument error.

What changes are included in this PR?

  • replaces the format string in keep_only_maxrows.
  • adds print_maxrows_limited_wide_table unit test.
  • adds test_cli_wide_result_set_no_crash integration test.
  • adds a wide result set snapshot file.

Are these changes tested?

Yes. I added unit and integration tests. The unit test passes a ten column schema to keep_only_maxrows and the integration test runs a wide query with a small row limit. These tests verify your format bug fix.

Are there any user-facing changes?

No

@Geethapranay1
Copy link
Copy Markdown
Contributor Author

Geethapranay1 commented Apr 18, 2026

@Dandandan, @comphead PR is ready for your review.

@Geethapranay1 Geethapranay1 force-pushed the fix-cli-crash-wide-table-21709 branch from 4044689 to 7cbd9a6 Compare April 18, 2026 17:36
Copy link
Copy Markdown
Contributor

@comphead comphead left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @Geethapranay1 I'm checking it on my example

@comphead
Copy link
Copy Markdown
Contributor

Okie, the test passes, nice work @Geethapranay1

Copy link
Copy Markdown
Contributor

@comphead comphead left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @Geethapranay1 I think the formatting needs to be fixed for CI

@Geethapranay1
Copy link
Copy Markdown
Contributor Author

fixing it now

@Geethapranay1 Geethapranay1 force-pushed the fix-cli-crash-wide-table-21709 branch from 7cbd9a6 to c6ac6be Compare April 18, 2026 18:40
Keep_only_maxrows panics on wide tables.
The format string treats the spaces variable as an index.
The new code repeats the space character directly.
This prevents the format argument error.

Closes apache#21709
@Geethapranay1 Geethapranay1 force-pushed the fix-cli-crash-wide-table-21709 branch from c6ac6be to 1402511 Compare April 18, 2026 18:40
@Geethapranay1
Copy link
Copy Markdown
Contributor Author

@comphead fixed the fmt!!

@comphead comphead added this pull request to the merge queue Apr 18, 2026
Merged via the queue into apache:main with commit b75df6f Apr 18, 2026
31 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Datafusion CLI crashes on large queries

2 participants