Commit 5007125
committed
Emit list() for mvcombine so it runs on the analytics engine
mvcombine lowered to Calcite ARRAY_AGG with an explicit IS NOT NULL
filter. The analytics-engine (DataFusion) route cannot execute that
shape: Calcite ARRAY_AGG infers a nullable-element ARRAY while the
engine's array_agg operator infers a NOT NULL element, and the two
cannot be reconciled during the aggregate rewrite.
Switch performArrayAggAggregation to emit the existing PPL list()
aggregate (PPLBuiltinOperators.LIST), which the analytics engine already
supports. ListAggFunction drops null values internally, so the explicit
IS NOT NULL filter is no longer needed.
Behavior note: the combined field is now ARRAY<VARCHAR> (list()
stringifies elements) and is capped at 100 values per group, matching
list()'s documented contract.
CalcitePPLMvCombineTest logical-plan and SparkSQL expectations updated
for the LIST aggregate.
Document the list()-based output (strings, 100-value cap, unordered) in
mvcombine.md.
Signed-off-by: Louis Chu <lingzhichu.clz@gmail.com>1 parent de95ffb commit 5007125
3 files changed
Lines changed: 27 additions & 30 deletions
File tree
- core/src/main/java/org/opensearch/sql/calcite
- docs/user/ppl/cmd
- ppl/src/test/java/org/opensearch/sql/ppl/calcite
Lines changed: 5 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
73 | 73 | | |
74 | 74 | | |
75 | 75 | | |
76 | | - | |
77 | 76 | | |
78 | 77 | | |
79 | 78 | | |
| |||
4498 | 4497 | | |
4499 | 4498 | | |
4500 | 4499 | | |
4501 | | - | |
4502 | | - | |
| 4500 | + | |
| 4501 | + | |
| 4502 | + | |
| 4503 | + | |
4503 | 4504 | | |
4504 | | - | |
4505 | | - | |
4506 | | - | |
4507 | | - | |
| 4505 | + | |
4508 | 4506 | | |
4509 | 4507 | | |
4510 | 4508 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
108 | 108 | | |
109 | 109 | | |
110 | 110 | | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
111 | 115 | | |
112 | 116 | | |
113 | 117 | | |
| |||
Lines changed: 18 additions & 23 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
85 | 85 | | |
86 | 86 | | |
87 | 87 | | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
92 | 91 | | |
93 | 92 | | |
94 | 93 | | |
95 | | - | |
| 94 | + | |
96 | 95 | | |
97 | 96 | | |
98 | 97 | | |
| |||
114 | 113 | | |
115 | 114 | | |
116 | 115 | | |
117 | | - | |
118 | | - | |
119 | | - | |
120 | | - | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
121 | 119 | | |
122 | 120 | | |
123 | 121 | | |
124 | | - | |
| 122 | + | |
125 | 123 | | |
126 | 124 | | |
127 | 125 | | |
| |||
143 | 141 | | |
144 | 142 | | |
145 | 143 | | |
146 | | - | |
147 | | - | |
148 | | - | |
149 | | - | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
150 | 147 | | |
151 | 148 | | |
152 | 149 | | |
153 | | - | |
| 150 | + | |
154 | 151 | | |
155 | 152 | | |
156 | 153 | | |
| |||
188 | 185 | | |
189 | 186 | | |
190 | 187 | | |
191 | | - | |
192 | | - | |
193 | | - | |
194 | | - | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
195 | 191 | | |
196 | 192 | | |
197 | 193 | | |
| |||
209 | 205 | | |
210 | 206 | | |
211 | 207 | | |
212 | | - | |
213 | | - | |
214 | | - | |
215 | | - | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
216 | 211 | | |
217 | 212 | | |
218 | 213 | | |
| |||
0 commit comments