Skip to content

Commit 1ad6dbc

Browse files
authored
ESQL: More specific index pattern in testMultipleBatchesWithLookupJoin (#130006)
* 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. * Remove column count validation That doesn't really tell us much in this test, anyway.
1 parent 1e9db8b commit 1ad6dbc

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

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

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1014,21 +1014,22 @@ 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(
1023+
format(null, "from {},no_sort_field_idx* | lookup join {} on integer {}", testIndexName(), testIndexName(), sort)
1024+
);
10231025
Map<String, Object> result = runEsql(query);
10241026
var columns = as(result.get("columns"), List.class);
1025-
assertEquals(22, columns.size());
10261027
var values = as(result.get("values"), List.class);
10271028
assertEquals(10, values.size());
10281029
}
10291030
// clean up
10301031
for (int i = 1; i <= 20; i++) {
1031-
assertThat(deleteIndex("idx" + i).isAcknowledged(), is(true));
1032+
assertThat(deleteIndex("no_sort_field_idx" + i).isAcknowledged(), is(true));
10321033
}
10331034
}
10341035

0 commit comments

Comments
 (0)