Open rightx2 opened 4 months ago
AFAIK there isn't a way to do this in dbt-clickhouse yet -- I was thinking that one solution could be to add some kind of flag in the config like create_target_table
, so that only one of the MVs will create the target table
Other relevant issue: https://github.com/ClickHouse/dbt-clickhouse/issues/280
I was exploring this today, I've come up with a proposal which I think is fairly easy to implement. I will hopefully make a PR tomorrow to demonstrate it clearly. I would appreciate your thoughts on this idea. #280
Is your feature request related to a problem? Please describe. When I defiend materialized_view like below,
I understood it created agg_pv table and agg_pv_mv view and I can query like below
but I'd like to do more:
agg_pv
,agg_pv_local
would be created. Related issue is https://github.com/ClickHouse/dbt-clickhouse/issues/302 and it closed as completed, but I can't fully understand how the answer work:SELECT * FROM clusterAllReplicas('cluster_name', {{ ref('local_table') }}) SETTINGS final = 1
A --> target_t_mv --> target_t (distributed) B --> target_t_mv --> target_t (distributed)