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

TableScan plan without projection is not converted correctly to a sql statement #11743

Closed
LatrecheYasser opened this issue Jul 31, 2024 · 0 comments · Fixed by #11744
Closed
Labels
bug Something isn't working

Comments

@LatrecheYasser
Copy link
Contributor

LatrecheYasser commented Jul 31, 2024

Describe the bug

when converting a plan that contains a table scan without a projection like this

TableScan: table

to a sql using plan_to_sql, it gives a wrong select statement

SELECT FROM table

where the * is missing.

To Reproduce

you can reproduce it by simply running

 let schema = Schema::new(vec![
            Field::new("id", DataType::Utf8, false),
            Field::new("value", DataType::Utf8, false),
 ]);

 let plan = table_scan(Some('table'), &schema, None)
                 .unwrap()
                 .build()
                 .unwrap();
 let sql = plan_to_sql(&plan).unwrap();
// sql will be set to `SELECT FROM table`

Expected behavior

when a plan doesn't have a projection node, the SQL query should look like
SELECT * FROM table

Additional context

No response

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
1 participant