Skip to content

Commit e6a055b

Browse files
add EsqlCapabilities to skip tests on older versions that don't have this fix
1 parent 2a21697 commit e6a055b

File tree

3 files changed

+12
-2
lines changed

3 files changed

+12
-2
lines changed

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -987,6 +987,10 @@ public void testDoubleParamsWithLookupJoin() throws IOException {
987987
}
988988

989989
public void testMultipleBatchesWithLookupJoin() throws IOException {
990+
assumeTrue(
991+
"Requires new null alias ids for join with multiple batches",
992+
EsqlCapabilities.Cap.REPLACE_MISSING_FIELD_WITH_NULL_NEW_ALIAS_ID_FOR_JOIN_AND_MULTIPLE_BATCHES.isEnabled()
993+
);
990994
// Create more than 10 indices to trigger multiple batches of data node execution.
991995
// The sort field should be missing on some indices to reproduce NullPointerException caused by duplicated items in layout
992996
for (int i = 1; i <= 20; i++) {

x-pack/plugin/esql/qa/testFixtures/src/main/resources/lookup-join.csv-spec

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1456,9 +1456,10 @@ emp_no:integer | language_code:integer | language_name:keyword
14561456
multipleBatches
14571457
required_capability: join_lookup_v12
14581458
required_capability: remove_redundant_sort
1459+
required_capability: replace_missing_field_with_null_new_alias_id_for_join_and_multiple_batches
14591460

14601461
from *
1461-
| rename city.country.continent.planet.name as message
1462+
| rename city.country.continent.planet.name as message
14621463
| lookup join message_types_lookup on message
14631464
| sort language_code, birth_date
14641465
| keep birth_date

x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/action/EsqlCapabilities.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -912,7 +912,12 @@ public enum Cap {
912912
/**
913913
* The metrics command
914914
*/
915-
METRICS_COMMAND(Build.current().isSnapshot());
915+
METRICS_COMMAND(Build.current().isSnapshot()),
916+
917+
/**
918+
* Create null alias with new id in ReplaceMissingFieldWithNull when there is lookup join with multiple batches.
919+
*/
920+
REPLACE_MISSING_FIELD_WITH_NULL_NEW_ALIAS_ID_FOR_JOIN_AND_MULTIPLE_BATCHES;
916921

917922
private final boolean enabled;
918923

0 commit comments

Comments
 (0)