File tree Expand file tree Collapse file tree
core/src/main/java/org/opensearch/sql/calcite
opensearch/src/main/java/org/opensearch/sql/opensearch Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -36,7 +36,7 @@ public class CalcitePlanContext {
3636 public final QueryType queryType ;
3737 public final Integer querySizeLimit ;
3838
39- public static final ThreadLocal <Boolean > isExplain = ThreadLocal .withInitial (() -> false );
39+ public static final ThreadLocal <Boolean > skipEncoding = ThreadLocal .withInitial (() -> false );
4040
4141 @ Getter @ Setter private boolean isResolvingJoinCondition = false ;
4242 @ Getter @ Setter private boolean isResolvingSubquery = false ;
Original file line number Diff line number Diff line change @@ -172,7 +172,7 @@ public void explain(
172172 try (Hook .Closeable closeable = getPhysicalPlanInHook (physical , level )) {
173173 if (format == ExplainFormat .EXTENDED ) {
174174 getCodegenInHook (javaCode );
175- CalcitePlanContext .isExplain .set (true );
175+ CalcitePlanContext .skipEncoding .set (true );
176176 }
177177 // triggers the hook
178178 AccessController .doPrivileged (
@@ -186,7 +186,7 @@ public void explain(
186186 } catch (Exception e ) {
187187 listener .onFailure (e );
188188 } finally {
189- CalcitePlanContext .isExplain .remove ();
189+ CalcitePlanContext .skipEncoding .remove ();
190190 }
191191 });
192192 }
Original file line number Diff line number Diff line change @@ -95,7 +95,7 @@ public String serialize(
9595 ObjectOutputStream objectOutput = new ObjectOutputStream (output );
9696 objectOutput .writeObject (envelope );
9797 objectOutput .flush ();
98- return CalcitePlanContext .isExplain .get ()
98+ return CalcitePlanContext .skipEncoding .get ()
9999 ? rexNodeJson
100100 : Base64 .getEncoder ().encodeToString (output .toByteArray ());
101101 } catch (Exception e ) {
You can’t perform that action at this time.
0 commit comments