dbt-labs / dbt-labs/metricflow
Enable raw (not aggregated) denormalization queries
- Dominant language
- Python
- Stars
- 1.8k
- Forks
- 202
- Avg merge
- 1d 8h
- Merged PRs (30d)
- 14
Description
**Describe the Feature**
Sometimes people want to run a query that uses all of the semantics defined in a metricflow model in order to produce a denormalized dataset for downstream use as inputs to ad hoc analysis and other such things.
Metricflow today only accepts metric queries, which fundamentally require aggregation, and as such would not be suitable for this use case. We can extend support by doing the following:
1. Allow for queries against data sources rather than metrics
2. Enable referencing measure columns directly in queries
3. Produce output datasets that represent denormalized joins. This should almost certainly be for materialization only.
The specifics of the query interfaces and how different pieces of the model fit together are TBD and would require a fair bit of design work, as we are effectively exposing a public API to output column sets. There are also some subtle considerations around execution order, as un-aggregated measures are not fully accounted for in the model language. For example, if a constrained measure is part of the requested materialization, how do we represent the constraint and ensure it gets applied correctly? That constraint happens after the dimensional join as part of the aggregation step, but what do we store in the constrained measure column if we don't aggregate, and how do we name it?
Contributor guide
Assessment
This issue has not been assessed yet.