morningman commented on code in PR #16255:
URL: https://github.com/apache/doris/pull/16255#discussion_r1098082609


##########
fe/fe-core/src/main/java/org/apache/doris/qe/SessionVariable.java:
##########
@@ -262,6 +262,7 @@ public class SessionVariable implements Serializable, 
Writable {
     public static final String ENABLE_FILE_CACHE = "enable_file_cache";
 
     public static final String GROUP_BY_AND_HAVING_USE_ALIAS_FIRST = 
"group_by_and_having_use_alias_first";
+    public static final String ENABLE_CTAS_ERROR_DROP_TABLE = 
"enable_ctas_error_drop_table";

Review Comment:
   How about:
   drop_table_if_ctas_failed



##########
fe/fe-core/src/main/java/org/apache/doris/qe/StmtExecutor.java:
##########
@@ -1954,18 +1955,27 @@ private void handleCtasStmt() {
             try {
                 parsedStmt = ctasStmt.getInsertStmt();
                 execute();
+                if 
(MysqlStateType.ERR.equals(context.getState().getStateType())) {
+                    LOG.warn("CTAS insert data error, stmt={}", 
ctasStmt.toSql());
+                    
handleCtasRollback(ctasStmt.getCreateTableStmt().getDbTbl());
+                }
             } catch (Exception e) {
                 e.printStackTrace();

Review Comment:
   remove this e.printStackTrace()



##########
fe/fe-core/src/main/java/org/apache/doris/qe/SessionVariable.java:
##########
@@ -691,6 +692,10 @@ public class SessionVariable implements Serializable, 
Writable {
     @VariableMgr.VarAttr(name = ENABLE_FILE_CACHE, needForward = true)
     public boolean enableFileCache = true;
 
+    // Whether drop table when create table as select insert data appear error.
+    @VariableMgr.VarAttr(name = ENABLE_CTAS_ERROR_DROP_TABLE)

Review Comment:
   ```suggestion
       @VariableMgr.VarAttr(name = ENABLE_CTAS_ERROR_DROP_TABLE 
needForward=true)
   ```



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