ClickHouse / dbt-clickhouse

The Clickhouse plugin for dbt (data build tool)
Apache License 2.0
257 stars 114 forks source link

fix: use correct schema for MV target tables #244

Closed SoryRawyer closed 10 months ago

SoryRawyer commented 10 months ago

Summary

The existing implementation of materialized views had one case where the target relation name was passed as a string of just the table name, instead of the full relation object. This meant that any custom schema would not be included in the final DDL statement, and the MV would break as it would try to write to a target table that didn't exist. This change passes the full relation object when getting the "create materialized view" SQL, which in turn provides the full path to the table in every case.

Checklist

Delete items not relevant to your PR:

SoryRawyer commented 10 months ago

Hey @BentsiLeviav, let me know if there's anything I can help out with on this PR! I looked at the failing test and it doesn't seem to be related to my changes. Everything ran successfully locally on my end.

BentsiLeviav commented 10 months ago

Hi @SoryRawyer I'll give it a look. I want to run the tests locally on my end to make sure everything is ok. will update here.

bmtcril commented 10 months ago

@BentsiLeviav we've been waiting on this fix, is there anything left to do here? I don't think @SoryRawyer can merge this.