rill icon indicating copy to clipboard operation
rill copied to clipboard

Feat: Supporting filtering in Component Templates

Open mindspank opened this issue 1 year ago • 7 comments

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.

mindspank avatar Aug 14 '24 07:08 mindspank

Backend implementation via https://github.com/rilldata/rill/pull/5412

mindspank avatar Aug 14 '24 07:08 mindspank

@djbarnwal : Are we ok with merging the relates PRs ?

nishantmonu51 avatar Aug 19 '24 19:08 nishantmonu51

@nishantmonu51 This is related to the new SQL filtering syntax. Don't think we have any code for this yet to merge.

mindspank avatar Aug 20 '24 12:08 mindspank

@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.

djbarnwal avatar Aug 22 '24 11:08 djbarnwal

@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.

@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.

begelundmuller avatar Aug 26 '24 17:08 begelundmuller

@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.

This should work and would be helpful.

djbarnwal avatar Aug 27 '24 10:08 djbarnwal

This should work and would be helpful.

Cool, created an issue for it here: https://github.com/rilldata/rill/issues/5542

begelundmuller avatar Aug 28 '24 11:08 begelundmuller

@djbarnwal We now support setting where and where_sql at the same time: https://github.com/rilldata/rill/pull/5569

begelundmuller avatar Aug 30 '24 13:08 begelundmuller