[improvement](statistics)Use defaultSessionVariable instead of clone a new one. (#34672) (#35531)

backport https://github.com/apache/doris/pull/34672

<!--Describe your changes.-->

## Further comments

If this is a relatively large or complex change, kick off the discussion
at [dev@doris.apache.org](mailto:dev@doris.apache.org) by explaining why
you chose the solution you did and what alternatives you considered,
etc...
This commit is contained in:
Jibing-Li
2024-05-28 17:19:38 +08:00
committed by GitHub
parent aa4fd3fd79
commit 69da39b43d

View File

@ -755,7 +755,7 @@ public class StatisticsUtil {
}
protected static SessionVariable findConfigFromGlobalSessionVar(String varName) throws Exception {
SessionVariable sessionVariable = VariableMgr.newSessionVariable();
SessionVariable sessionVariable = VariableMgr.getDefaultSessionVariable();
VariableExpr variableExpr = new VariableExpr(varName, SetType.GLOBAL);
VariableMgr.getValue(sessionVariable, variableExpr);
return sessionVariable;