Skip to content

feat(query): add system.materialized_views - #20362

Open
TCeason wants to merge 1 commit into
databendlabs:mainfrom
TCeason:system_mv
Open

feat(query): add system.materialized_views#20362
TCeason wants to merge 1 commit into
databendlabs:mainfrom
TCeason:system_mv

Conversation

@TCeason

@TCeason TCeason commented Aug 24, 2026

Copy link
Copy Markdown
Collaborator

I hereby agree to the terms of the CLA available at: https://docs.databend.com/dev/policies/cla/

Summary

add system.materialized_views

Tests

  • Unit Test
  • Logic Test
  • Benchmark Test
  • No Test - Explain why

Type of change

  • Bug Fix (non-breaking change which fixes an issue)
  • New Feature (non-breaking change which adds functionality)
  • Breaking Change (fix or feature that could cause existing functionality not to work as expected)
  • Documentation Update
  • Refactoring
  • Performance Improvement
  • Other (please describe):

AI assistance

  • AI usage: AI generated the base code I reviewed the diff.
  • Responsible human: @TCeason
  • The responsible human has read every line of this diff and can explain each change

This change is Reviewable

@github-actions github-actions Bot added the pr-feature this PR introduces a new feature to the codebase label Aug 24, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8da460a699

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread src/meta/api/src/api_impl/materialized_view_api.rs
Comment on lines +276 to +280
fn is_listed_materialized_view_invalid(item: &ListedMaterializedView) -> bool {
let binding_invalid = item.source.bound_source_generation.is_none()
|| item.source.current_source_generation.is_none()
|| item.source.bound_source_generation != item.source.current_source_generation;
binding_invalid || listed_materialized_view_invalid_reason(&item.mv.table_meta.data).is_some()

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Mark renamed or dropped sources invalid

When a source table is renamed or dropped, its MV binding and source generation are deliberately left unchanged, so all three checks here still pass even though reads and refreshes reject the MV (refresh separately detects a changed query resolution or TableMeta.drop_on). As a result, system.materialized_views reports invalid = false for these unusable MVs; the listing needs to incorporate source lifecycle/query-binding validity rather than relying only on generation presence and equality.

Useful? React with 👍 / 👎.

@TCeason
TCeason force-pushed the system_mv branch 2 times, most recently from d9fd9da to f8973bf Compare August 24, 2026 09:42
@github-actions

github-actions Bot commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

🤖 CI Job Analysis (Retry 1)

Workflow: 32713833324

📊 Summary

  • Total Jobs: 91
  • Failed Jobs: 1
  • Retryable: 0
  • Code Issues: 1

NO RETRY NEEDED

All failures appear to be code/test issues requiring manual fixes.

🔍 Job Details

  • linux / test_unit: Not retryable (Code/Test)

🤖 About

Automated analysis using job annotations to distinguish infrastructure issues (auto-retried) from code/test issues (manual fixes needed).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-feature this PR introduces a new feature to the codebase

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant