Gabriel39 opened a new pull request, #66600:
URL: https://github.com/apache/doris/pull/66600
### What problem does this PR solve?
This is the branch-4.0 backport of #66599.
An external table can have incomplete owner references after metadata
recovery. When materialized-view rewrite is enabled, `CollectRelation`
constructs a `BaseTableInfo` from that table and aborts the entire query
because the database is null.
The backport restores the catalog and database references before publishing
a registered external table. It also skips optional MTMV candidate collection
when an already-cached table still has incomplete owner metadata.
Related issue: #58441
### Test
- Added unit coverage for owner-reference restoration and safe MTMV
candidate collection.
- Ran `ExternalEqualsTest` and `CollectRelationTest`: 3 tests passed, 0
failures.
- FE Checkstyle passed as part of the FE unit-test build.
### Release note
None.
### Check List (For Author)
- Test
- [x] Unit Test
- Behavior changed
- [x] No.
- Does this need documentation?
- [x] No.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]