catalog,adapter: convert mz_sources table to materialized view#36136
Draft
teskje wants to merge 1 commit into
Draft
catalog,adapter: convert mz_sources table to materialized view#36136teskje wants to merge 1 commit into
teskje wants to merge 1 commit into
Conversation
da01428 to
803a2ea
Compare
803a2ea to
7585228
Compare
mtabebe
added a commit
to mtabebe/materialize
that referenced
this pull request
May 21, 2026
Problem: mz_sources was a builtin table populated imperatively in Rust code in builtin_table_updates.rs. Ideologically we want to move these to views over the catalog. Solution: Convert mz_sources into a materialized view that reads directly from mz_catalog_raw. User sources are derived by parsing their stored create_sql. Builtin and log sources, which don't appear in mz_catalog_raw, are exposed via a new internal view mz_internal.mz_builtin_sources Testing: - Updated information_schema_tables.slt to expect MATERIALIZED VIEW for mz_sources - Added mz_builtin_sources to mz_internal.slt and mz_catalog_server_index_accounting.slt - updated catalog.td to move mz_sources from the tables section into the materialized views section. Part of SQL-118. Port of MaterializeInc#36136 (adapted for the split builtin file structure and current OID range).
mtabebe
added a commit
to mtabebe/materialize
that referenced
this pull request
May 21, 2026
Problem: mz_sources was a builtin table populated imperatively in Rust code in builtin_table_updates.rs. Ideologically we want to move these to views over the catalog. Solution: Convert mz_sources into a materialized view that reads directly from mz_catalog_raw. User sources are derived by parsing their stored create_sql. Builtin and log sources, which don't appear in mz_catalog_raw, are exposed via a new internal view mz_internal.mz_builtin_sources Testing: - Updated information_schema_tables.slt to expect MATERIALIZED VIEW for mz_sources - Added mz_builtin_sources to mz_internal.slt and mz_catalog_server_index_accounting.slt - updated catalog.td to move mz_sources from the tables section into the materialized views section. Part of SQL-118. Port of MaterializeInc#36136 (adapted for the split builtin file structure and current OID range).
mtabebe
added a commit
to mtabebe/materialize
that referenced
this pull request
May 21, 2026
Problem: mz_sources was a builtin table populated imperatively in Rust code in builtin_table_updates.rs. Ideologically we want to move these to views over the catalog. Solution: Convert mz_sources into a materialized view that reads directly from mz_catalog_raw. User sources are derived by parsing their stored create_sql. Builtin and log sources, which don't appear in mz_catalog_raw, are exposed via a new internal view mz_internal.mz_builtin_sources Testing: - Updated information_schema_tables.slt to expect MATERIALIZED VIEW for mz_sources - Added mz_builtin_sources to mz_internal.slt and mz_catalog_server_index_accounting.slt - updated catalog.td to move mz_sources from the tables section into the materialized views section. Part of SQL-118. Port of MaterializeInc#36136 (adapted for the split builtin file structure and current OID range).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This commit converts the
mz_sourcesbuiltin table into a view over thecatalog. As part of this, it introduces an internal
mz_builtin_sourcesview exposing the builtin indexes to SQL.
Motivation
Part of SQL-118