Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support refreshable materialized views #401

Merged
merged 11 commits into from
Jan 5, 2025
Merged

Conversation

BentsiLeviav
Copy link
Contributor

@BentsiLeviav BentsiLeviav commented Dec 26, 2024

Summary

Closes #252

This PR enhances the current mv implementation by introducing the ability to create refreshable materialized views.
Important Note: Currently, there is no direct "dbt linkage" between materialized views and their dependencies. As a result, the order of creation for dependencies is not guaranteed.

A potential solution to address this limitation is to pass a dbt ref object to the dependency list. However, this would require implementing MessagePack serialization to handle the references appropriately.

@BentsiLeviav BentsiLeviav requested review from genzgd and a team December 26, 2024 12:14
@BentsiLeviav
Copy link
Contributor Author

This is a config example of the current implementation:

{{
    config(
        materialized='materialized_view',
        refreshable={
        "interval": "EVERY 2 MINUTE",
        "append": true,
        "depends_on": ['default.depend_on_model_mv']
        }        )
}}

@BentsiLeviav BentsiLeviav marked this pull request as ready for review December 31, 2024 09:29
@BentsiLeviav BentsiLeviav merged commit 0147955 into main Jan 5, 2025
42 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support refreshable MVs
2 participants