Commit 7dca5cc
authored
fix: Honor PPL fetch_size on the analytics-engine route (#5567)
* fix: Honor PPL fetch_size on the analytics-engine route
PPL's fetch_size caps a response to N rows (no cursor) — the V2 path lowers it
to a top-level `head N` in AstStatementBuilder.visitPplStatement. The
analytics-engine route bypasses that builder: TransportPPLQueryAction forwards
only the query string to RestUnifiedQueryAction.execute(), so fetch_size was
dropped and the engine returned the full result set.
Thread the request's fetchSize through execute() and apply an equivalent
top-level limit on the planned RelNode (addFetchSizeLimit), using the same
relBuilder.limit primitive that `head` lowers to. fetchSize <= 0 keeps the
prior "system default" behavior; the SQL path (separate cursor-based fetch_size)
is unchanged.
Before/after (CalcitePPLFetchSizeIT-equivalent, analytics-engine route):
before: 9/19 pass (10 fail — fetch_size ignored, full set returned)
after: 19/19 pass
Signed-off-by: Kai Huang <ahkcs@amazon.com>
* chore: spotlessApply on RestUnifiedQueryAction (javadoc reflow + signature wrap)
Signed-off-by: Kai Huang <ahkcs@amazon.com>
---------
Signed-off-by: Kai Huang <ahkcs@amazon.com>1 parent 08d8ba1 commit 7dca5cc
2 files changed
Lines changed: 24 additions & 2 deletions
File tree
- plugin/src/main/java/org/opensearch/sql/plugin
- rest
- transport
Lines changed: 23 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
152 | 152 | | |
153 | 153 | | |
154 | 154 | | |
155 | | - | |
| 155 | + | |
156 | 156 | | |
157 | 157 | | |
158 | 158 | | |
159 | 159 | | |
160 | 160 | | |
161 | 161 | | |
162 | 162 | | |
| 163 | + | |
163 | 164 | | |
164 | 165 | | |
165 | 166 | | |
166 | | - | |
| 167 | + | |
167 | 168 | | |
168 | 169 | | |
169 | 170 | | |
170 | 171 | | |
171 | 172 | | |
172 | 173 | | |
| 174 | + | |
173 | 175 | | |
174 | 176 | | |
175 | 177 | | |
| |||
193 | 195 | | |
194 | 196 | | |
195 | 197 | | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
196 | 202 | | |
197 | 203 | | |
198 | 204 | | |
| |||
339 | 345 | | |
340 | 346 | | |
341 | 347 | | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
342 | 363 | | |
343 | 364 | | |
344 | 365 | | |
| |||
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
189 | 189 | | |
190 | 190 | | |
191 | 191 | | |
| 192 | + | |
192 | 193 | | |
193 | 194 | | |
194 | 195 | | |
| |||
0 commit comments