-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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 #8904] Improved output of datafuson-cli with empty results #8947
Conversation
@alamb maybe you can look at it. |
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 @Tangruilin -- this is a good start
I am worried about this approach as it seems to require that a plan produce an empty RecordBatch
when it makes now rows, but I don't think they all do so (some will continue to not make any)
What would you think about changing the display logic in datafusion-cli to detect the case when there have been no record batches printed and in that case add / print an empty batch?
Perhaps changing this code:
but how can i get the rows that is selected if I change |
I also believe we should not overfit when propagating empty batches during execution. In |
could you show me the code. |
We could perhaps insert some logic here, such that if no row has been printed, an empty batch is printed. |
This is a problem that I can not get column data here. From example: |
I understand the problem now. When we don't have a record batch, we cannot infer the header columns. Nothing comes to my mind yet, but I believe we can find a better way than propagating empty batches. |
What about using You could the call https://docs.rs/datafusion/latest/datafusion/physical_plan/common/fn.collect.html if you still needed a However, it would be great if we could figure out how to print record batches for every plan (even ones that are not "streaming") as they arrive rather than neeting to collect them all together - this would take a bigger refactoring (and need some finagling for the table output |
Perhaps we can retrieve the column names from the schema of the physical plan. let schema = physical_plan.schema();
print_options.print_batches(&results, &schema, now)?; |
I may try the way this week |
Marking as draft to note this PR is not waiting on feedback anymore -- please mark it ready for review when next ready. Thanks again @Tangruilin |
How is this PR coming along? |
Yes. I will submit a PR on Sunday~~~ |
Signed-off-by: tangruilin <[email protected]>
@alamb These days are Chinese New Year. I will finish my issues after it. |
Thank you for the update and I hope your new year is everything you hope it will be 🎉 |
Thank you for your contribution. Unfortunately, this pull request is stale because it has been open 60 days with no activity. Please remove the stale label or comment or this will be closed in 7 days. |
Which issue does this PR close?
Closes #8904 .
Rationale for this change
What changes are included in this PR?
Improved output of datafuson-cli with empty results
Are these changes tested?
There is alreay tests
Are there any user-facing changes?