Commit be129ec
authored
Map Calcite ROW to STRUCT in convertSqlTypeNameToExprType (#5737)
convertExprTypeToRelDataType builds STRUCT as MAP<VARCHAR, ANY>, since the v2
path only passes _source JSON through and needs no field types. So the reverse
mapping only had `case MAP -> STRUCT` — a genuine Calcite ROW matched nothing,
fell through to `default -> UNKNOWN`, and surfaced as "type": "unknown" in the
response schema.
That is reachable from the analytics engine, which materializes an `object`
field as a real ROW built from typed columns. Before, `fields city` reported
"unknown"; now "struct", matching what a lucene-only cluster returns for the
same mapping.
Signed-off-by: Marc Handalian <handalm@amazon.com>
Signed-off-by: Marc Handalian <marc.handalian@gmail.com>1 parent be527b5 commit be129ec
2 files changed
Lines changed: 11 additions & 0 deletions
File tree
- core/src
- main/java/org/opensearch/sql/calcite/utils
- test/java/org/opensearch/sql/calcite/utils
Lines changed: 5 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
252 | 252 | | |
253 | 253 | | |
254 | 254 | | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
255 | 260 | | |
256 | 261 | | |
257 | 262 | | |
| |||
Lines changed: 6 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
286 | 286 | | |
287 | 287 | | |
288 | 288 | | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
289 | 295 | | |
290 | 296 | | |
291 | 297 | | |
| |||
0 commit comments