Skip to content

Commit 8367062

Browse files
committed
Specific idx in testMultipleBatchesWithLookupJoin
Do not use `from *` in the test, be more specifc - otherwise other tests can affect the output if they leave indices behind, affecting the column count.
1 parent 87e6c74 commit 8367062

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

x-pack/plugin/esql/qa/server/src/main/java/org/elasticsearch/xpack/esql/qa/rest/RestEsqlTestCase.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1014,12 +1014,12 @@ public void testMultipleBatchesWithLookupJoin() throws IOException {
10141014
// Create more than 10 indices to trigger multiple batches of data node execution.
10151015
// The sort field should be missing on some indices to reproduce NullPointerException caused by duplicated items in layout
10161016
for (int i = 1; i <= 20; i++) {
1017-
createIndex("idx" + i, randomBoolean(), "\"mappings\": {\"properties\" : {\"a\" : {\"type\" : \"keyword\"}}}");
1017+
createIndex("no_sort_field_idx" + i, randomBoolean(), "\"mappings\": {\"properties\" : {\"a\" : {\"type\" : \"keyword\"}}}");
10181018
}
10191019
bulkLoadTestDataLookupMode(10);
10201020
// lookup join with and without sort
10211021
for (String sort : List.of("", "| sort integer")) {
1022-
var query = requestObjectBuilder().query(format(null, "from * | lookup join {} on integer {}", testIndexName(), sort));
1022+
var query = requestObjectBuilder().query(format(null, "from {},no_sort_field_idx* | lookup join {} on integer {}", testIndexName(), testIndexName(), sort));
10231023
Map<String, Object> result = runEsql(query);
10241024
var columns = as(result.get("columns"), List.class);
10251025
assertEquals(22, columns.size());
@@ -1028,7 +1028,7 @@ public void testMultipleBatchesWithLookupJoin() throws IOException {
10281028
}
10291029
// clean up
10301030
for (int i = 1; i <= 20; i++) {
1031-
assertThat(deleteIndex("idx" + i).isAcknowledged(), is(true));
1031+
assertThat(deleteIndex("no_sort_field_idx" + i).isAcknowledged(), is(true));
10321032
}
10331033
}
10341034

0 commit comments

Comments
 (0)