Skip to content

Commit c42c0f8

Browse files
Add integration test for LOOKUP JOIN on remotes after STATS
1 parent d5fa4e6 commit c42c0f8

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

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

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -284,6 +284,23 @@ public void testLookupJoinMissingLocalIndex() throws IOException {
284284
}
285285
}
286286

287+
public void testLookupJoinMissingLocalIndexAfterPipelineBreaker() throws IOException {
288+
setupClusters(2);
289+
populateLookupIndex(REMOTE_CLUSTER_1, "values_lookup", 10);
290+
291+
var ex = expectThrows(
292+
VerificationException.class,
293+
() -> runQuery(
294+
"FROM c*:logs-* | EVAL lookup_key = v | STATS lookup_key = max(lookup_key) | LOOKUP JOIN values_lookup ON lookup_key",
295+
randomBoolean()
296+
)
297+
);
298+
assertThat(
299+
ex.getMessage(),
300+
containsString("LOOKUP JOIN with remote indices can't be executed after [STATS lookup_key = max(lookup_key)]")
301+
);
302+
}
303+
287304
public void testLookupJoinMissingKey() throws IOException {
288305
setupClusters(2);
289306
populateLookupIndex(LOCAL_CLUSTER, "values_lookup", 10);

0 commit comments

Comments
 (0)