Commit 1dc92d6
authored
Return 4xx instead of 500 for unsupported window functions (#5587)
Window functions outside WINDOW_FUNC_MAPPING (e.g. RANK) used to escape
the AE route as HTTP 500 because the throw site emitted a raw
UnsupportedOperationException, which UnifiedQueryPlanner rethrows
unchanged. Switching to CalciteUnsupportedException lets the existing
4xx wrapper added in #5569 normalize it to SemanticCheckException.
Repro:
SELECT RegionID, COUNT(*) AS cnt,
RANK() OVER (ORDER BY COUNT(*) DESC) AS rnk
FROM clickbench GROUP BY RegionID LIMIT 5
Signed-off-by: Michael Oviedo <mikeovi@amazon.com>1 parent 0a4d40e commit 1dc92d6
2 files changed
Lines changed: 13 additions & 1 deletion
File tree
- api/src/test/java/org/opensearch/sql/api
- core/src/main/java/org/opensearch/sql/calcite
Lines changed: 12 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
159 | 159 | | |
160 | 160 | | |
161 | 161 | | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
162 | 174 | | |
163 | 175 | | |
164 | 176 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
705 | 705 | | |
706 | 706 | | |
707 | 707 | | |
708 | | - | |
| 708 | + | |
709 | 709 | | |
710 | 710 | | |
711 | 711 | | |
| |||
0 commit comments