zddr commented on code in PR #53462:
URL: https://github.com/apache/doris/pull/53462#discussion_r2212909602
##########
fe/fe-core/src/main/java/org/apache/doris/qe/SessionVariable.java:
##########
@@ -4419,6 +4419,70 @@ public void readFromJson(String json) throws IOException
{
}
}
+ public Map<String, String> getAffectQueryResultVariables() {
+ HashMap<String, String> map = new HashMap<String, String>();
+ try {
+ Field[] fields = SessionVariable.class.getDeclaredFields();
+ for (Field f : fields) {
+ VarAttr varAttr = f.getAnnotation(VarAttr.class);
+ if (varAttr == null || !varAttr.affectQueryResult()) {
+ continue;
+ }
+ map.put(varAttr.name(), String.valueOf(f.get(this)));
+ }
+ } catch (IllegalAccessException e) {
+ LOG.error("failed to get affect query result variables", e);
+ }
+ return map;
+ }
+
+ public void setAffectQueryResultSessionVariables(Map<String, String>
variables) {
+ try {
+ Field[] fields = SessionVariable.class.getDeclaredFields();
+ for (Field f : fields) {
+ f.setAccessible(true);
+ VarAttr varAttr = f.getAnnotation(VarAttr.class);
+ if (varAttr == null || !varAttr.affectQueryResult()) {
+ continue;
+ }
+ String val = variables.get(varAttr.name());
+ if (val == null) {
+ continue;
Review Comment:
Before setting, it is the default value, not copied from global
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]