morningman commented on code in PR #49875:
URL: https://github.com/apache/doris/pull/49875#discussion_r2037720876


##########
fe/fe-core/src/main/java/org/apache/doris/mtmv/MTMVPartitionInfo.java:
##########
@@ -154,10 +155,10 @@ public String toNameString() {
         }
     }
 
-    public void compatible(CatalogMgr catalogMgr) {
+    public Optional<String> compatible(CatalogMgr catalogMgr) {

Review Comment:
   Why not using exception? I think that would be more natural in Java



##########
fe/fe-core/src/main/java/org/apache/doris/nereids/rules/exploration/mv/InitConsistentMaterializationContextHook.java:
##########
@@ -49,10 +46,9 @@ public void initMaterializationContext(CascadesContext 
cascadesContext) {
     }
 
     protected Set<MTMV> getAvailableMTMVs(Set<TableIf> usedTables, 
CascadesContext cascadesContext) {
-        List<BaseTableInfo> usedBaseTables =
-                
usedTables.stream().map(BaseTableInfo::new).collect(Collectors.toList());
         return Env.getCurrentEnv().getMtmvService().getRelationManager()
-                .getAvailableMTMVs(usedBaseTables, 
cascadesContext.getConnectContext(),
+                
.getAvailableMTMVs(cascadesContext.getStatementContext().getCandidateMTMVs(),

Review Comment:
   For name issue, is there different between "available" and "candidate"?
   If not, better use same word



##########
fe/fe-core/src/main/java/org/apache/doris/persist/AlterMTMV.java:
##########
@@ -156,7 +168,48 @@ public void write(DataOutput out) throws IOException {
     }
 
     public static AlterMTMV read(DataInput in) throws IOException {
-        return GsonUtils.GSON.fromJson(Text.readString(in), AlterMTMV.class);
+        AlterMTMV alterMTMV = GsonUtils.GSON.fromJson(Text.readString(in), 
AlterMTMV.class);
+        try {
+            alterMTMV.compatible();
+        } catch (Throwable t) {
+            LOG.info("MTMV compatible failed, dbName: {}, mvName: {}, errMsg: 
{}", alterMTMV.mvName.getDb(),

Review Comment:
   warn



-- 
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: commits-unsubscr...@doris.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to