What's Changed
Improvements
- Without a
unique_key, the default incremental strategy is nowappend, so such models now fail if they setincremental_predicates.appendalso replacesinserts_only, which is now deprecated and logs a warning that fails runs under--warn-error(#802) by @canbekley - Support dbt functions (UDFs) as ClickHouse SQL UDFs, both scalar and aggregate. See the ClickHouse notes (#809) by @canbekley
persist_docsnow warns about columns documented in the schema yml that do not exist in the relation (#798) by @koletzilla- SQL statements are now logged with dbt's standard
SQLQueryandSQLQueryStatusdebug events, including the ClickHouse query ID, so log consumers anddbtRunnercallbacks see them as for other adapters (#807) by @canbekley dbt-coreis now capped at<2.0, anddbt-commonandagateare declared as direct dependencies, matching dbt-labs adapters (#776) by @canbekley
Bugs
- An
incrementalmodel with an explicitlegacy,delete+insertormicrobatchstrategy and nounique_keynow fails with a clear error instead of silently appending. Strategy validation now runs on the first build, not only on incremental runs (#802) by @canbekley - Fix microbatch models failing when
event_timeis aDateorDate32column. Batches now always use dbt's UTC boundaries, so on servers not running in UTC the batch windows ofDateTimecolumns shift accordingly (#759) by @DG47 - Fix
insert_overwriteoccasionally skipping partitions on ClickHouse Cloud when the partition probe landed on a replica that had not yet synced the staging insert. The partitions are now read from the staging table itself, which honours the connection'sselect_sequential_consistency, instead of fromsystem.parts(#786) by @tjb9dc - Distributed models no longer fail with
cluster setting in dbt profile must be seton aReplicateddatabase (database_engine: Replicatedwithclusterset in the profile) (#769) by @DG47 distributed_incrementalno longer creates a temporary view to read the model's structure; it is taken from the model query, which the materialization already had. Every run used to leave the view behind, and the run no longer touches that name at all, so a<model>__dbt_view_tmpleft by an earlier version has to be dropped once by hand (#754) by @Romano-arist- Apply a materialized view model's
query_settingsto the view's own query, not only to the initial fill of the target table, so later inserts and refreshes no longer run under the server defaults. Existing views pick up the clause on the nextdbt run, which already reissues the view query (#755) by @DG47 - Prevent refreshable materialized views from racing or duplicating their initial population. With
catchup=True(the default) the catchup now runs before the view is created and the view is created withEMPTY, so only dbt loads the initial data; withcatchup=FalseClickHouse keeps running the initial refresh as before (#750) by @koletzilla - Multi-view materialized view models can now select from ephemeral models when no view has its own
WITHclause; otherwise, a view that selects from an ephemeral model raises an error that points to explicit target mode (#768) by @DG47 - Dictionaries on ClickHouse Cloud (
database_engine: Shared) are now created withSETTINGS(select_sequential_consistency = 1). Cloud loads dictionaries eagerly on every replica, and a replica that had not yet seen the latest parts of the source table loaded an empty or stale dictionary until its nextLIFETIMErefresh (#800) by @koletzilla - Fix snapshots with a list
unique_key(e.g.unique_key=['date', 'team_id']). The key columns were rendered as a single array literal, so every snapshot run joined all rows against all rows and inserted spurious records (#751) by @DG47 dbt cloneno longer creates empty tables when aclusteris set, or fails in aReplicateddatabase.CLONE ASsupports neither, so these tables are now cloned withCREATE TABLE ... ASandALTER TABLE ... ATTACH PARTITION ALL FROM(#816) by @canbekley- Fix contract enforcement failing for
FixedString(N)columns: the rendered data type collapsed toString, which no longer matches aFixedString(N)contract declaration (#727) by @bartcode - The native driver no longer sends the HTTP
session_idparameter as a query setting. ClickHouse does not know that setting and logged anUnknown settingswarning for every query (#762) by @Pintouch - Fix
tcp_keepalivefailing profile validation when given explicit[idle, interval, probes]values, which lefttrue(and its 7200s kernel default idle time) as the only usable setting (#735) by @thiagopena - Reading and enabling
allow_nondeterministic_mutationsat connect time now retries transient errors (#720) by @koletzilla
Repository maintenance
- The shard-local table name of distributed materializations is now resolved in one place,
clickhouse_local_relation, instead of being rebuilt inline in each materialization and incremental strategy (#753) by @Romano-arist - Macros aligned with the ClickHouse adapter in dbt Core v2 so both engines can share the same macro files. Results are unchanged on dbt Core 1.x (#797) by @koletzilla
- Integration tests now run in parallel with
pytest-xdist, in CI and locally (see CONTRIBUTING.md). Each test class gets a worker-unique schema, and the grants anddbt_clonetests create their own short-lived users instead of sharing session-wide ones (#720) by @koletzilla - Update the ClickHouse versions used for testing to the ones with active security support per the ClickHouse security policy: drop 25.8, 26.4 and 26.5, add 26.8, 26.9 and 26.10. The documented minimum tested version is now 26.3 (#782) by @koletzilla
New Contributors
- @DG47 made their first contribution in #751
- @thiagopena made their first contribution in #735
- @mikelewisCH made their first contribution in #758
- @Marais made their first contribution in #778
- @Pintouch made their first contribution in #762
- @tjb9dc made their first contribution in #786
Full Changelog: v1.10.3...v1.10.4