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


##########
fe/fe-core/src/main/java/org/apache/doris/qe/StmtExecutor.java:
##########
@@ -2076,6 +2092,160 @@ private void handleCtasRollback(TableName table) {
         }
     }
 
+    private void handleIotStmt() {
+        InsertOverwriteTableStmt iotStmt = (InsertOverwriteTableStmt) 
this.parsedStmt;
+        if (iotStmt.getPartitionNames().size() == 0) {
+            // insert overwrite table
+            handleOverwriteTable(iotStmt);
+        } else {
+            // insert overwrite table with partition
+            handleOverwritePartition(iotStmt);
+        }
+    }
+
+    private void handleOverwriteTable(InsertOverwriteTableStmt iotStmt) {
+        UUID uuid = UUID.randomUUID();
+        // to comply with naming rules
+        TableName tmpTableName = new TableName(null, iotStmt.getDb(), 
"tmp_table_" + uuid.toString().replace('-', '_'));
+        TableName targetTableName = new TableName(null, iotStmt.getDb(), 
iotStmt.getTbl());
+        try {
+            // create a tmp table with uuid
+            parsedStmt = new CreateTableLikeStmt(false, tmpTableName, 
targetTableName, null, false);
+            parsedStmt.setUserInfo(context.getCurrentUserIdentity());
+            execute();

Review Comment:
   After calling `execute()`. You need to check `if 
(MysqlStateType.ERR.equals(context.getState().getStateType()))`.
   



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

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


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

Reply via email to