Gabriel39 opened a new pull request, #66599:
URL: https://github.com/apache/doris/pull/66599

   ### What problem does this PR solve?
   
   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.
   
   This change 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, so the 
optimization cannot fail an otherwise valid query.
   
   Related issue: #58441
   
   ### Test
   
   - Added a unit test that verifies table registration restores both owner 
references and permits `BaseTableInfo` construction.
   - Added a unit test that verifies MTMV candidate collection does not fail a 
query when owner metadata is incomplete.
   - Ran `ExternalDatabaseTest` and `CollectRelationTest`: 35 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]

Reply via email to