Repository navigation
Commit 9df7153
Follow a leaf through a cast everywhere, not just where it is allowed
Reading a leaf as a number is allowed, so the check strips a cast before
deciding that. Two other places ask the same question -- which column a
read went into, and what to call it -- and neither stripped the cast. A
cast leaf therefore reached pushdown untracked, where a script over a
flat_object cannot be built, and the failure surfaced as
HTTP 500, code UNKNOWN
java.sql.SQLException: ... A flat_object field cannot be read by a
pushed-down script: attributes
for a query such as
source=otel | eval d = cast(attributes.duration_ms as double)
| sort d | fields service
which now reports "Cannot sort by attributes.duration_ms" like the rest.
The three callers share one stripCasts so they cannot drift again.
Signed-off-by: Jialiang Liang <jiallian@amazon.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HHurdipg7MHo61tquK7BpD
Signed-off-by: Jialiang Liang <ryanleeang@gmail.com>1 parent f5fb75e commit 9df7153
2 files changed
Lines changed: 31 additions & 7 deletions
File tree
- core/src
- main/java/org/opensearch/sql/calcite
- test/java/org/opensearch/sql/calcite
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
158 | 158 | | |
159 | 159 | | |
160 | 160 | | |
161 | | - | |
| 161 | + | |
162 | 162 | | |
163 | 163 | | |
164 | 164 | | |
| |||
178 | 178 | | |
179 | 179 | | |
180 | 180 | | |
181 | | - | |
182 | | - | |
183 | | - | |
184 | | - | |
185 | | - | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
186 | 187 | | |
187 | 188 | | |
188 | 189 | | |
189 | 190 | | |
190 | 191 | | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
191 | 201 | | |
192 | 202 | | |
193 | 203 | | |
| |||
262 | 272 | | |
263 | 273 | | |
264 | 274 | | |
265 | | - | |
| 275 | + | |
266 | 276 | | |
267 | 277 | | |
268 | 278 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
163 | 163 | | |
164 | 164 | | |
165 | 165 | | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
166 | 180 | | |
167 | 181 | | |
168 | 182 | | |
| |||
0 commit comments