[enhancement](stmt-exec) make CTAS use insert timeout fix forward timeout (#25731)
This commit is contained in:
@ -150,6 +150,10 @@ public class CreateTableCommand extends Command implements ForwardWithSync {
|
||||
}
|
||||
}
|
||||
|
||||
public boolean isCtasCommand() {
|
||||
return ctasQuery.isPresent();
|
||||
}
|
||||
|
||||
@Override
|
||||
public <R, C> R accept(PlanVisitor<R, C> visitor, C context) {
|
||||
return visitor.visitCreateTableCommand(this, context);
|
||||
|
||||
@ -748,7 +748,7 @@ public class ConnectContext {
|
||||
} else {
|
||||
String timeoutTag = "query";
|
||||
// insert stmt particularly
|
||||
if (executor != null && executor.isInsertStmt()) {
|
||||
if (executor != null && executor.isSyncLoadKindStmt()) {
|
||||
timeoutTag = "insert";
|
||||
}
|
||||
// to ms
|
||||
@ -802,7 +802,7 @@ public class ConnectContext {
|
||||
* @return exact execution timeout
|
||||
*/
|
||||
public int getExecTimeout() {
|
||||
if (executor != null && executor.isInsertStmt()) {
|
||||
if (executor != null && executor.isSyncLoadKindStmt()) {
|
||||
// particular for insert stmt, we can expand other type of timeout in the same way
|
||||
return Math.max(sessionVariable.getInsertTimeoutS(), sessionVariable.getQueryTimeoutS());
|
||||
} else if (executor != null && executor.isAnalyzeStmt()) {
|
||||
|
||||
@ -122,6 +122,7 @@ import org.apache.doris.nereids.minidump.MinidumpUtils;
|
||||
import org.apache.doris.nereids.parser.NereidsParser;
|
||||
import org.apache.doris.nereids.stats.StatsErrorEstimator;
|
||||
import org.apache.doris.nereids.trees.plans.commands.Command;
|
||||
import org.apache.doris.nereids.trees.plans.commands.CreateTableCommand;
|
||||
import org.apache.doris.nereids.trees.plans.commands.Forward;
|
||||
import org.apache.doris.nereids.trees.plans.commands.InsertIntoTableCommand;
|
||||
import org.apache.doris.nereids.trees.plans.logical.LogicalPlan;
|
||||
@ -395,15 +396,17 @@ public class StmtExecutor {
|
||||
return masterOpExecutor.getProxyStatus();
|
||||
}
|
||||
|
||||
public boolean isInsertStmt() {
|
||||
public boolean isSyncLoadKindStmt() {
|
||||
if (parsedStmt == null) {
|
||||
return false;
|
||||
}
|
||||
if (parsedStmt instanceof LogicalPlanAdapter) {
|
||||
LogicalPlan logicalPlan = ((LogicalPlanAdapter) parsedStmt).getLogicalPlan();
|
||||
return logicalPlan instanceof InsertIntoTableCommand;
|
||||
return logicalPlan instanceof InsertIntoTableCommand
|
||||
|| (logicalPlan instanceof CreateTableCommand
|
||||
&& ((CreateTableCommand) logicalPlan).isCtasCommand());
|
||||
}
|
||||
return parsedStmt instanceof InsertStmt;
|
||||
return parsedStmt instanceof InsertStmt || parsedStmt instanceof CreateTableAsSelectStmt;
|
||||
}
|
||||
|
||||
public boolean isAnalyzeStmt() {
|
||||
|
||||
Reference in New Issue
Block a user