You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by GitBox <gi...@apache.org> on 2022/04/03 13:13:48 UTC

[GitHub] [incubator-doris] morningman commented on a change in pull request #8838: [fix](ut) fix fe run CreateTableAsSelectStmtTest failed

morningman commented on a change in pull request #8838:
URL: https://github.com/apache/incubator-doris/pull/8838#discussion_r841220750



##########
File path: fe/fe-core/src/main/java/org/apache/doris/analysis/FunctionCallExpr.java
##########
@@ -246,7 +246,7 @@ private String paramsToSql(FunctionParams params) {
         if (params.isDistinct()) {
             sb.append("DISTINCT ");
         }
-        int len = params.exprs().size();

Review comment:
       Looks like we don't need `params` as the parameter of this method.
   Because `fnParams` is a field of this class.

##########
File path: fe/fe-core/src/main/java/org/apache/doris/catalog/Catalog.java
##########
@@ -3116,12 +3116,12 @@ public void createTableAsSelect(CreateTableAsSelectStmt stmt) throws DdlExceptio
                 }
                 TypeDef typeDef;
                 Expr resultExpr = resultExprs.get(i);
-                // varchar/char transfer to string
-                if (resultExpr.getType().isStringType()) {
+                if (resultExpr.getType().isStringType() && resultExpr.getType().getLength() < 0) {
                     typeDef = new TypeDef(Type.STRING);
-                } else {
+                }  else {
                     typeDef = new TypeDef(resultExpr.getType());
                 }
+                typeDef = new TypeDef(resultExpr.getType());

Review comment:
       Duplicate line?

##########
File path: fe/fe-core/src/main/java/org/apache/doris/catalog/Catalog.java
##########
@@ -3116,12 +3116,12 @@ public void createTableAsSelect(CreateTableAsSelectStmt stmt) throws DdlExceptio
                 }
                 TypeDef typeDef;
                 Expr resultExpr = resultExprs.get(i);
-                // varchar/char transfer to string
-                if (resultExpr.getType().isStringType()) {
+                if (resultExpr.getType().isStringType() && resultExpr.getType().getLength() < 0) {

Review comment:
       Why adding `resultExpr.getType().getLength() < 0` condition?
   If this is a bug, please described in issue.




-- 
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-unsubscribe@doris.apache.org

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



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