ClickHouse / dbt-clickhouse

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

snapshot invalidate_hard_deletes feature #291

Open dstsimokha opened 5 months ago

dstsimokha commented 5 months ago

Is your feature request related to a problem? Please describe. invalidate_hard_deletes=True for snapshots not working with CH because of its default non-nullable column

Describe the solution you'd like dbt general default__snapshot_staging_table macro can be modified in two places by changing {{ strategy.unique_key }} to toNullable({{ strategy.unique_key }}) - in snapshotted_data and deletes_source_data CTEs

rjoelnorgren commented 3 months ago

I was able to workaround this by specifying query_settings={"join_use_nulls": 1} in the snapshot config.