You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/optimizer/rules/physical/ProjectAwayColumns.java
+7-4Lines changed: 7 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -62,13 +62,16 @@ public PhysicalPlan apply(PhysicalPlan plan) {
62
62
for (Attributeattribute : logicalFragment.output()) {
63
63
if (requiredAttributes.get().contains(attribute)) {
64
64
output.add(attribute);
65
-
requiredAttributes.get().remove(attribute);
66
65
}
67
66
}
68
-
// requiredAttrBuilder should be empty unless the plan is inconsistent due to a bug.
69
-
// This can happen in case of remote ENRICH, see https://github.com/elastic/elasticsearch/issues/118531
67
+
// requiredAttributes should only have attributes that are also in the fragment's output.
68
+
// This assumption can be wrong in case of remote ENRICH, see https://github.com/elastic/elasticsearch/issues/118531
70
69
// TODO: stop adding the remaining required attributes once remote ENRICH is fixed.
71
-
output.addAll(requiredAttributes.get());
70
+
if (output.size() != requiredAttributes.get().size()) {
0 commit comments