Using Date Filter in Filter Box Will Result in date always first in Query WHERE Clause
Make sure these boxes are checked before submitting your issue - thank you!
- [x ] I have checked the superset logs for python stacktraces and included it here as text if 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
Superset version
0.26.3
Expected results
WHERE clause order can be changed by manipulating the Date Filter QUERY section. Specifically should be able to position date anywhere in the WHERE clause (it is always first). This causes out queries to be very slow since it has to process date first which takes longer than processing something like Account first, then date.
Actual results
date is always first in the where clause.
WHERE eventtime >= toDateTime('2018-10-14 00:00:00') AND eventtime <= toDateTime('2018-10-17 16:19:13') AND (((lower(errorcode) like lower('%%RequestLimitExceeded%%') or lower(errormessage) like lower('Rate exceeded') or lower(errormessage) like lower('throttling'))))
Steps to reproduce
Create a Filter Box and check 'Date Filter'. Specify other filters other than date. Build a dashboard using the date Filter and observe that the date is always first in the where clause.
Is there a way to accomplish what I am after?
For example it would be fine if superset would use the order that filter boxes are placed on the dashboard, when it builds the WHERE clause.
So if I create 3 filter boxes, the first filters on 'account', the second filters on 'date' (Date FIlter checked) and the third filters on 'errorcode'; then if I add these 3 filter boxes to a dashboard then the resulting query should be like:
WHERE account == 'myaccount' AND eventdate == 'somedate' AND errorcode == 'someerror'
but I still get WHERE eventdate == 'somedate' AND account == 'myaccount' AND errorcode == 'someerror'
(i.e. date is always first)
Which database are you using? Isn't this the database's query planner's job to determine in which order to apply the predicates?
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.