From 79423ba4c5045328cd60096fbdb40e16b1c44129 Mon Sep 17 00:00:00 2001 From: Lei Zhang <27994433+SWJTU-ZhangLei@users.noreply.github.com> Date: Fri, 10 Nov 2023 20:47:37 +0800 Subject: [PATCH] [fix](fe) Fix `enable_nereids_planner` forward not take effect * The java reflection method `getFields()` only return public fields, but enable_nereids_planner is private --- .../src/main/java/org/apache/doris/qe/SessionVariable.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fe/fe-core/src/main/java/org/apache/doris/qe/SessionVariable.java b/fe/fe-core/src/main/java/org/apache/doris/qe/SessionVariable.java index b4c117874ff08d5..b5b66683780c371 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/qe/SessionVariable.java +++ b/fe/fe-core/src/main/java/org/apache/doris/qe/SessionVariable.java @@ -2664,8 +2664,9 @@ public Map getForwardVariables() { **/ public void setForwardedSessionVariables(Map variables) { try { - Field[] fields = SessionVariable.class.getFields(); + Field[] fields = SessionVariable.class.getDeclaredFields(); for (Field f : fields) { + f.setAccessible(true); VarAttr varAttr = f.getAnnotation(VarAttr.class); if (varAttr == null || !varAttr.needForward()) { continue;