-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Fix: New Datafusion-cli streaming printing way should handle corner case for only one small batch which lines are less than max_rows #14921
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix: New Datafusion-cli streaming printing way should handle corner case for only one small batch which lines are less than max_rows #14921
Conversation
…than max_rows size
The bug which is found when i testing the following ticket: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @zhuqi-lucas
I wonder if there is any way we can write a test for this logic so we don't accidentally break it again 🤔
Thank you @alamb for review, i also add the testing case now! |
The testing include the following test, which was empty before this PR. > SELECT * FROM generate_series(1, 5) t1(v1) ORDER BY v1 DESC;
+----+
| v1 |
+----+
| 5 |
| 4 |
| 3 |
| 2 |
| 1 |
+----+
5 row(s) fetched.
Elapsed 0.003 seconds. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @zhuqi-lucas and @2010YOUY01 ❤️
…corner case for only one small batch which lines are less than max_rows (apache#14921)" This reverts commit 463ef3b.
…t, make it totally streaming printing without memory overhead (#14948) * Revert "Fix: New Datafusion-cli streaming printing way should handle corner case for only one small batch which lines are less than max_rows (#14921)" This reverts commit 463ef3b. * Revert "Datafusion-cli: Redesign the datafusion-cli execution and print, make it totally streaming printing without memory overhead (#14877)" This reverts commit 53fc94f.
Which issue does this PR close?
Rationale for this change
When we only have one batch and size < max_rows, also size < preview limit, we should collect it at the end.
What changes are included in this PR?
When we only have one batch and size < max_rows, also size < preview limit, we should collect it at the end.
Add the collect logic at the end.
Are these changes tested?
Yes
Testing result
Are there any user-facing changes?