mirror of
https://github.com/apache/superset.git
synced 2026-06-09 01:29:18 +00:00
In subquery use alias to do 'order by' (#795)
* in subqry add orderby metric to select * add comment
This commit is contained in:
committed by
Maxime Beauchemin
parent
9cdd289081
commit
19f5371787
@@ -728,6 +728,9 @@ class SqlaTable(Model, Queryable, AuditMixinNullable):
|
||||
qry = qry.limit(row_limit)
|
||||
|
||||
if timeseries_limit and groupby:
|
||||
# some sql dialects require for order by expressions
|
||||
# to also be in the select clause
|
||||
inner_select_exprs += [main_metric_expr]
|
||||
subq = select(inner_select_exprs)
|
||||
subq = subq.select_from(tbl)
|
||||
subq = subq.where(and_(*(where_clause_and + inner_time_filter)))
|
||||
|
||||
Reference in New Issue
Block a user