Skip to content

sql-703: Convert mz_replacements to a builtin materialized view - #39160

Merged
SangJunBak merged 4 commits into
mainfrom
jun/sql-499-convert-item-metadata-tables-to-catalog-views
Oct 6, 2026
Merged

SangJunBak merged 4 commits into
mainfrom
jun/sql-499-convert-item-metadata-tables-to-catalog-views

Conversation

@SangJunBak

@SangJunBak SangJunBak commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor
  • Converts mz_source_references to a builtin materialized view. Read commit messages for more details

Motivation

Closes SQL-703

Verification

  • Created a new SLT to test the SQL itself.
  • Diffed this relation using a customer's workload replay against main and this branch.

@linear-code

linear-code Bot commented Sep 25, 2026 •

Copy link
Copy Markdown

SQL-703

@SangJunBak
SangJunBak added this pull request to stack #38849 September 25, 2026 17:07
@SangJunBak
SangJunBak force-pushed the jun/sql-499-convert-item-metadata-tables-to-catalog-views branch from a4f29ae to ccd8314 Compare September 25, 2026 17:49
Base automatically changed from jun/source-references-mv to main September 28, 2026 15:51
@SangJunBak
SangJunBak force-pushed the jun/sql-499-convert-item-metadata-tables-to-catalog-views branch 5 times, most recently from 4215857 to a2d6bf2 Compare September 30, 2026 20:25
@SangJunBak SangJunBak changed the title sql-499: Retain relations sql-703: Convert mz_replacements to a builtin materialized view Sep 30, 2026
@SangJunBak
SangJunBak force-pushed the jun/sql-499-convert-item-metadata-tables-to-catalog-views branch from a2d6bf2 to 444230d Compare September 30, 2026 21:10
@SangJunBak
SangJunBak marked this pull request as ready for review September 30, 2026 21:51
@SangJunBak
SangJunBak requested a review from a team as a code owner September 30, 2026 21:51

@ggevay ggevay left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM, just one minor thing

// materialized view over mz_catalog_raw changes its catalog
// fingerprint.
MigrationStep::replacement(
"26.45.0-dev.0",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Needs to be updated. (Sorry for the late review!)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Np! Thanks for the review!!

@SangJunBak
SangJunBak force-pushed the jun/sql-499-convert-item-metadata-tables-to-catalog-views branch from 444230d to acc940f Compare October 5, 2026 14:46
parse_catalog_create_sql reports replacement_target, the target of a
REPLACEMENT FOR materialized view. Nothing reads it yet.
- Add in the schema migration
- Remove code that packs the update into our builtin tables
- Use updated `parse_catalog_create_sql` to get the replacement IDs and derive mz_replacements using SQL
Add sqllogictests to ensure mz_replacements is consistent during an ALTER ... REPLACE operation
@SangJunBak
SangJunBak force-pushed the jun/sql-499-convert-item-metadata-tables-to-catalog-views branch from acc940f to 385828f Compare October 5, 2026 16:13
@SangJunBak
SangJunBak merged commit 49b61f3 into main Oct 6, 2026
84 checks passed
@SangJunBak
SangJunBak deleted the jun/sql-499-convert-item-metadata-tables-to-catalog-views branch October 6, 2026 03:02
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.

2 participants