Skip to content

Commit 84dd8d5

Browse files
author
Stas Malyshev
committed
Move is_partial to the top dir
Also fix the build
1 parent 2bfad31 commit 84dd8d5

File tree

7 files changed

+10
-9
lines changed

7 files changed

+10
-9
lines changed

docs/reference/esql/esql-across-clusters.asciidoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,7 @@ Which returns:
210210
{
211211
"is_running": false,
212212
"took": 42, <1>
213+
"is_partial": false, <7>
213214
"columns" : [
214215
{
215216
"name" : "COUNT(http.response.status_code)",
@@ -231,7 +232,6 @@ Which returns:
231232
"skipped": 0,
232233
"partial": 0,
233234
"failed": 0,
234-
"is_partial": false, <7>
235235
"details": { <3>
236236
"(local)": { <4>
237237
"status": "successful",
@@ -318,6 +318,7 @@ Which returns:
318318
{
319319
"is_running": false,
320320
"took": 55,
321+
"is_partial": false,
321322
"columns": [
322323
... // not shown
323324
],
@@ -331,7 +332,6 @@ Which returns:
331332
"skipped": 0,
332333
"partial": 0,
333334
"failed": 0,
334-
"is_partial": false,
335335
"details": {
336336
"cluster_one": {
337337
"status": "successful",

docs/reference/esql/esql-async-query-stop-api.asciidoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,15 @@
1010
For the most up-to-date API details, refer to {api-es}/group/endpoint-esql[ES|QL APIs].
1111
--
1212

13-
The <<esql,{esql}>> async query stop API is used to manually stop an async query. Once stop command is issued,
13+
The <<esql,{esql}>> async query stop API is used to manually stop an async query. Once the stop command is issued,
1414
the query stops processing new data and returns the results that have been already processed. Note that due to the pipelined
1515
nature of {esql} queries, the stop operation is not immediate and may take time to return results.
1616

1717
The results are returned in <<esql-query-api-response-body,the same format>> as for
1818
<<esql-async-query-get-api,{esql} async query get API>>.
1919
If the query has been finished by the time the stop command is issued, the results are returned immediately.
2020

21-
If the query processing has not been finished by the time the stop command is issued, the result data will have
21+
If the query processing has not finished by the time the stop command is issued, the response will have
2222
`is_partial` field set to `true`.
2323

2424
[source,console]

x-pack/plugin/esql/qa/server/multi-clusters/src/javaRestTest/java/org/elasticsearch/xpack/esql/ccq/MultiClustersIT.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -272,9 +272,9 @@ private void assertClusterDetailsMap(Map<String, Object> result, boolean remoteO
272272
assertThat(clusters.get("skipped"), equalTo(0));
273273
assertThat(clusters.get("partial"), equalTo(0));
274274
assertThat(clusters.get("failed"), equalTo(0));
275-
if (clusters.containsKey("is_partial")) {
275+
if (result.containsKey("is_partial")) {
276276
// for some BWC tests, the is_partial key may not be present
277-
assertThat(clusters.get("is_partial"), equalTo(false));
277+
assertThat(result.get("is_partial"), equalTo(false));
278278
}
279279

280280
@SuppressWarnings("unchecked")

x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/action/EsqlExecutionInfo.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,6 @@ public Iterator<? extends ToXContent> toXContentChunked(ToXContent.Params params
259259
ChunkedToXContentHelper.field(SKIPPED_FIELD.getPreferredName(), getClusterStateCount(Cluster.Status.SKIPPED)),
260260
ChunkedToXContentHelper.field(PARTIAL_FIELD.getPreferredName(), getClusterStateCount(Cluster.Status.PARTIAL)),
261261
ChunkedToXContentHelper.field(FAILED_FIELD.getPreferredName(), getClusterStateCount(Cluster.Status.FAILED)),
262-
ChunkedToXContentHelper.field(IS_PARTIAL_FIELD.getPreferredName(), isPartial),
263262
// each Cluster object defines its own field object name
264263
ChunkedToXContentHelper.object("details", clusterInfo.values().iterator()),
265264
ChunkedToXContentHelper.endObject()

x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/action/EsqlQueryResponse.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,7 @@ public Iterator<? extends ToXContent> toXContentChunked(ToXContent.Params params
208208
if (executionInfo != null && executionInfo.overallTook() != null) {
209209
tookTime = ChunkedToXContentHelper.chunk((builder, p) -> {
210210
builder.field("took", executionInfo.overallTook().millis());
211+
builder.field(EsqlExecutionInfo.IS_PARTIAL_FIELD.getPreferredName(), executionInfo.isPartial());
211212
return builder;
212213
});
213214
} else {

x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/plugin/ComputeService.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ public class ComputeService {
7777
private final AtomicLong childSessionIdGenerator = new AtomicLong();
7878
private final DataNodeComputeHandler dataNodeComputeHandler;
7979
private final ClusterComputeHandler clusterComputeHandler;
80+
private final ExchangeService exchangeService;
8081

8182
@SuppressWarnings("this-escape")
8283
public ComputeService(
@@ -107,6 +108,7 @@ public ComputeService(
107108
esqlExecutor,
108109
dataNodeComputeHandler
109110
);
111+
this.exchangeService = exchangeService;
110112
}
111113

112114
public void execute(

x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/action/EsqlQueryResponseTests.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -527,7 +527,6 @@ public static int clusterDetailsSize(int numClusters) {
527527
"skipped" : 0,
528528
"partial" : 0,
529529
"failed" : 0,
530-
"is_partial": false,
531530
"details" : {
532531
"(local)" : {
533532
"status" : "successful",
@@ -554,7 +553,7 @@ public static int clusterDetailsSize(int numClusters) {
554553
}
555554
}
556555
*/
557-
return numClusters * 4 + 7;
556+
return numClusters * 4 + 6;
558557
}
559558

560559
public void testChunkResponseSizeColumnar() {

0 commit comments

Comments
 (0)