Unneccessary Group BY Clause added to query; Missing Order by Clause #18319
Replies: 2 comments
-
Hi @kevin-struckhoff. The Line Chart is a time-series chart, this means that there is always a time column in the query, in the other words, the data always is aggregated by time-column and other selected columns (group by control in this chart) and you need to define how to aggregate for column in the Metrics, your SQL seems that did not define aggregate for columns. |
Beta Was this translation helpful? Give feedback.
-
And SORT BY option is used only to decide the top N series values, when you add a GROUP BY column and set SERIES LIMIT. |
Beta Was this translation helpful? Give feedback.
-
Superset is adding a Group by clause to the SQL query where none is specified in the line chart setup screen. It also does not include the sort by column which was specified, which may be a separate issue altogether.
Since the dataset does not require grouping by date, there is no need for a group by clause.
How to reproduce the bug
If I select the metrics which are summed, for example sum(num_steps), then set the Group By column, it will run, but it also adds an extra _timestamp column to the query (which is not even my dataset to begin with) and doesn't chart correctly since 2 date/time columns are listed in the query instead of just the one I specified.
Environment
1.2
on CentOS 83.8
on CentOS 8Beta Was this translation helpful? Give feedback.
All reactions