-
Add
strict_modeto enforce production-ready cluster and schema isolation rules, and improve cluster health monitoring (#34538). -
Fix unit test failures in dbt-core by adding support for the
column_name_to_quotedparameter in the unit test materialization. This parameter is required for handling of quoted column identifiers in unit tests (dbt-adapters#292d173).
- Add support for
retain_historyconfiguration in materialized views, allowing users to specify how long to retain historical data (e.g.retain_history: '1hr').
- Fix copying default privileges in blue/green deployments when the
grantee is
PUBLIC.
- Fix a bug in the
truncate_relation_sqlmacro where specifying a cluster for seeds wasn't respecting custom cluster naming logic from user-definedgenerate_cluster_namemacros.
- Fix schema tagging to work with current transaction limitations.
- Fix a bug in the
deploy_initmacro where source cluster validation wasn't respecting custom cluster naming logic from user-definedgenerate_cluster_namemacros.
- Upgrade to
dbt-postgresv1.9.0.
-
Enable the
clusterconfiguration for seeds, which allows specifying a target cluster fordbt seedto run against (which is required for specific seed operations).# dbt_project.yml seeds: +cluster: 'dbt_seed_cluster'
# /seeds/properties.yml version: 2 seeds: - name: test_29324 config: cluster: dbt_seed_cluster
-
Add a new
source_tablematerialization type, in support of an upcoming feature in Materialize (source versioning).
-
Fix a bug in the
materialize__drop_relationmacro that prevented using the--full-refreshflag (or thefull_refreshconfiguration) withdbt seed. -
Fix a bug that would prevent
dbt seedfrom succeeding on subsequent runs without a valid default cluster. It's important to note that this scenario will still fail if no cluster is specified for the target inprofiles.ymland the default cluster for the user is invalid (or intentionally set tomz_catalog_server, which cannot query user data). -
Produce an error message when attempting to use the
grantsconfiguration, which is not supported in the adapter. This configuration will be supported in the future (see #20244). -
Stop hardcoding
quickstartas the default cluster to fall back to when no cluster is specified. When no cluster is specified, either inprofiles.ymlor as a configuration, we should default to the default cluster configured for the connected dbt user (or, the active cluster for the connection). This will still fail if the defalt cluster for the connected user is invalid or set tomz_catalog_server(which cannot be modified).
-
Include the dbt version in the
application_nameconnection parameter #28813. -
Allow users to override the maximum lag threshold in blue/green deployment macros using the new
lag_thresholdargument.Example
dbt run-operation deploy_await --args '{lag_threshold: "5s"}' dbt run-operation deploy_promote --args '{wait: true, poll_interval: 30, lag_threshold: "5s"}'
We do not recommend changing the default value of the
lag_threshold(1s), unless prompted by the Materialize team.
-
Enable cross-database references (#27686). Although cross-database references are not supported in
dbt-postgres, databases in Materialize are purely used for namespacing, and therefore do not present the same constraint. -
Add the
create_clusteranddrop_clustermacros, which allow managing the creation and deletion of clusters in workflows requiring transient infrastructure (e.g. CI/CD).
-
Add support for sink cutover to the blue/green deployment workflow #27557. Sinks must be created in a dedicated schema and cluster.
-
Add a
dry_runargument to thedeploy_promotemacro, which allows previewing the sequence of commands that will be run as part of the environment promotion step of the blue/green deployment workflow. -
Fix the
deploy_initmacro to correctly account for scheduled clusters. Before, these clusters would be incorrectly recreated in the deployment environment with theSCHEDULEoption set tomanual(instead ofon-refresh).
- Add support for overriding the
generate_cluster_namemacro to customize the cluster name generation logic in user projects. - Stop adding aliases to subqueries when calling with
--emptyflag.
- Update base adapter references as part of
decoupling migration from dbt-core
- Migrate to dbt-common and dbt-adapters packages.
- Add tests for
--emptyflag as part of dbt-labs/dbt-core#8971 - Add functional tests for unit testing.
- Support enforcing model contracts for the
map,list, andrecordpseudo-types.
- Fix permission management in blue/green automation macros for non-admin users (#26773).
- Tweak
deploy_permission_validationmacro to work around #26738.
-
Breaking change. The
sourceandsinkmaterialization types no longer accept arbitrary SQL statements, and now accept theclusterconfiguration option. The new syntax omits theCREATE { SOURCE | SINK }clause, and requires migrating existingsourceandsinkmodels to use that syntax before upgrading.New
{{ config( materialized='source', cluster='quickstart' ) }} FROM KAFKA CONNECTION kafka_connection (TOPIC 'test-topic') FORMAT BYTESDeprecated
{{ config( materialized='source' ) }} CREATE SOURCE {{ this }} IN CLUSTER 'quickstart' FROM KAFKA CONNECTION kafka_connection (TOPIC 'test-topic') FORMAT BYTES
deploy_init(ignore_existing_objects)now automatically copies the default privileges and existing grants of existing clusters and schemas to their deployment counterparts.
-
Add macros to automate blue/green deployments, which help minimize downtime when deploying changes to the definition of objects in Materialize to production environments:
-
deploy_init(ignore_existing_objects): creates the deployment schemas and clusters using the same configuration as the corresponding production environment to swap with. -
deploy_await(poll_interval): waits for all objects within the deployment clusters to be fully hydrated, polling the cluster readiness status at a specifiedpoll_interval. -
deploy_promote: deploys the current dbt targets to the production environment, encuring all deployment targets, including schemas and clusters, are fully hydrated and deployed together as a single atomic operation. If any part of the deployment fails, the entire deployment is rolled back to maintain consistency and prevent partial updates. -
deploy_cleanup: tears down the deployment schemas and clusters.
Sample workflow
# dbt_project.yml vars: deployment: default: clusters: ["prod"] schemas: ["prod "]
dbt run-operation deploy_init dbt run --vars 'deploy: True' # deploy_await can run automatically by specifying deploy_promote # (wait=True), but we recommend running this step manually and running # validation checks before promoting. dbt run-operation deploy_await dbt run-operation deploy_promote dbt run-operation deploy_cleanup
In this version, the blue/green deployment workflow will fail if sources or sinks exist in the schemas or cluster to swap. This might change in a future release.
-
-
Revert backport of dbt-core #8887, which shipped withdbt v1.7.6. Non-standard types should just work™️ in model contracts as part of dbt core functionality.
- Support scheduled refreshes in the
materialized_viewmaterialization via the newrefresh_intervalconfiguration. This is a private preview feature in Materialize, so configuration details are likely to change in the future.
- Backport dbt-core #8887 to unblock users using any custom type with data contracts.
-
Remove the dependency of data contracts pre-flight checks on the existence of the pre-installed
defaultcluster. Fixes #23600. -
Work around dbt-core #8353 while a permanent fix doesn't land in dbt Core to unblock users using UUID types with data contracts.
-
Support specifying the materialization type used to store test failures via the new
store_failures_asconfiguration. Accepted values:materialized_view(default),view,ephemeral.- Project level
tests: my_project: +store_failures_as: view
- Model level
models: - name: my_model columns: - name: id tests: - not_null: config: store_failures_as: view - unique: config: store_failures_as: ephemeral
If both
store_failuresandstore_failures_asare specified,store_failures_astakes precedence. -
Mark
dbt source freshnessas not supported. Materialize supports the functionality required to enable column- and metadata-based source freshness checks, but the value of this feature in a real-time data warehouse is limited.
-
Support the
ASSERT NOT NULLoption formaterialized_viewmaterializations via thenot_nullcolumn-level constraint.- name: model_with_constraints config: contract: enforced: true columns: - name: col_with_constraints data_type: string constraints: - type: not_null - name: col_without_constraints data_type: int
It's important to note that other constraint types are not supported, and that
not_nullconstraints can only be defined at the column-level (not model-level). -
Work around a bug in
--persist-docsthat prevented comments from being persisted formaterialized_viewmaterializations. See [#21878] (#21878) for details.The
--persist-docsflag requires Materialize >=0.68.0. Previous versions do not have support for theCOMMENT ONsyntax, which is required to persist resource descriptions as column and relation comments in Materialize. -
Load seeds into tables rather than materialized views.
For historical reasons,
dbt-materializehas loaded seed data by injecting the values from the CSV file in aCREATE MATERIALIZED VIEW AS ...statement.dbt-materializenow creates a table and loads the values from the CSV into that file, matching the behavior of other dbt adapters.
-
Upgrade to
dbt-postgresv1.6.0:-
Support model contracts for
view,materialized_viewandtablematerializations. Materialize does not have a notion of constraints, so model- and column-level constraints are not supported. -
Deprecate the custom
materializedviewmaterialization name in favor ofmaterialized_view, which is built-in from dbt v1.6.New
{{ config( materialized = 'materialized_view' )}}Deprecated
{{ config( materialized = 'materializedview' )}}The deprecated materialization name will be removed in a future release of the adapter.
-
-
Enable the
clusterconfiguration for tests, which allows specifying a target cluster fordbt testto run against (for both one-shot and continuous testing).tests: example: +store_failures: true +schema: 'dbt_test_schema' +cluster: 'dbt_test_cluster'
-
Override the
dbt initcommand to generate a project based on the quickstart, instead of the default project generated indbt-core. -
Breaking change. Set 255 as the maximum identifier length for relation names, after #20999 introduced a
max_identifier_lengthsession variable that enforces this limit in Materialize. -
Support cancelling outstanding queries when pressing Ctrl+C.
- Enable the
indexesconfig fortablematerializations.
-
Upgrade to
dbt-postgresv1.5.0. dbt contracts and dbt constraints are not supported in this release (see dbt-core #7213). -
Fix a bug in the
materialize__list_relations_without_cachingmacro which could cause the adapter to break for multi-output sources (#20483). -
Expose
ownerin the dbt documentation, now that Materialize supports role-based access control (RBAC).
-
Let Materialize automatically run introspection queries in the
mz_introspectioncluster via the newauto_route_introspection_queriessession variable, instead of hardcoding the cluster on connection.This change requires Materialize >=0.49.0. Users of older versions should pin
dbt-materializetov1.4.0.
- Upgrade to
dbt-postgresv1.4.0.
- Fix a bug where the adapter would fail if the pre-installed
defaultcluster doesn't exist in Materialize (i.e. in case it was dropped by the user).
-
Remove the 63-character limitation on relation names. Materialize does not have this limitation, unlike PostgreSQL (see dbt-core #2727).
-
Produce an error message when attempting to use the
listaggcross-database macro. Materialize has native support forlist_agg(), which should be used instead. -
Remove the deprecated
mz_generate_namemacro.
- Add the
IN CLUSTERclause to the custom seed materialization to ensure that seeds are created in the target cluster, rather than in the active cluster. This fixes a bug in 1.3.1 where seeds would run against themz_introspectioncluster, causing an error.
-
Breaking change. Use
mz_introspectionas the initial active cluster on connection to ensure optimal performance for introspection queries.This change requires Materialize >=0.28.0. Users of older versions should pin
dbt-materializetov1.3.0.
-
Upgrade to
dbt-postgresv1.3.0. -
Migrate cross-database macros from
materialize-dbt-utilsinto the adapter, as a result of dbt-core #5298. Theutilsmacros will be deprecated in the upcoming release of the package, and removed in a subsequent release.
-
Add
clusterto the connection parameters returned ondbt debug. -
Disallow the
clusteroption forviewmaterializations. In the new architecture, only materialized views and indexes are associated with a cluster.
-
Enable additional configuration for indexes created on
view,materializedview, orsourcematerializations. Fix to use Materialize's internal naming convention when creating indexes without providing explicit names.- A new optional
nameparameter:
{{ config(materialized='materializedview', indexes=[{'columns': ['col_1'], 'name':'col_1_idx'}]) }} SELECT ...- A new
defaultparameter. Defaults toFalse. If set toTrue, will create default primary indexes.
{{ config(materialized='materializedview', indexes=[{'default': True}]) }} SELECT ... - A new optional
-
Enable configuration of clusters, which are a feature in a forthcoming version of Materialize, via:
- A new
clusterconnection parameter, which specifies the default cluster for the connection. - A new
clusteroption for materializedview and view materializations. For materialized views, this determines the cluster in which the materialized view is created. For both views and materializedviews, this also determines the cluster in which any indexes are created by default. If unspecified, the default cluster for the connection is used.
{{ config(materialized='materializedview', cluster='not_default') }} SELECT ...- A new
clusteroption for indexes on view, materializedview, or source materializations. Ifclusteris not supplied, indexes will be created in the cluster used to create the materialization.
{{ config(materialized='view', indexes=[{'columns': ['col_1'], 'cluster': 'not_default', 'name':'col_1_idx'}]) }} SELECT ... - A new
-
Upgrade to
dbt-postgresv1.2.0. -
Fully deprecate the custom index materialization.
-
Deprecate the
mz_generate_namemacro. The native Jinja function [{ { this }}] (https://docs.getdbt.com/reference/dbt-jinja-functions/this) should be used to reference the relation instead.{{ config(materialized='source') }} CREATE SOURCE {{ this }} ... -
Fix a bug that prevented old relations from being correctly dropped on re-creation.
-
Make custom materialization types available to dbt docs by swapping
pg_catalogwithmz_catalogmetadata. -
Migrate to new
pytesttesting framework.
- Mark the adapter as not supporting query cancellation, as Materialize does not
support the
pg_terminate_backendfunction that dbt uses to cancel queries.
- Provide support for storing the results of a test query in a
materializedviewusing the [store_failuresconfig] (https://docs.getdbt.com/reference/resource-configs/store_failures).
- Upgrade to
dbt-postgresv1.1.0.
-
Deprecate support for custom index materialization.
-
Enable defining indexes when creating a
materializedview,view, orsourceusing theindexesconfig.{{ config(materialized='view', indexes=[{'columns':['symbol']}]) }}
- Upgrade to
dbt-postgresv1.0.4.
- Produce a proper error message when attempting to use an incremental materialization.
- Upgrade to
dbt-postgresv1.0.3.
- Fix a bug introduced in v1.0.1.post1 that prevented use of the custom
materialization types (
sink,source,index, andmaterializedview).
-
Execute hooks that specify
transaction: true(#7675). In particular, this includes hooks that are configured as a simple string.Previously,
dbt-materializewould only execute hooks that specifiedtransaction: false. The new behavior matches the other non-transactional dbt adapters, which simply execute all hooks outside of a transaction regardless of their configuredtransactionbehavior.
-
Disable transactions. This avoids errors of the form "CREATE ... must be executed outside of a transaction block" (materialize-dbt-utils#11).
Materialize's transactions are not powerful enough to support dbt's use cases. Disabling transactions follows the precedent set by the dbt-snowflake and dbt-bigquery adapters.
-
Respect type overrides in the views created by seeds.
-
Fix the implementation of the
list_relations_without_cachingmacro. Previously it always returned an empty list of relations.
- Upgrade to
dbt-postgresv1.0.1.
- Upgrade to
dbt-postgresv1.0.0.
- Upgrade to
dbt-postgresv0.21.0.
- Upgrade to
dbt-postgresv0.20.2.
-
Breaking change. Remove the
mz_create_source,mz_drop_source,mz_create_sink,mz_drop_sink,mz_create_index, andmz_drop_indexmacros as they caused incorrect behavior indbt docs(#7810). -
Add three new custom materialization types:
source,index, andsink. These replace the aforementioned macros that were removed in this release.
- Upgrade to
dbt-postgresv0.20.1.
-
Upgrade to
dbt-postgresv0.20.0. -
Add the
mz_create_indexandmz_drop_indexmacros to manage the creation and deletion of indexes. -
Add the
mz_create_sinkandmz_drop_sinkmacros to manage the creation and deletion of sinks.
- Add the
mz_create_sourceandmz_drop_sourcemacros to manage the creation and deletion of sources, respectively.
- Support the
sslcert,sslkey, andsslrootcertparameters for specifying a TLS client certificate. Notably, this allows usingdbt-materializewith the new architecture of Materialize.
- Account for changes in how Materialize v0.7.3+ handles transactions.
- Fix a bug in the
get_catalogmacro which could cause column types to be incorrectly determined (#6063). This most notably caused information about model columns to be missing in the documentation generated bydbt docs.
Initial release.