Commit f902540
committed
Add setContextClassLoader wrapper to QueryService Calcite paths
The analyze() and convertToCalcitePlan() steps in executeWithCalcite()
and explainWithCalcite() trigger RexSimplify which uses Janino for
constant folding. Without the context classloader set, UDF expressions
like SAFE_CAST('TRUE') can't be folded, causing explain plan differences
vs main branch. Adding the wrapper here covers the entire Calcite
lifecycle for both execute and explain paths.
Revert the separate boolean string literal YAML since all three boolean
tests now produce the same plan (SAFE_CAST folds correctly).
Signed-off-by: Kai Huang <ahkcs@amazon.com>1 parent 7187f0b commit f902540
File tree
3 files changed
+40
-32
lines changed- core/src/main/java/org/opensearch/sql/executor
- integ-test/src/test
- java/org/opensearch/sql/calcite/remote
- resources/expectedOutput/calcite
3 files changed
+40
-32
lines changedLines changed: 37 additions & 19 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
139 | 139 | | |
140 | 140 | | |
141 | 141 | | |
142 | | - | |
143 | | - | |
144 | | - | |
145 | | - | |
146 | | - | |
147 | | - | |
148 | | - | |
149 | | - | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
150 | 159 | | |
151 | 160 | | |
152 | 161 | | |
| |||
169 | 178 | | |
170 | 179 | | |
171 | 180 | | |
172 | | - | |
173 | | - | |
174 | | - | |
175 | | - | |
176 | | - | |
177 | | - | |
178 | | - | |
179 | | - | |
180 | | - | |
181 | | - | |
182 | | - | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
183 | 201 | | |
184 | 202 | | |
185 | 203 | | |
| |||
Lines changed: 3 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2735 | 2735 | | |
2736 | 2736 | | |
2737 | 2737 | | |
2738 | | - | |
2739 | | - | |
| 2738 | + | |
| 2739 | + | |
2740 | 2740 | | |
2741 | 2741 | | |
2742 | 2742 | | |
2743 | 2743 | | |
2744 | | - | |
2745 | | - | |
| 2744 | + | |
2746 | 2745 | | |
2747 | 2746 | | |
2748 | 2747 | | |
| |||
Lines changed: 0 additions & 9 deletions
This file was deleted.
0 commit comments