dbt-labs / dbt-core

dbt enables data analysts and engineers to transform their data using the same practices that software engineers use to build applications.
https://getdbt.com
Apache License 2.0
9.79k stars 1.62k forks source link

[CT-2813] Begin compiling `filter` attrs on `Metric` nodes #8065

Closed QMalcolm closed 1 year ago

QMalcolm commented 1 year ago

Acceptance Criteria

• Complicated user defined metric filters get compiled down to the protocol definition of WhereFilters

Context

We realized recently that filters were basically unconstrained highly structured objects within the semantic layer protocols defined in dbt-semantic-interfaces. We're currently racing to resolve this issue in DSI as defined in DSI#102. We're well on our way to resolving DSI#102 and have a draft PR. In this we define a generic WhereFilterCompiler. which can compile a user specified filter down to a WhereFilter protocol implementation. Once this is merged and released (soon 🤞), we should instantiate a WhereFilterCompiler in the MetricParser and compile the filters at that time.

QMalcolm commented 1 year ago

Instead of going the DSI#102 route, we ended up going the DSI#109 route for ensuring filter structure changes in the protocol. Additionally we began supporting the change of DSI#109 in #8085. So this can be considered done 🙂