@@ -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