Skip to content

Commit 70af095

Browse files
Add integration test for LOOKUP JOIN on remotes after STATS (#134127)
1 parent 258f7fe commit 70af095

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

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

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -284,6 +284,20 @@ 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+
expectThrows(
292+
VerificationException.class,
293+
containsString("LOOKUP JOIN with remote indices can't be executed after [STATS lookup_key = max(lookup_key)]"),
294+
() -> runQuery(
295+
"FROM c*:logs-* | EVAL lookup_key = v | STATS lookup_key = max(lookup_key) | LOOKUP JOIN values_lookup ON lookup_key",
296+
randomBoolean()
297+
)
298+
);
299+
}
300+
287301
public void testLookupJoinMissingKey() throws IOException {
288302
setupClusters(2);
289303
populateLookupIndex(LOCAL_CLUSTER, "values_lookup", 10);

0 commit comments

Comments
 (0)