killme2008 opened a new issue, #4677: URL: https://github.com/apache/arrow-datafusion/issues/4677
**Describe the bug** Create a table and insert some values: ```sql CREATE TABLE integers(i INTEGER); INSERT INTO integers VALUES (0), (1), (2), (3), (4); ``` Execute following SQL: ```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: ```sql SELECT * FROM integers UNION ALL SELECT * FROM integers LIMIT 7; +-----------------------+ | i | +-----------------------+ | 0 | | 1 | | 2 | | 3 | | 4 | | 0 | | 1 | +-----------------------+ ``` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
