Added
- Model contract enforcement: with
contract.enforced: true, table, incremental and view builds fail when the model's columns or data types differ from the YAML definition - dbt's warnings for unsupported and unenforced constraints on contracted tables
primary_keyconstraints (column- or model-level) on contracted models automatically derive aPRIMARY KEYtable type and key columnstable_typeconfig is now case-insensitive ('duplicate','primary','unique'are all accepted)on_table_exists='swap'option for table materialization: the new table is built as<name>__dbt_tmp
and exchanged withALTER TABLE ... SWAP WITH, so a failing build leaves the existing table in place (#49)appendandmergeincremental strategies.appendis the explicit name for a plain
INSERT INTOinto a DUPLICATE KEY table.mergeupserts into a PRIMARY KEY table, built
fromunique_key, fromtable_type='PRIMARY'withkeys, or from a contract
primary_keyconstraint; an existing UNIQUE KEY table is accepted too. Neither is
supported in a configuration where the name would be misleading:appendfails on a
PRIMARY or UNIQUE KEY table, where the insert would upsert, andmergefails on any other
table type and in external catalogs.mergeraises onmerge_update_columns,
merge_exclude_columnsandincremental_predicates, which need aMERGEstatement.appendandmergecheck the existing table's key type on each incremental run, so a
table built before its key config changed fails with a pointer to--full-refresh
instead of silently appending or upserting.
Changed
incremental_strategy='default', which is also used whenincremental_strategyis not
set, will be deprecated in a future release. It is still fully supported; each run now
logs an info-level notice. Its effect depends on the table type (it upserts into PRIMARY
KEY tables and appends to DUPLICATE KEY tables), so prefermergeorappend, which
run the same SQL.- Version-gated configs now fail at compile time on StarRocks versions that don't support
them, as intended:dynamic_overwritebefore 3.4, a table or materialized view without
distributed_bybefore 3.1, anddistributed_bywithoutbucketsbefore 2.5.7.
Previously these checks never fired (see below), so such models reached StarRocks and
failed there with a database error.
Fixed
- Relations in an external catalog with a dotted (nested Iceberg) namespace, such as
bronze.nz_stats.census, render the namespace as one quoted name:
`iceberg_catalog`.`bronze.nz_stats.census`.`my_table`. The namespace was split on.
and everything after its second part was dropped, sosource()and the table
materialization's create and drop statements addressed the wrong database. Without a
catalog, a dotted schema is still read ascatalog.database, now split on the first.
only (#142). drop_schemaon a relation in an external catalog no longer fails withTypeError.- StarRocks version detection with mysql-connector-python 9.3.0 and later, where
server_versionis a read-only property.is_before_versionandcurrent_versionread
the version fromselect current_version(), stored on the connection as
starrocks_version, instead ofhandle.server_version, which held the MySQL protocol
version (8.0.33), so every version check returned false. Settingversionin
profiles.ymlno longer raisesAttributeErrorwhen the connection opens. is_before_versionandcurrent_versionopen the connection before reading the version,
so version checks also work on a thread whose connection hasn't run any SQL yet._parse_versionnow parses multi-digit version parts correctly (e.g.3.5.14,4.0.10) instead of reading single charactersincrementalmodels in an external catalog build in the model's resolved schema, astable
models do. With nodatabaseconfig they used the profile's schema, so a custom schema
(+schemaorgenerate_schema_name) was ignored while dbt reported the resolved one, and
anything that refs the model looked in the wrong schema (#132).- With
is_async: true, a submitted task whose run briefly disappears from
information_schema.task_runs(seen on 3.5 betweenPENDINGandRUNNING) no longer
counts as finished. The poller retries a missing run and fails the model if it stays
missing. Before, dbt moved on while the task was still running, so a table model could
end up empty.