Add support to MeltanoQuery for Filters over columns that are not selected
This is issue has been updated to reflect the decision made in the discussion in the comments.
In the current version, Filters can be added only for columns that have been selected.
WHERE clauses for columns not in the
SELECT clause is a valid and very useful option that we should support.
Update MeltanoQuery to support Filters over columns that are not selected.
When a filter is added for a column, the column is not auto-selected by the interface.
If the user does not manually select the column, that results to the filter being ignored by the back-end as, following the spec we defined in (#759 (closed)), we only add filters for selected columns/timeframes/aggregates.
For example, using
model-gitlab and the
Gitlab stats per users design:
As expected, the resulting SQL does not include a where clause:
SELECT "gitlab_stats_per_user"."project_name" "gitlab_stats_per_user.project_name", "gitlab_stats_per_user"."milestone_title" "gitlab_stats_per_user.milestone_title" FROM "gitlab_stats_per_user" "gitlab_stats_per_user" GROUP BY "gitlab_stats_per_user.project_name", "gitlab_stats_per_user.milestone_title" ORDER BY "gitlab_stats_per_user.project_name" ASC, "gitlab_stats_per_user.milestone_title" ASC LIMIT 50;
In contrast, I confirm that filters added over aggregates, properly auto-select the aggregate.