Skip to content

Commit 636c1db

Browse files
committed
Don't recreate mview for RisingWave
1 parent 551b6f7 commit 636c1db

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

.circleci/continue_config.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -311,9 +311,9 @@ workflows:
311311
- fabric
312312
- gcp-postgres
313313
filters:
314-
branches:
315-
only:
316-
- main
314+
# branches:
315+
# only:
316+
# - main
317317
- ui_style
318318
- ui_test
319319
- vscode_test

sqlmesh/core/snapshot/evaluator.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2284,11 +2284,11 @@ def insert(
22842284
) -> None:
22852285
snapshot = kwargs["snapshot"]
22862286

2287-
if (
2288-
not snapshot.is_materialized_view
2289-
and self.adapter.HAS_VIEW_BINDING
2290-
and self.adapter.table_exists(table_name)
2291-
):
2287+
# For all engines that support materialized views (except RisingWave) we recreate it.
2288+
# This is because case if upstream tables were recreated (e.g FULL models), the mview would be invalidated as well.
2289+
# RisingWave is an exception as it doesn't support CREATE OR REPLACE, so upstream models don't recreate their physical tables.
2290+
force_view_replace = snapshot.is_materialized_view and not self.adapter.HAS_VIEW_BINDING
2291+
if not force_view_replace and self.adapter.table_exists(table_name):
22922292
logger.info("Skipping creation of the view '%s'", table_name)
22932293
return
22942294

@@ -2297,7 +2297,7 @@ def insert(
22972297
table_name,
22982298
query_or_df,
22992299
model.columns_to_types,
2300-
replace=snapshot.is_materialized_view or not self.adapter.HAS_VIEW_BINDING,
2300+
replace=force_view_replace,
23012301
materialized=self._is_materialized_view(model),
23022302
view_properties=kwargs.get("physical_properties", model.physical_properties),
23032303
table_description=model.description,

0 commit comments

Comments
 (0)