Skip to content

Commit

Permalink
[Enhancement] Improve insert timeout error message (#53011)
Browse files Browse the repository at this point in the history
Signed-off-by: wyb <[email protected]>
  • Loading branch information
wyb authored Nov 21, 2024
1 parent c7ae18d commit d6647e9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions fe/fe-core/src/main/java/com/starrocks/qe/StmtExecutor.java
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@
import com.starrocks.sql.ast.InsertStmt;
import com.starrocks.sql.ast.KillAnalyzeStmt;
import com.starrocks.sql.ast.KillStmt;
import com.starrocks.sql.ast.LoadStmt;
import com.starrocks.sql.ast.PrepareStmt;
import com.starrocks.sql.ast.QueryStatement;
import com.starrocks.sql.ast.SetCatalogStmt;
Expand Down Expand Up @@ -2391,8 +2392,9 @@ public void handleDMLStmt(ExecPlan execPlan, DmlStmt stmt) throws Exception {
"or set parallel_fragment_exec_instance_num to a lower value in session variable");
} else {
ErrorReport.reportTimeoutException(ErrorCode.ERR_TIMEOUT, getExecType(), timeout,
String.format("please increase the '%s' session variable and retry",
SessionVariable.INSERT_TIMEOUT));
String.format("please increase the '%s' session variable or the '%s' property for " +
"insert statement and retry",
SessionVariable.INSERT_TIMEOUT, LoadStmt.TIMEOUT_PROPERTY));
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion test/sql/test_insert_empty/R/test_insert_timeout
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ create table t1(k1 int);
set insert_timeout = 2;
insert into t1 select sleep(4);
-- result:
[REGEX].*Insert reached its timeout of 2 seconds, please increase the 'insert_timeout' session variable.*
[REGEX].*Insert reached its timeout of 2 seconds, please increase the 'insert_timeout' session variable or the 'timeout' property for insert statement.*
-- !result

set insert_timeout = 10;
Expand Down

0 comments on commit d6647e9

Please sign in to comment.