Skip to content

Commit

Permalink
branch-3.0: [fix](Export) Clone SessionVariable for each ExportTask…
Browse files Browse the repository at this point in the history
…Executor #48239 (#48254)

Cherry-picked from #48239

Co-authored-by: Tiewei Fang <[email protected]>
  • Loading branch information
github-actions[bot] and BePPPower authored Feb 26, 2025
1 parent fae68ae commit 27f4500
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
import org.apache.doris.qe.ConnectContext;
import org.apache.doris.qe.QueryState.MysqlStateType;
import org.apache.doris.qe.StmtExecutor;
import org.apache.doris.qe.VariableMgr;
import org.apache.doris.scheduler.exception.JobException;
import org.apache.doris.scheduler.executor.TransientTaskExecutor;
import org.apache.doris.thrift.TStatusCode;
Expand Down Expand Up @@ -199,7 +200,7 @@ public void cancel() throws JobException {
private AutoCloseConnectContext buildConnectContext() {
ConnectContext connectContext = new ConnectContext();
exportJob.getSessionVariables().setQueryTimeoutS(exportJob.getTimeoutSecond());
connectContext.setSessionVariable(exportJob.getSessionVariables());
connectContext.setSessionVariable(VariableMgr.cloneSessionVariable(exportJob.getSessionVariables()));
// The rollback to the old optimizer is prohibited
// Since originStmt is empty, reverting to the old optimizer when the new optimizer is enabled is meaningless.
connectContext.setEnv(Env.getCurrentEnv());
Expand Down

0 comments on commit 27f4500

Please sign in to comment.