Skip to content
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

Create physical plan bug: got Arrow schema with 1 and DataFusion schema with 0 #4677

Closed
killme2008 opened this issue Dec 20, 2022 · 1 comment · Fixed by #4753
Closed

Create physical plan bug: got Arrow schema with 1 and DataFusion schema with 0 #4677

killme2008 opened this issue Dec 20, 2022 · 1 comment · Fixed by #4753
Labels
bug Something isn't working

Comments

@killme2008
Copy link

killme2008 commented Dec 20, 2022

Describe the bug

Create a table and insert some values:

CREATE TABLE integers(i INTEGER);

INSERT INTO integers VALUES (0), (1), (2), (3), (4);

Execute following SQL:

SELECT COUNT(*) FROM (SELECT * FROM integers UNION ALL SELECT * FROM integers LIMIT 7) tbl;

Report error from datafusion:

create_physical_expr expected same number of fields, got got Arrow schema with 1  and DataFusion schema with 0. 
This was likely caused by a bug in DataFusion’s code and we would welcome that you file an bug report
 in our issue tracker

The subquery works:

SELECT * FROM integers UNION ALL SELECT * FROM integers LIMIT 7;

+-----------------------+
| i |
+-----------------------+
| 0                     |
| 1                     |
| 2                     |
| 3                     |
| 4                     |
| 0                     |
| 1                     |
+-----------------------+
@killme2008 killme2008 added the bug Something isn't working label Dec 20, 2022
@HaoYang670
Copy link
Contributor

HaoYang670 commented Dec 27, 2022

It seems that there is a bug in the PushDownProjection.

It seems that the PushDownProjection rewrites the schema of Union but this schema is ignored when generating physical plan.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants