Skip to content

Commit

Permalink
3
Browse files Browse the repository at this point in the history
  • Loading branch information
xinyiZzz committed Dec 13, 2024
1 parent f5d0417 commit 7930dd6
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions fe/fe-core/src/main/java/org/apache/doris/qe/ConnectContext.java
Original file line number Diff line number Diff line change
Expand Up @@ -820,14 +820,6 @@ public void addReturnResultFromRemoteExecutor(StmtExecutor executor) {

public void finalizeArrowFlightSqlRequest() {
setThreadLocalInfo();
for (StmtExecutor asynExecutor : returnResultFromRemoteExecutor) {
asynExecutor.finalizeQuery();
}
returnResultFromRemoteExecutor.clear();
// In most cases, `executor.finalizeQuery` is redundant and will be skipped directly.
// Because the query returning results from BE will execute `returnResultFromRemoteExecutor.finalizeQuery`,
// and the query returning results from FE and `insert into` will call unregisterQuery after execute.
executor.finalizeQuery();
if (executor != null && executor.getParsedStmt() != null && !executor.getParsedStmt().isExplain()
&& (executor.getParsedStmt() instanceof QueryStmt // currently only QueryStmt and insert need profile
|| executor.getParsedStmt() instanceof LogicalPlanAdapter
Expand All @@ -838,6 +830,15 @@ public void finalizeArrowFlightSqlRequest() {
}
}

for (StmtExecutor asynExecutor : returnResultFromRemoteExecutor) {
asynExecutor.finalizeQuery();
}
returnResultFromRemoteExecutor.clear();
// In most cases, `executor.finalizeQuery` is redundant and will be skipped directly.
// Because the query returning results from BE will execute `returnResultFromRemoteExecutor.finalizeQuery`,
// and the query returning results from FE and `insert into` will call unregisterQuery after execute.
executor.finalizeQuery();

remove();
setCommand(MysqlCommand.COM_SLEEP);
clear();
Expand Down

0 comments on commit 7930dd6

Please sign in to comment.