Skip to content

Commit 2db420a

Browse files
committed
sql: enable_replacement_materialized_views feature flag
This commit adds a feature flag to gate the creation and application of replacement materialized views. It's disabled by default and enabled in CI.
1 parent 0005b59 commit 2db420a

File tree

3 files changed

+11
-0
lines changed

3 files changed

+11
-0
lines changed

misc/python/materialize/mzcompose/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ def get_minimal_system_parameters(
106106
"enable_rbac_checks": "true",
107107
"enable_reduce_mfp_fusion": "true",
108108
"enable_refresh_every_mvs": "true",
109+
"enable_replacement_materialized_views": "true",
109110
"enable_repr_typecheck": "true",
110111
"enable_cluster_schedule_refresh": "true",
111112
"enable_sql_server_source": "true",

src/sql/src/plan/statement/ddl.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2735,6 +2735,8 @@ pub fn plan_create_materialized_view(
27352735

27362736
// Validate the replacement target, if one is given.
27372737
let replacement_target = if let Some(target_name) = &stmt.replacing {
2738+
scx.require_feature_flag(&vars::ENABLE_REPLACEMENT_MATERIALIZED_VIEWS)?;
2739+
27382740
let target = scx.get_item_by_resolved_name(target_name)?;
27392741
if target.item_type() != CatalogItemType::MaterializedView {
27402742
return Err(PlanError::InvalidReplacement {
@@ -7373,6 +7375,8 @@ pub fn plan_alter_materialized_view_apply_replacement(
73737375
replacement_name,
73747376
} = stmt;
73757377

7378+
scx.require_feature_flag(&vars::ENABLE_REPLACEMENT_MATERIALIZED_VIEWS)?;
7379+
73767380
let object_type = ObjectType::MaterializedView;
73777381
let Some(mv) = resolve_item_or_type(scx, object_type, name.clone(), if_exists)? else {
73787382
scx.catalog.add_notice(PlanNotice::ObjectDoesNotExist {

src/sql/src/session/vars/definitions.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2230,6 +2230,12 @@ feature_flags!(
22302230
default: false,
22312231
enable_for_item_parsing: false,
22322232
},
2233+
{
2234+
name: enable_replacement_materialized_views,
2235+
desc: "Whether to enable replacement materialized views.",
2236+
default: false,
2237+
enable_for_item_parsing: true,
2238+
},
22332239
);
22342240

22352241
impl From<&super::SystemVars> for OptimizerFeatures {

0 commit comments

Comments
 (0)