[fix](view) Skip dangling views when querying information_schema.view_dependency - #67339
Merged
Merged
Conversation
…ependency information_schema.view_dependency re-parses each view definition to collect its base tables. When a view references a table that no longer exists (dangling view), the parse throws and fails the whole metadata query instead of skipping the bad view. Key changes: - In MetadataGenerator.viewDependencyMetadataResult, wrap PlanUtils.tableCollect in try-catch for the View branch; a view that fails to resolve is skipped with a WARN log and the query continues with the remaining objects Unit Test: - Reproduced on latest master: create view, drop its base table, then query information_schema.view_dependency fails with "Table does not exist in database" - After the fix: the query succeeds, the dangling view is skipped with a WARN log, and normal views are still returned
Contributor
Author
|
run buildall |
Contributor
|
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
Contributor
FE UT Coverage ReportIncrement line coverage |
Contributor
Author
|
run nonConcurrent |
Contributor
FE Regression Coverage ReportIncrement line coverage |
Contributor
TPC-H: Total hot run time: 17020 ms |
Contributor
TPC-DS: Total hot run time: 83439 ms |
Contributor
ClickBench: Total hot run time: 14.72 s |
morrySnow
approved these changes
Sep 1, 2026
github-actions Bot
pushed a commit
that referenced
this pull request
Sep 1, 2026
…_dependency (#67339) `information_schema.view_dependency` re-parses each view definition to collect its base tables. When a view references a table that no longer exists (dangling view), the parse throws an exception and the whole metadata query fails instead of skipping the bad view. For example, after `CREATE VIEW v1 AS SELECT * FROM t1; DROP TABLE t1;`, `SELECT * FROM information_schema.view_dependency` fails with `Table [t1] does not exist in database [xxx]`.
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.
What problem does this PR solve?
Problem Summary:
information_schema.view_dependencyre-parses each view definition to collectits base tables. When a view references a table that no longer exists
(dangling view), the parse throws an exception and the whole metadata query
fails instead of skipping the bad view.
For example, after
CREATE VIEW v1 AS SELECT * FROM t1; DROP TABLE t1;,SELECT * FROM information_schema.view_dependencyfails withTable [t1] does not exist in database [xxx].How to test this PR?
information_schema.view_dependency: before the fix the query failsentirely; after the fix it succeeds, the dangling view is skipped with a
WARN log, and normal views are still returned.
🤖 Generated with Claude Code