eugeniamz opened a new issue #12850:
URL: https://github.com/apache/superset/issues/12850
When creating a bar chart with the source database Presto / Athena, the SQL
does not include ORDER BY with LIMIT rows. Not having ORDER BY with LIMIT does
not warrant that the right data is shown.
```
SELECT "country" AS "country",
sum("new_cases") AS "SUM(new_cases)"
FROM "default"."cases_ts"
GROUP BY "country"
LIMIT 100
```
<img width="1010" alt="Screen Shot 2021-01-31 at 11 09 45 AM"
src="https://user-images.githubusercontent.com/58375897/106390129-e6a88900-63b4-11eb-9886-841b55194114.png">
I tried Bar Chart with Vertica and the ORDER BY shows.
I changed the chart to Pie with Presto Datasource and the ORDER BY Also
shows
```
SELECT "country" AS "country",
sum("new_cases") AS "SUM(new_cases)"
FROM "default"."cases_ts"
GROUP BY "country"
ORDER BY "SUM(new_cases)" DESC
LIMIT 100
```
<img width="1101" alt="Screen Shot 2021-01-31 at 11 07 58 AM"
src="https://user-images.githubusercontent.com/58375897/106390100-c4af0680-63b4-11eb-852b-a8fb6a659833.png">
#### How to reproduce the bug
1. Go to - Chart and select a datasource that is from Presto query engine
and chart type ```bar chart```. Review query and query won't have the order by
2. Change the chart type to ```Pie```, review the query and it will include
the ORDER BY
### Environment
Superset 1.0
Make sure to follow these steps before submitting your issue - thank you!
- [ ] I have checked the superset logs for python stacktraces and included
it here as text if there are any.
- [ X] I have reproduced the issue with at least the latest released version
of superset.
- [ X] I have checked the issue tracker for the same issue and I haven't
found one similar.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]