Skip to content

datafusion-cli regression: explain plan output looks bad (error rendering multi-lines) #14947

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

Closed
Tracked by #14123
alamb opened this issue Feb 28, 2025 · 3 comments · Fixed by #14948
Closed
Tracked by #14123

datafusion-cli regression: explain plan output looks bad (error rendering multi-lines) #14947

alamb opened this issue Feb 28, 2025 · 3 comments · Fixed by #14948
Labels
bug Something isn't working regression Something that used to work no longer does

Comments

@alamb
Copy link
Contributor

alamb commented Feb 28, 2025

Describe the bug

Explain plans look good in DataFusion 45:

DataFusion CLI v45.0.0
> create table foo(x int, y int) as values (1,2), (3,4);
0 row(s) fetched.
Elapsed 0.007 seconds.

> explain select * from foo where x = 4;
+---------------+---------------------------------------------------+
| plan_type     | plan                                              |
+---------------+---------------------------------------------------+
| logical_plan  | Filter: foo.x = Int32(4)                          |
|               |   TableScan: foo projection=[x, y]                |
| physical_plan | CoalesceBatchesExec: target_batch_size=8192       |
|               |   FilterExec: x@0 = 4                             |
|               |     MemoryExec: partitions=1, partition_sizes=[1] |
|               |                                                   |
+---------------+---------------------------------------------------+
2 row(s) fetched.
Elapsed 0.005 seconds.

However, they look really bad on main (aka pre-release DataFusion 46):

> create table foo(x int, y int) as values (1,2), (3,4);
0 row(s) fetched.
Elapsed 0.018 seconds.

> explain select * from foo where x = 4;
+---------------+--------------------------------------------------------------------------------------------------------------------------+
| plan_type     | plan                                                                                                                     |
+---------------+--------------------------------------------------------------------------------------------------------------------------+
| logical_plan  | Filter: foo.x = Int32(4)
  TableScan: foo projection=[x, y]                                                              |
| physical_plan | CoalesceBatchesExec: target_batch_size=8192
  FilterExec: x@0 = 4
    DataSourceExec: partitions=1, partition_sizes=[1]
 |
+---------------+--------------------------------------------------------------------------------------------------------------------------+
2 row(s) fetched.
Elapsed 0.013 seconds.

To Reproduce

create table foo(x int, y int) as values (1,2), (3,4);
explain select * from foo where x = 4;

Expected behavior

I expect the cells to be correctly rendered like in DataFUsion 45

Additional context

This appears to be another issue introduced by

@alamb
Copy link
Contributor Author

alamb commented Feb 28, 2025

I think the issue is the code added in #14877 doesn't handle single cells with multiple lines well

@alamb alamb changed the title datafusion-cli regression: explain plan output looks bad datafusion-cli regression: explain plan output looks bad (error rendering multi-lines) Feb 28, 2025
@alamb
Copy link
Contributor Author

alamb commented Feb 28, 2025

If we can't figure this out by tomorrow, I am thinking we can revert #14877. I will prepare a PR to do so as a backup

@alamb
Copy link
Contributor Author

alamb commented Feb 28, 2025

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working regression Something that used to work no longer does
Projects
None yet
1 participant