I’m trying to define MetricFlow semantic models built on top of materialization: ephemeral
dbt models. Getting this error from dbt parse
command when using dbt Core CLI:
node_relation -> relation_name
none is not an allowed value (type=type_error.none.not_allowed)
Changing from ephemeral to view materialization fixes this.
The semantic_model
references this like so:
semantic_models:
- name: fact_lead_stages
description: 'Lead stages table'
model: ref('fact_lead_stages')
And it’s the fact_lead_stages
model which is ephemeral.
I also tried prefixing the model and semantic model names with __dbt__cte__
like ref('__dbt__cte__fact_lead_stages')
(suggested here: Materializations | dbt Developer Hub), this just errored with:
Semantic_Model 'semantic_model.<proj_name>.fact_lead_stages' (models/fact_lead_stages.yml) depends on a node named '__dbt__cte__fact_lead_stages' which was not found
Is this not supported/not advisable? And is there a workaround to use MetricFlow metrics without adding views/tables to the DB?
Context
Don’t want to create more views or tables in this schema as it’s managed by our customer, not us. We want to define metrics over it so that business users can slice & dice with MetricFlow. Realise the performance may be slightly worse than if we used view or table materializations, but this isn’t a concern for us in this context.