mirror of
https://github.com/elastic/elasticsearch.git
synced 2025-06-27 17:10:22 -04:00
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.
This commit is contained in:
parent
1e9db8b248
commit
1ad6dbc599
1 changed files with 5 additions and 4 deletions
|
@ -1014,21 +1014,22 @@ public abstract class RestEsqlTestCase extends ESRestTestCase {
|
|||
// Create more than 10 indices to trigger multiple batches of data node execution.
|
||||
// The sort field should be missing on some indices to reproduce NullPointerException caused by duplicated items in layout
|
||||
for (int i = 1; i <= 20; i++) {
|
||||
createIndex("idx" + i, randomBoolean(), "\"mappings\": {\"properties\" : {\"a\" : {\"type\" : \"keyword\"}}}");
|
||||
createIndex("no_sort_field_idx" + i, randomBoolean(), "\"mappings\": {\"properties\" : {\"a\" : {\"type\" : \"keyword\"}}}");
|
||||
}
|
||||
bulkLoadTestDataLookupMode(10);
|
||||
// lookup join with and without sort
|
||||
for (String sort : List.of("", "| sort integer")) {
|
||||
var query = requestObjectBuilder().query(format(null, "from * | lookup join {} on integer {}", testIndexName(), sort));
|
||||
var query = requestObjectBuilder().query(
|
||||
format(null, "from {},no_sort_field_idx* | lookup join {} on integer {}", testIndexName(), testIndexName(), sort)
|
||||
);
|
||||
Map<String, Object> result = runEsql(query);
|
||||
var columns = as(result.get("columns"), List.class);
|
||||
assertEquals(22, columns.size());
|
||||
var values = as(result.get("values"), List.class);
|
||||
assertEquals(10, values.size());
|
||||
}
|
||||
// clean up
|
||||
for (int i = 1; i <= 20; i++) {
|
||||
assertThat(deleteIndex("idx" + i).isAcknowledged(), is(true));
|
||||
assertThat(deleteIndex("no_sort_field_idx" + i).isAcknowledged(), is(true));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue