Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
Forced LIMIT clause not being applied correctly when SQL has a trailing comment #7483
When a user submits a query that ends in a comment, Superset incorrectly appends its built-in
Ideally the limit would be added on a new line so that SQL comments cannot have any effect on it.
Superset appends the
User submits the following query (with a default LIMIT of 500 in the UI set):
SELECT y, m, d, COUNT(*) FROM some_table GROUP BY y, m, d -- uh oh a trailing comment!
Superset submits to the database engine:
SELECT y, m, d, COUNT(*) FROM some_table GROUP BY y, m, d -- uh oh a trailing comment! LIMIT 500
How to reproduce the bug
Run a query that ends in a trailing comment, such as the example user submission in the Screenshots section above.
Make sure these boxes are checked before submitting your issue - thank you!
I'm not sure if its as simple as inserting a newline here but I'm having trouble getting the tests to pass locally so I didn't want to submit a PR that I'm not confident about.