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


##########
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:
   [P1] Recheck MV codec compatibility when its source relations change
   
   This check runs only during CREATE. Create a legacy MV over a view, `ALTER 
VIEW` to read an escaped table with the same Variant schema, then refresh the 
MV: `MTMVTask` regenerates the relations and `ensureMTMVQueryUsable` checks 
only types/partitions, so the refresh succeeds while writing `{"a.b":7}` into 
the legacy MV as `{"a":{"b":7}}`. Success returns the MV to `NORMAL` and 
permits rewrites against the changed value. Revalidate regenerated sources 
against the fixed MV policy before refresh; add a view-retargeting regression.



##########
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:
   [P2] Limit automatic codec inheritance to OLAP CTAS destinations
   
   This also runs for external CTAS: an escaped internal source causes `CREATE 
TABLE hive_catalog.db.copy AS SELECT k FROM internal.db.source` to receive 
`variant_escape_dots_in_keys=true`, even for an integer-only projection. The 
subsequent `PluginDrivenExternalCatalog` property validation rejects that 
injected key, breaking an otherwise supported CTAS without any explicit OLAP 
property. Resolve the destination first and inherit only for OLAP targets; keep 
external rejection for explicitly supplied properties.



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