eldenmoon commented on code in PR #69995:
URL: https://github.com/apache/doris/pull/69995#discussion_r4494301382


##########
fe/fe-core/src/main/java/org/apache/doris/datasource/InternalCatalog.java:
##########
@@ -2778,6 +2778,21 @@ private boolean createOlapTable(Database db, 
CreateTableInfo createTableInfo) th
         }
         
olapTable.setVerticalCompactionNumColumnsPerGroup(verticalCompactionNumColumnsPerGroup);
 
+        try {
+            if (olapTable instanceof MTMV) {
+                List<TableIf> baseTables = Lists.newArrayList();
+                for (BaseTableInfo baseTable : ((MTMV) 
olapTable).getRelation().getBaseTables()) {
+                    baseTables.add(MTMVUtil.getTable(baseTable));
+                }
+                
properties.putAll(PropertyAnalyzer.inheritVariantEscapeDotsInKeys(properties, 
baseTables, true));

Review Comment:
   已修复,见 f63f7fb5cf5。刷新前的 `MTMVPlanUtil.ensureMTMVQueryUsable` 现在用与创建时相同的规则(同一个 
`PropertyAnalyzer` 函数),检查 MV 已固定的 `variant_escape_dots_in_keys` 与重新生成的 base 
tables 是否一致;不一致则抛 `JobException`,refresh 失败。ALTER VIEW 已使 MV 进入 
`SCHEMA_CHANGE`,失败后保持 `SCHEMA_CHANGE`,不会作为改写候选。`dotted_key_escape_async_mv` 增加了 
legacy MV over view → ALTER VIEW 指向 escaped 表 → refresh 失败、状态为 
SCHEMA_CHANGE、旧数据不变的用例。



##########
fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/commands/CreateTableCommand.java:
##########
@@ -168,6 +169,12 @@ public void validateCreateTableAsSelect(ConnectContext 
ctx, LogicalPlan query) {
         // must disable constant folding by be, because be constant folding 
may return wrong type
         
ctx.getSessionVariable().setVarOnce(SessionVariable.ENABLE_FOLD_CONSTANT_BY_BE, 
"false");
         Plan plan = planner.planWithLock(new UnboundResultSink<>(query), 
PhysicalProperties.ANY, ExplainLevel.NONE);
+        try {
+            
createTableInfo.setProperties(PropertyAnalyzer.inheritVariantEscapeDotsInKeys(

Review Comment:
   已修复,见 f63f7fb5cf5。CTAS 现在在 `validateCreateTableAsSelect` 解析出目标 catalog 
和引擎之后再继承,只对 internal catalog 的 OLAP 
目标注入属性;外部目标不再注入,用户显式写出的属性仍由外部建表的属性检查拒绝。`CreateTableCommandTest` 覆盖了 internal 
继承、external 不注入、external 显式属性被拒绝。



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