Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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());

Expand Down Expand Up @@ -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")));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍


query = """
FROM test
Expand All @@ -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());

Expand Down Expand Up @@ -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)));
}
}

Expand Down Expand Up @@ -7920,10 +7918,14 @@ private List<Set<String>> findFieldNamesInLookupJoinDescription(LocalExecutionPl
var matcher = expected.matcher(line);
if (matcher.find()) {
String allFields = matcher.group(1);
Set<String> loadedFields = Arrays.stream(allFields.split(","))
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was wrong - for [] it produced Set.of("") not empty set.

.map(name -> name.trim().split("\\{f}#")[0])
.collect(Collectors.toSet());
results.add(loadedFields);
if (allFields.isEmpty()) {
results.add(Set.of());
} else {
Set<String> loadedFields = Arrays.stream(allFields.split(","))
.map(name -> name.trim().split("\\{f}#")[0])
.collect(Collectors.toSet());
results.add(loadedFields);
}
}
}

Expand Down