Skip to content

Commit 39141cc

Browse files
committed
Oops shouldn't delete that
1 parent 0bacef5 commit 39141cc

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

x-pack/plugin/esql/src/internalClusterTest/java/org/elasticsearch/xpack/esql/action/CrossClusterQueryWithPartialResultsIT.java

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,32 @@ public void testPartialResults() throws Exception {
135135
}
136136
}
137137

138+
public void testOneRemoteClusterPartial() throws Exception {
139+
populateIndices();
140+
EsqlQueryRequest request = new EsqlQueryRequest();
141+
request.query("FROM ok*,cluster-a:ok*,*-b:fail* | KEEP id, fail_me");
142+
request.allowPartialResults(true);
143+
request.includeCCSMetadata(randomBoolean());
144+
try (var resp = runQuery(request)) {
145+
assertTrue(resp.isPartial());
146+
Set<String> allIds = Stream.of(local.okIds, remote1.okIds).flatMap(Collection::stream).collect(Collectors.toSet());
147+
List<List<Object>> rows = getValuesList(resp);
148+
assertThat(rows.size(), equalTo(allIds.size()));
149+
Set<String> returnedIds = new HashSet<>();
150+
for (List<Object> row : rows) {
151+
assertThat(row.size(), equalTo(2));
152+
String id = (String) row.get(0);
153+
assertTrue(returnedIds.add(id));
154+
}
155+
assertThat(returnedIds, equalTo(allIds));
156+
157+
assertClusterSuccess(resp, LOCAL_CLUSTER, local.okShards);
158+
assertClusterSuccess(resp, REMOTE_CLUSTER_1, remote1.okShards);
159+
assertClusterPartial(resp, REMOTE_CLUSTER_2, remote2.failingShards, 0);
160+
assertClusterFailure(resp, REMOTE_CLUSTER_2, "Accessing failing field");
161+
}
162+
}
163+
138164
public void testLocalIndexMissing() throws Exception {
139165
populateIndices();
140166
EsqlQueryRequest request = new EsqlQueryRequest();

0 commit comments

Comments
 (0)