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


##########
fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/commands/CreateTableCommand.java:
##########
@@ -236,6 +237,15 @@ public void validateCreateTableAsSelect(ConnectContext 
ctx, LogicalPlan query) {
         }
         List<String> qualifierTableName = RelationUtil.getQualifierName(ctx, 
createTableInfo.getTableNameParts());
         createTableInfo.validateCreateTableAsSelect(qualifierTableName, 
columnsOfQuery.build(), ctx);
+        if (!createTableInfo.isExternal()
+                && 
CreateTableInfo.ENGINE_OLAP.equalsIgnoreCase(createTableInfo.getEngineName())) {
+            try {
+                
createTableInfo.setProperties(PropertyAnalyzer.inheritVariantEscapeDotsInKeys(

Review Comment:
   [P2] Adapt inferred Variant templates before inheriting the codec
   
   A direct CTAS can retain a legacy storage template while this code changes 
its interpretation:
   
   ```text
   CTAS dst
     Project(l.k, l.v)
       Join(l.k = e.k)
         Scan legacy l (v: VARIANT<MATCH_NAME '50%':STRING>)
         Scan escaped e (k: INT)
   ```
   
   With NestedGroup disabled on `l.v`, `CREATE TABLE dst ... AS SELECT l.k,l.v 
FROM l JOIN e ON l.k=e.k` keeps the legal `50%` template through 
`s.getDataType().conversion()`. This inheritance sets the destination policy to 
true even though `e` has no VARIANT column. `InternalCatalog.createOlapTable` 
then calls `validateVariantTable`, whose strict decoder rejects the unchanged 
template with `Invalid escaped Variant path component`. An otherwise supported 
internal CTAS therefore fails without an explicit codec property. Translate 
retained templates to the target storage namespace, or remove storage-only 
templates from the inferred type, and add this mixed-source percent-template 
case.



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