dbt-clickhouse icon indicating copy to clipboard operation
dbt-clickhouse copied to clipboard

Fix usage of make_temp_relation and make_intermediate_relation macro functions

Open koletzilla opened this issue 3 months ago • 1 comments

Describe the bug

Looks like we are using them in the same way but we should be using make_intermediate_relation for all the situations where we need intermediate tables and actually make_temp_relation for the small number of situations where we actually need temporary tables.

For example we needed to copy unit.sql here https://github.com/ClickHouse/dbt-clickhouse/pull/515#pullrequestreview-3245836795 just to be able to mark the relation as temporary, but we shouldn't need to copy it if make_temp_relation were always used to create temporary relations.

koletzilla avatar Sep 23 '25 10:09 koletzilla

Once this is fixed, we can avoid situations of incompatibilities found with recent dbt-adapters versions. For example copying unit.sql just because of this caused a new version of dbt-adapters to cause problems https://github.com/ClickHouse/dbt-clickhouse/issues/529

koletzilla avatar Sep 30 '25 11:09 koletzilla