diff --git a/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/optimizer/PhysicalPlanOptimizerTests.java b/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/optimizer/PhysicalPlanOptimizerTests.java index 6850e052eda9e..3464e2e74217a 100644 --- a/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/optimizer/PhysicalPlanOptimizerTests.java +++ b/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/optimizer/PhysicalPlanOptimizerTests.java @@ -7759,7 +7759,6 @@ public void testLookupJoinFieldLoadingTwoLookups() throws Exception { assertLookupJoinFieldNames(query, data, List.of(Set.of("bar", "baz"), Set.of("foo", "bar2", "baz2"))); } - @AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/119082") public void testLookupJoinFieldLoadingTwoLookupsProjectInBetween() throws Exception { assumeTrue("Requires LOOKUP JOIN", EsqlCapabilities.Cap.JOIN_LOOKUP_V12.isEnabled()); @@ -7788,7 +7787,7 @@ public void testLookupJoinFieldLoadingTwoLookupsProjectInBetween() throws Except | LOOKUP JOIN lookup_index2 ON first_name | DROP b* """; - assertLookupJoinFieldNames(query, data, List.of(Set.of("foo"), Set.of("foo"))); + assertLookupJoinFieldNames(query, data, List.of(Set.of(), Set.of("foo"))); query = """ FROM test @@ -7800,7 +7799,6 @@ public void testLookupJoinFieldLoadingTwoLookupsProjectInBetween() throws Except assertLookupJoinFieldNames(query, data, List.of(Set.of("baz"), Set.of("foo", "baz2"))); } - @AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/118778") public void testLookupJoinFieldLoadingDropAllFields() throws Exception { assumeTrue("Requires LOOKUP JOIN", EsqlCapabilities.Cap.JOIN_LOOKUP_V12.isEnabled()); @@ -7841,7 +7839,7 @@ private void assertLookupJoinFieldNames( assertEquals(expectedFieldNames.size(), fields.size()); for (int i = 0; i < expectedFieldNames.size(); i++) { - assertEquals(expectedFieldNames.get(i), fields.get(i)); + assertThat(fields.get(i), equalTo(expectedFieldNames.get(i))); } } @@ -7920,10 +7918,14 @@ private List> findFieldNamesInLookupJoinDescription(LocalExecutionPl var matcher = expected.matcher(line); if (matcher.find()) { String allFields = matcher.group(1); - Set loadedFields = Arrays.stream(allFields.split(",")) - .map(name -> name.trim().split("\\{f}#")[0]) - .collect(Collectors.toSet()); - results.add(loadedFields); + if (allFields.isEmpty()) { + results.add(Set.of()); + } else { + Set loadedFields = Arrays.stream(allFields.split(",")) + .map(name -> name.trim().split("\\{f}#")[0]) + .collect(Collectors.toSet()); + results.add(loadedFields); + } } }