Feat: Supporting filtering in Component Templates
In our components that don't rely on a data resolver, mainly the KPI component, we should support the new filter property.
AC:
- A user can pass a filter property on the template specification.
- The filter would be the raw filter string that we pass to the aggregation api.
Backend implementation via https://github.com/rilldata/rill/pull/5412
@djbarnwal : Are we ok with merging the relates PRs ?
@nishantmonu51 This is related to the new SQL filtering syntax. Don't think we have any code for this yet to merge.
@mindspank In some cases, we can't directly pass the sql to the aggregation API. For example, for table, we have multiple queries with different filters applied. We need to merge these filters before firing a request. It would be helpful for the component parser to return a V1Expression for a filter key in the component YAML.
@mindspank In some cases, we can't directly pass the sql to the aggregation API. For example, for table, we have multiple queries with different filters applied. We need to merge these filters before firing a request. It would be helpful for the component parser to return a
V1Expressionfor afilterkey in the component YAML.
@djbarnwal What about if we supported passing both a V1Expression and a SQL filter at the same time (where and where_sql in the MetricsViewAggregation API)? The backend would then apply both filters with an AND between them.
We can also support returning a parsed V1Expression for a SQL filter, but it would probably require a separate API and network request.
@djbarnwal What about if we supported passing both a
V1Expressionand a SQL filter at the same time (whereandwhere_sqlin theMetricsViewAggregationAPI)? The backend would then apply both filters with anANDbetween them.
This should work and would be helpful.
This should work and would be helpful.
Cool, created an issue for it here: https://github.com/rilldata/rill/issues/5542
@djbarnwal We now support setting where and where_sql at the same time: https://github.com/rilldata/rill/pull/5569