Skip to content

Commit 2735a21

Browse files
authored
ESQL: More specific index pattern in testMultipleBatchesWithLookupJoin (#130006) (#130116)
* 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 e867dcd commit 2735a21

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
@@ -1008,21 +1008,22 @@ public void testMultipleBatchesWithLookupJoin() throws IOException {
10081008
// Create more than 10 indices to trigger multiple batches of data node execution.
10091009
// The sort field should be missing on some indices to reproduce NullPointerException caused by duplicated items in layout
10101010
for (int i = 1; i <= 20; i++) {
1011-
createIndex("idx" + i, randomBoolean(), "\"mappings\": {\"properties\" : {\"a\" : {\"type\" : \"keyword\"}}}");
1011+
createIndex("no_sort_field_idx" + i, randomBoolean(), "\"mappings\": {\"properties\" : {\"a\" : {\"type\" : \"keyword\"}}}");
10121012
}
10131013
bulkLoadTestDataLookupMode(10);
10141014
// lookup join with and without sort
10151015
for (String sort : List.of("", "| sort integer")) {
1016-
var query = requestObjectBuilder().query(format(null, "from * | lookup join {} on integer {}", testIndexName(), sort));
1016+
var query = requestObjectBuilder().query(
1017+
format(null, "from {},no_sort_field_idx* | lookup join {} on integer {}", testIndexName(), testIndexName(), sort)
1018+
);
10171019
Map<String, Object> result = runEsql(query);
10181020
var columns = as(result.get("columns"), List.class);
1019-
assertEquals(22, columns.size());
10201021
var values = as(result.get("values"), List.class);
10211022
assertEquals(10, values.size());
10221023
}
10231024
// clean up
10241025
for (int i = 1; i <= 20; i++) {
1025-
assertThat(deleteIndex("idx" + i).isAcknowledged(), is(true));
1026+
assertThat(deleteIndex("no_sort_field_idx" + i).isAcknowledged(), is(true));
10261027
}
10271028
}
10281029

0 commit comments

Comments
 (0)