Skip to content

Conversation

@teskje
Copy link
Contributor

@teskje teskje commented Dec 2, 2025

This PR adds a new mz_replacements builtin table, exposing the replacement MV relationship.

It also adds a replacing column to the SHOW MATERIALIZED VIEWS output, fueled by the new mz_replacements table. The new colum is only added when the enable_replacement_materialized_views feature flag is enabled, so nothing changes for production users yet.

Motivation

  • This PR adds a known-desirable feature.

Part of https://github.com/MaterializeInc/database-issues/issues/9903

Tips for reviewer

Currently, the thinking is that we should instead have a new column in mz_materialized_views. However, such a column would be immediately stabilized, so until the feature is ready for GA, we use an unstable mz_replacements table instead.

Checklist

  • This PR has adequate test coverage / QA involvement has been duly considered. (trigger-ci for additional test/nightly runs)
  • This PR has an associated up-to-date design doc, is a design doc (template), or is sufficiently small to not require a design.
  • If this PR evolves an existing $T ⇔ Proto$T mapping (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).
  • If this PR includes major user-facing behavior changes, I have pinged the relevant PM to schedule a changelog post.

@teskje teskje force-pushed the mz_replacements branch 9 times, most recently from 9a08139 to f4949c3 Compare December 8, 2025 11:42
This commit adds a new `mz_replacements` builtin table, exposing the
replacement MV relationship. It also adds a `replacing` column to the
`SHOW MATERIALIZED VIEWS` output, fueled by the new `mz_replacements`
table.
Copy link
Member

@antiguru antiguru left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, I'l approve once ready!

@teskje teskje marked this pull request as ready for review December 10, 2025 13:45
@teskje teskje requested review from a team as code owners December 10, 2025 13:45
@teskje teskje requested a review from ggevay December 10, 2025 13:45
@teskje
Copy link
Contributor Author

teskje commented Dec 10, 2025

I think it's ready!

@ggevay
Copy link
Contributor

ggevay commented Dec 10, 2025

(The random reviewer assignment chose me, but I guess @antiguru is in a better position to review this, right?)

@teskje
Copy link
Contributor Author

teskje commented Dec 10, 2025

I think anyone could review this, it doesn't touch any complicated logic, and all the new SQL surface is behind a feature flag and will be revisited anyway before we GA the ALTER MV feature. But Moritz' review is enough for me, no need for you to review, Gabor!

@teskje
Copy link
Contributor Author

teskje commented Dec 10, 2025

TFTR!

@teskje teskje merged commit ca79ae2 into MaterializeInc:main Dec 10, 2025
328 of 338 checks passed
@teskje teskje deleted the mz_replacements branch December 10, 2025 14:08
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.

3 participants