Commit b1c5970
committed
fix(calcite): handle Limit, Alias projection, RelationSubquery, and Values dual-table in visitor
Add visitLimit to support LIMIT/OFFSET clauses. Handle Alias nodes in
project list by referencing already-computed aggregate fields instead of
re-analyzing. Add visitRelationSubquery for derived tables in FROM
clause. Fix visitValues to treat a single empty row as a dual-table
(SELECT without FROM). Make bucketNullable lookup null-safe with
getOrDefault in visitAggregation.
Add integration tests covering LIMIT OFFSET, aggregate with alias,
GROUP BY without bucket nullable, SELECT with alias, derived table
subquery, and SELECT without FROM clause.
Signed-off-by: Chen Dai <daichen@amazon.com>1 parent 6421658 commit b1c5970
2 files changed
Lines changed: 136 additions & 4 deletions
File tree
- api/src/test/java/org/opensearch/sql/api
- core/src/main/java/org/opensearch/sql/calcite
Lines changed: 92 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
259 | 259 | | |
260 | 260 | | |
261 | 261 | | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
262 | 354 | | |
Lines changed: 44 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
132 | 132 | | |
133 | 133 | | |
134 | 134 | | |
| 135 | + | |
135 | 136 | | |
136 | 137 | | |
137 | 138 | | |
| |||
146 | 147 | | |
147 | 148 | | |
148 | 149 | | |
| 150 | + | |
149 | 151 | | |
150 | 152 | | |
151 | 153 | | |
| |||
541 | 543 | | |
542 | 544 | | |
543 | 545 | | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
544 | 565 | | |
545 | 566 | | |
546 | 567 | | |
| |||
763 | 784 | | |
764 | 785 | | |
765 | 786 | | |
| 787 | + | |
| 788 | + | |
| 789 | + | |
| 790 | + | |
| 791 | + | |
| 792 | + | |
| 793 | + | |
766 | 794 | | |
767 | 795 | | |
768 | 796 | | |
| |||
1621 | 1649 | | |
1622 | 1650 | | |
1623 | 1651 | | |
1624 | | - | |
| 1652 | + | |
| 1653 | + | |
1625 | 1654 | | |
1626 | 1655 | | |
1627 | 1656 | | |
| |||
1928 | 1957 | | |
1929 | 1958 | | |
1930 | 1959 | | |
| 1960 | + | |
| 1961 | + | |
| 1962 | + | |
| 1963 | + | |
| 1964 | + | |
| 1965 | + | |
| 1966 | + | |
| 1967 | + | |
| 1968 | + | |
1931 | 1969 | | |
1932 | 1970 | | |
1933 | 1971 | | |
| |||
4122 | 4160 | | |
4123 | 4161 | | |
4124 | 4162 | | |
4125 | | - | |
| 4163 | + | |
| 4164 | + | |
| 4165 | + | |
| 4166 | + | |
4126 | 4167 | | |
4127 | 4168 | | |
4128 | | - | |
4129 | | - | |
4130 | 4169 | | |
| 4170 | + | |
4131 | 4171 | | |
4132 | 4172 | | |
4133 | 4173 | | |
| |||
0 commit comments