github-actions[bot] commented on code in PR #66600:
URL: https://github.com/apache/doris/pull/66600#discussion_r3747206390


##########
fe/fe-core/src/main/java/org/apache/doris/nereids/rules/analysis/CollectRelation.java:
##########
@@ -239,6 +240,13 @@ private void collectMTMVCandidates(TableIf table, 
CascadesContext cascadesContex
         boolean shouldCollect = 
MaterializedViewUtils.containMaterializedViewHook(
                 cascadesContext.getStatementContext());
         if (shouldCollect) {
+            DatabaseIf database = table.getDatabase();
+            // MTMV rewrite is optional, so malformed ownership metadata must 
not abort the query.
+            if (database == null || database.getCatalog() == null) {

Review Comment:
   The `database.getCatalog() == null` arm does not actually provide the 
promised fallback. With the MV hook installed, 
`InitMaterializationContextHook.afterRewrite()` later runs 
`QueryPartitionCollector`; that visitor only skips a null database and then 
calls `StatementContext.getTableId(table)`, which keys through 
`table.getFullQualifiers()` and dereferences `database.getCatalog().getName()`. 
A table handled by this new arm can therefore still abort the query during 
post-rewrite partition collection (the DML hook inherits the same path). Please 
make the downstream MV-hook work skip incomplete catalog ownership too, and 
cover this with a full planner regression using a non-null database whose 
catalog is null.
   



-- 
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