Commit 17ee6d3
committed
Restrict ROW_NUMBER tie-break to comparable columns + sync no-pushdown fixtures
Three follow-ups to the rare/top tie-break commit, surfaced by CI:
1. **Skip non-comparable tie-break columns.** `top address` on a nested-array
field reached the in-process `EnumerableWindow` with `ORDER BY count DESC,
address` and crashed at runtime — `class java.util.ArrayList cannot be cast
to class java.lang.Comparable`. Filter array / multiset / map / struct (row)
columns out of the tie-break list before appending. If all field columns are
non-comparable, no tie-break is added (falling back to the original
count-only ORDER BY).
2. **Sync the parallel `calcite_no_pushdown/` explain fixtures.**
`PPLIntegTestCase.loadExpectedPlan` switches to
`expectedOutput/calcite_no_pushdown/` when pushdown is disabled, which
`CalciteNoPushdownIT` exercises. The previous commit only updated the
`expectedOutput/calcite/` copies, so `CalciteNoPushdownIT > CalciteExplainIT`
read stale (no-tie-break) YAML. Update the four `explain_{rare,top}_usenull_*`
YAMLs under `calcite_no_pushdown/` to include the `, $N` tie-break key in
both the logical plan and the `EnumerableWindow` collation.
3. **Collapse the pushdown-disabled branch in `RareCommandIT.testRareWithGroup`.**
With the stable tie-break, both pushdown-enabled and pushdown-disabled paths
now resolve the count=8 tie deterministically to `AR` (alphabetical). Drop
the `isPushdownDisabled() ? rows("F", "NV", 8) : rows("F", "AR", 8)`
conditional in favor of the single `AR` expectation.
Signed-off-by: Kai Huang <huangkaics@gmail.com>1 parent 1b19dd3 commit 17ee6d3
6 files changed
Lines changed: 25 additions & 10 deletions
File tree
- core/src/main/java/org/opensearch/sql/calcite
- integ-test/src/test
- java/org/opensearch/sql/ppl
- resources/expectedOutput/calcite_no_pushdown
Lines changed: 16 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3044 | 3044 | | |
3045 | 3045 | | |
3046 | 3046 | | |
3047 | | - | |
| 3047 | + | |
| 3048 | + | |
| 3049 | + | |
| 3050 | + | |
| 3051 | + | |
| 3052 | + | |
| 3053 | + | |
3048 | 3054 | | |
3049 | 3055 | | |
3050 | 3056 | | |
| |||
3080 | 3086 | | |
3081 | 3087 | | |
3082 | 3088 | | |
| 3089 | + | |
| 3090 | + | |
| 3091 | + | |
| 3092 | + | |
| 3093 | + | |
| 3094 | + | |
| 3095 | + | |
| 3096 | + | |
| 3097 | + | |
3083 | 3098 | | |
3084 | 3099 | | |
3085 | 3100 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
62 | | - | |
| 62 | + | |
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
| |||
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
| 6 | + | |
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
| 14 | + | |
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
| 6 | + | |
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
| 13 | + | |
14 | 14 | | |
15 | 15 | | |
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
| 6 | + | |
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
| 14 | + | |
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
| 6 | + | |
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
| 13 | + | |
14 | 14 | | |
15 | 15 | | |
0 commit comments