Skip to content

Commit 401c50d

Browse files
committed
itr
1 parent da136b4 commit 401c50d

File tree

1 file changed

+5
-10
lines changed
  • x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/session

1 file changed

+5
-10
lines changed

x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/session/EsqlSession.java

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -282,18 +282,13 @@ private void executeSubPlan(
282282
.map(FragmentExec.class::cast)
283283
.anyMatch(fragmentExec -> fragmentExec.fragment() == tuple.logical);
284284
if (changed) {
285-
List<PhysicalPlan> newSubPlans = new ArrayList<>(m.children());
286-
for (int i = 0; i < newSubPlans.size(); i++) {
287-
var subPlan = newSubPlans.get(i);
285+
List<PhysicalPlan> newSubPlans = m.children().stream().map(subPlan -> {
288286
if (subPlan instanceof FragmentExec fe && fe.fragment() == tuple.logical) {
289-
var resultsExec = new LocalSourceExec(
290-
resultWrapper.source(),
291-
resultWrapper.output(),
292-
resultWrapper.supplier()
293-
);
294-
newSubPlans.set(i, resultsExec);
287+
return new LocalSourceExec(resultWrapper.source(), resultWrapper.output(), resultWrapper.supplier());
288+
} else {
289+
return subPlan;
295290
}
296-
}
291+
}).toList();
297292
return new MergeExec(m.source(), newSubPlans, m.output());
298293
}
299294
return m;

0 commit comments

Comments
 (0)