feiniaofeiafei commented on code in PR #67809:
URL: https://github.com/apache/doris/pull/67809#discussion_r4044512421


##########
fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/commands/info/CreateTableInfo.java:
##########
@@ -1140,24 +1141,27 @@ private void generatedColumnCheck(ConnectContext ctx) {
             if (!info.isPresent()) {
                 continue;
             }
-            Expression parsedExpression = info.get().getExpression();
-            checkParsedExpressionInGeneratedColumn(parsedExpression);
-            Expression boundSlotExpression = 
SlotReplacer.INSTANCE.replace(parsedExpression, columnToSlotReference);
-            Scope scope = new Scope(slots);
-            ExpressionAnalyzer analyzer = new ExpressionAnalyzer(null, scope, 
cascadesContext, false, false);
-            Expression expr;
-            try {
-                expr = analyzer.analyze(boundSlotExpression, new 
ExpressionRewriteContext(cascadesContext));
-            } catch (AnalysisException e) {
-                throw new AnalysisException("In generated column '" + 
column.getName() + "', "
-                        + Utils.convertFirstChar(e.getMessage()));
-            }
-            checkExpressionInGeneratedColumn(expr, column, 
nameToColumnDefinition);
-            TypeCoercionUtils.checkCanCastTo(expr.getDataType(), 
column.getType());
-            ExpressionToExpr translator = new ExpressionToExpr(i, 
translateMap);
-            Expr e = expr.accept(translator, planTranslatorContext);
-            info.get().setExpr(e);
-            exprAndNames.add(new ExprAndName(e.clone(), column.getName()));
+            try (AutoCloseSessionVariable autoClose = new 
AutoCloseSessionVariable(ctx,

Review Comment:
   should report error  for this "CREATE TABLE dst LIKE src; " in : 
   ```sql
   SET enable_decimal256 = true;
   CREATE TABLE src (
       k INT,
       g DECIMAL(40,0) AS (k)
   )
   DISTRIBUTED BY HASH(k) BUCKETS 1
   PROPERTIES ("replication_num" = "1");
   
   SET enable_decimal256 = false;
   CREATE TABLE dst LIKE src; 
   ```



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