File tree Expand file tree Collapse file tree 1 file changed +5
-10
lines changed
x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/session Expand file tree Collapse file tree 1 file changed +5
-10
lines changed Original file line number Diff line number Diff 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 ;
You can’t perform that action at this time.
0 commit comments