Skip to content

Commit e718913

Browse files
mgreefrankmcsherry
andauthored
[repr types] default to repr typechecking (#34351)
Makes the repr typechecker #33871 the default, after a successful deploy. ### Motivation * This PR adds a known-desirable feature. #27239 ### Checklist - [ ] This PR has adequate test coverage / QA involvement has been duly considered. ([trigger-ci for additional test/nightly runs](https://trigger-ci.dev.materialize.com/)) - [ ] This PR has an associated up-to-date [design doc](https://github.com/MaterializeInc/materialize/blob/main/doc/developer/design/README.md), is a design doc ([template](https://github.com/MaterializeInc/materialize/blob/main/doc/developer/design/00000000_template.md)), or is sufficiently small to not require a design. <!-- Reference the design in the description. --> - [ ] If this PR evolves [an existing `$T ⇔ Proto$T` mapping](https://github.com/MaterializeInc/materialize/blob/main/doc/developer/command-and-response-binary-encoding.md) (possibly in a backwards-incompatible way), then it is tagged with a `T-proto` label. - [ ] If this PR will require changes to cloud orchestration or tests, there is a companion cloud PR to account for those changes that is tagged with the release-blocker label ([example](MaterializeInc/cloud#5021)). <!-- Ask in #team-cloud on Slack if you need help preparing the cloud PR. --> - [ ] If this PR includes major [user-facing behavior changes](https://github.com/MaterializeInc/materialize/blob/main/doc/developer/guide-changes.md#what-changes-require-a-release-note), I have pinged the relevant PM to schedule a changelog post. Co-authored-by: Frank McSherry <fmcsherry@me.com>
1 parent a8dadd2 commit e718913

File tree

15 files changed

+9
-1692
lines changed

15 files changed

+9
-1692
lines changed

misc/python/materialize/mzcompose/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,6 @@ def get_minimal_system_parameters(
107107
"enable_reduce_mfp_fusion": "true",
108108
"enable_refresh_every_mvs": "true",
109109
"enable_replacement_materialized_views": "true",
110-
"enable_repr_typecheck": "true",
111110
"enable_cluster_schedule_refresh": "true",
112111
"enable_sql_server_source": "true",
113112
"enable_statement_lifecycle_logging": "true",

src/adapter/src/optimize/copy_to.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ use mz_transform::normalize_lets::normalize_lets;
3131
use mz_transform::reprtypecheck::{
3232
SharedContext as ReprTypecheckContext, empty_context as empty_repr_context,
3333
};
34-
use mz_transform::typecheck::{SharedContext as TypecheckContext, empty_context};
3534
use mz_transform::{StatisticsOracle, TransformCtx};
3635
use timely::progress::Antichain;
3736
use tracing::warn;
@@ -49,8 +48,6 @@ use crate::optimize::{
4948
};
5049

5150
pub struct Optimizer {
52-
/// A typechecking context to use throughout the optimizer pipeline.
53-
typecheck_ctx: TypecheckContext,
5451
/// A representation typechecking context to use throughout the optimizer pipeline.
5552
repr_typecheck_ctx: ReprTypecheckContext,
5653
/// A snapshot of the catalog state.
@@ -79,7 +76,6 @@ impl Optimizer {
7976
metrics: OptimizerMetrics,
8077
) -> Self {
8178
Self {
82-
typecheck_ctx: empty_context(),
8379
repr_typecheck_ctx: empty_repr_context(),
8480
catalog,
8581
compute_instance,
@@ -175,7 +171,6 @@ impl Optimize<HirRelationExpr> for Optimizer {
175171
let mut df_meta = DataflowMetainfo::default();
176172
let mut transform_ctx = TransformCtx::local(
177173
&self.config.features,
178-
&self.typecheck_ctx,
179174
&self.repr_typecheck_ctx,
180175
&mut df_meta,
181176
Some(&mut self.metrics),
@@ -353,7 +348,6 @@ impl<'s> Optimize<LocalMirPlan<Resolved<'s>>> for Optimizer {
353348
&df_builder,
354349
&*stats,
355350
&self.config.features,
356-
&self.typecheck_ctx,
357351
&self.repr_typecheck_ctx,
358352
&mut df_meta,
359353
Some(&mut self.metrics),

src/adapter/src/optimize/index.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ use mz_transform::notice::{IndexAlreadyExists, IndexKeyEmpty};
4141
use mz_transform::reprtypecheck::{
4242
SharedContext as ReprTypecheckContext, empty_context as empty_repr_context,
4343
};
44-
use mz_transform::typecheck::{SharedContext as TypecheckContext, empty_context};
4544

4645
use crate::optimize::dataflows::{
4746
ComputeInstanceSnapshot, DataflowBuilder, ExprPrepStyle, prep_relation_expr, prep_scalar_expr,
@@ -52,8 +51,6 @@ use crate::optimize::{
5251
};
5352

5453
pub struct Optimizer {
55-
/// A typechecking context to use throughout the optimizer pipeline.
56-
typecheck_ctx: TypecheckContext,
5754
/// A representation typechecking context to use throughout the optimizer pipeline.
5855
repr_typecheck_ctx: ReprTypecheckContext,
5956
/// A snapshot of the catalog state.
@@ -79,7 +76,6 @@ impl Optimizer {
7976
metrics: OptimizerMetrics,
8077
) -> Self {
8178
Self {
82-
typecheck_ctx: empty_context(),
8379
repr_typecheck_ctx: empty_repr_context(),
8480
catalog,
8581
compute_instance,
@@ -182,7 +178,6 @@ impl Optimize<Index> for Optimizer {
182178
&df_builder,
183179
&mz_transform::EmptyStatisticsOracle, // TODO: wire proper stats
184180
&self.config.features,
185-
&self.typecheck_ctx,
186181
&self.repr_typecheck_ctx,
187182
&mut df_meta,
188183
Some(&mut self.metrics),

src/adapter/src/optimize/materialized_view.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ use mz_transform::normalize_lets::normalize_lets;
4545
use mz_transform::reprtypecheck::{
4646
SharedContext as ReprTypecheckContext, empty_context as empty_repr_context,
4747
};
48-
use mz_transform::typecheck::{SharedContext as TypecheckContext, empty_context};
4948
use timely::progress::Antichain;
5049

5150
use crate::optimize::dataflows::{
@@ -57,8 +56,6 @@ use crate::optimize::{
5756
};
5857

5958
pub struct Optimizer {
60-
/// A typechecking context to use throughout the optimizer pipeline.
61-
typecheck_ctx: TypecheckContext,
6259
/// A representation typechecking context to use throughout the optimizer pipeline.
6360
repr_typecheck_ctx: ReprTypecheckContext,
6461
/// A snapshot of the catalog state.
@@ -119,7 +116,6 @@ impl Optimizer {
119116
force_source_non_monotonic: BTreeSet<GlobalId>,
120117
) -> Self {
121118
Self {
122-
typecheck_ctx: empty_context(),
123119
repr_typecheck_ctx: empty_repr_context(),
124120
catalog,
125121
compute_instance,
@@ -202,7 +198,6 @@ impl Optimize<HirRelationExpr> for Optimizer {
202198
let mut df_meta = DataflowMetainfo::default();
203199
let mut transform_ctx = TransformCtx::local(
204200
&self.config.features,
205-
&self.typecheck_ctx,
206201
&self.repr_typecheck_ctx,
207202
&mut df_meta,
208203
Some(&mut self.metrics),
@@ -292,7 +287,6 @@ impl Optimize<LocalMirPlan> for Optimizer {
292287
&df_builder,
293288
&mz_transform::EmptyStatisticsOracle, // TODO: wire proper stats
294289
&self.config.features,
295-
&self.typecheck_ctx,
296290
&self.repr_typecheck_ctx,
297291
&mut df_meta,
298292
Some(&mut self.metrics),

src/adapter/src/optimize/peek.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ use mz_transform::normalize_lets::normalize_lets;
2828
use mz_transform::reprtypecheck::{
2929
SharedContext as ReprTypecheckContext, empty_context as empty_repr_context,
3030
};
31-
use mz_transform::typecheck::{SharedContext as TypecheckContext, empty_context};
3231
use mz_transform::{StatisticsOracle, TransformCtx};
3332
use timely::progress::Antichain;
3433
use tracing::debug_span;
@@ -46,8 +45,6 @@ use crate::optimize::{
4645
};
4746

4847
pub struct Optimizer {
49-
/// A typechecking context to use throughout the optimizer pipeline.
50-
typecheck_ctx: TypecheckContext,
5148
/// A representation typechecking context to use throughout the optimizer pipeline.
5249
repr_typecheck_ctx: ReprTypecheckContext,
5350
/// A snapshot of the catalog state.
@@ -79,7 +76,6 @@ impl Optimizer {
7976
metrics: OptimizerMetrics,
8077
) -> Self {
8178
Self {
82-
typecheck_ctx: empty_context(),
8379
repr_typecheck_ctx: empty_repr_context(),
8480
catalog,
8581
compute_instance,
@@ -186,7 +182,6 @@ impl Optimize<HirRelationExpr> for Optimizer {
186182
let mut df_meta = DataflowMetainfo::default();
187183
let mut transform_ctx = TransformCtx::local(
188184
&self.config.features,
189-
&self.typecheck_ctx,
190185
&self.repr_typecheck_ctx,
191186
&mut df_meta,
192187
Some(&mut self.metrics),
@@ -342,7 +337,6 @@ impl<'s> Optimize<LocalMirPlan<Resolved<'s>>> for Optimizer {
342337
&df_builder,
343338
&*stats,
344339
&self.config.features,
345-
&self.typecheck_ctx,
346340
&self.repr_typecheck_ctx,
347341
&mut df_meta,
348342
Some(&mut self.metrics),

src/adapter/src/optimize/subscribe.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ use mz_transform::normalize_lets::normalize_lets;
2929
use mz_transform::reprtypecheck::{
3030
SharedContext as ReprTypecheckContext, empty_context as empty_repr_context,
3131
};
32-
use mz_transform::typecheck::{SharedContext as TypecheckContext, empty_context};
3332
use timely::progress::Antichain;
3433

3534
use crate::CollectionIdBundle;
@@ -43,8 +42,6 @@ use crate::optimize::{
4342
};
4443

4544
pub struct Optimizer {
46-
/// A typechecking context to use throughout the optimizer pipeline.
47-
typecheck_ctx: TypecheckContext,
4845
/// A representation typechecking context to use throughout the optimizer pipeline.
4946
repr_typecheck_ctx: ReprTypecheckContext,
5047
/// A snapshot of the catalog state.
@@ -99,7 +96,6 @@ impl Optimizer {
9996
metrics: OptimizerMetrics,
10097
) -> Self {
10198
Self {
102-
typecheck_ctx: empty_context(),
10399
repr_typecheck_ctx: empty_repr_context(),
104100
catalog,
105101
compute_instance,
@@ -242,7 +238,6 @@ impl Optimize<SubscribeFrom> for Optimizer {
242238
// MIR ⇒ MIR optimization (local)
243239
let mut transform_ctx = TransformCtx::local(
244240
&self.config.features,
245-
&self.typecheck_ctx,
246241
&self.repr_typecheck_ctx,
247242
&mut df_meta,
248243
Some(&mut self.metrics),
@@ -286,7 +281,6 @@ impl Optimize<SubscribeFrom> for Optimizer {
286281
&df_builder,
287282
&mz_transform::EmptyStatisticsOracle, // TODO: wire proper stats
288283
&self.config.features,
289-
&self.typecheck_ctx,
290284
&self.repr_typecheck_ctx,
291285
&mut df_meta,
292286
Some(&mut self.metrics),

src/adapter/src/optimize/view.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ use mz_transform::dataflow::DataflowMetainfo;
2929
use mz_transform::reprtypecheck::{
3030
SharedContext as ReprTypecheckContext, empty_context as empty_repr_context,
3131
};
32-
use mz_transform::typecheck::{SharedContext as TypecheckContext, empty_context};
3332

3433
use crate::optimize::dataflows::{ExprPrepStyle, prep_relation_expr};
3534
use crate::optimize::{
@@ -38,8 +37,6 @@ use crate::optimize::{
3837
};
3938

4039
pub struct Optimizer<'a> {
41-
/// A typechecking context to use throughout the optimizer pipeline.
42-
typecheck_ctx: TypecheckContext,
4340
/// A representation typechecking context to use throughout the optimizer pipeline.
4441
repr_typecheck_ctx: ReprTypecheckContext,
4542
/// Optimizer config.
@@ -58,7 +55,6 @@ pub struct Optimizer<'a> {
5855
impl<'a> Optimizer<'a> {
5956
pub fn new(config: OptimizerConfig, metrics: Option<OptimizerMetrics>) -> Self {
6057
Self {
61-
typecheck_ctx: empty_context(),
6258
repr_typecheck_ctx: empty_repr_context(),
6359
config,
6460
metrics,
@@ -76,7 +72,6 @@ impl<'a> Optimizer<'a> {
7672
expr_prep_style: ExprPrepStyle<'a>,
7773
) -> Optimizer<'a> {
7874
Self {
79-
typecheck_ctx: empty_context(),
8075
repr_typecheck_ctx: empty_repr_context(),
8176
config,
8277
metrics,
@@ -101,7 +96,6 @@ impl Optimize<HirRelationExpr> for Optimizer<'_> {
10196
let mut df_meta = DataflowMetainfo::default();
10297
let mut transform_ctx = TransformCtx::local(
10398
&self.config.features,
104-
&self.typecheck_ctx,
10599
&self.repr_typecheck_ctx,
106100
&mut df_meta,
107101
self.metrics.as_mut(),

src/repr/src/optimize.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,6 @@ optimizer_feature_flags!({
131131
// See the feature flag of the same name.
132132
enable_dequadratic_eqprop_map: bool,
133133
enable_fast_path_plan_insights: bool,
134-
enable_repr_typecheck: bool,
135134
});
136135

137136
/// A trait used to implement layered config construction.

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4943,7 +4943,6 @@ pub fn unplan_create_cluster(
49434943
enable_dequadratic_eqprop_map: _,
49444944
enable_eq_classes_withholding_errors: _,
49454945
enable_fast_path_plan_insights: _,
4946-
enable_repr_typecheck: _,
49474946
} = optimizer_feature_overrides;
49484947
// The ones from above that don't occur below are not wired up to cluster features.
49494948
let features_extracted = ClusterFeatureExtracted {

src/sql/src/plan/statement/dml.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -638,7 +638,6 @@ impl TryFrom<ExplainPlanOptionExtracted> for ExplainConfig {
638638
enable_dequadratic_eqprop_map: Default::default(),
639639
enable_eq_classes_withholding_errors: Default::default(),
640640
enable_fast_path_plan_insights: Default::default(),
641-
enable_repr_typecheck: Default::default(),
642641
},
643642
})
644643
}

0 commit comments

Comments
 (0)