File tree Expand file tree Collapse file tree 3 files changed +15
-3
lines changed
compute/src/main/java/org/elasticsearch/compute/operator
src/main/java/org/elasticsearch/xpack/esql/plan/logical Expand file tree Collapse file tree 3 files changed +15
-3
lines changed Original file line number Diff line number Diff line change 1616import java .util .ListIterator ;
1717import java .util .function .Supplier ;
1818
19+ /**
20+ * A merge operator is effectively a "fan-in" operator - accepts input
21+ * from several sources and provides it in a single output.
22+ */
1923public class MergeOperator extends SourceOperator {
2024
2125 private final BlockFactory blockFactory ;
@@ -76,7 +80,7 @@ public Page getOutput() {
7680
7781 @ Override
7882 public void close () {
79- // The blocks are closable by the other exchange? so we have to copy them
83+ // release blocks from any subplan not fully consumed.
8084 if (subPlanBlocks != null ) {
8185 while (subPlanBlocks .hasNext ()) {
8286 Releasables .close (subPlanBlocks .next ());
Original file line number Diff line number Diff line change 1010import org .elasticsearch .common .io .stream .NamedWriteableRegistry ;
1111import org .elasticsearch .common .io .stream .StreamInput ;
1212import org .elasticsearch .common .io .stream .StreamOutput ;
13- import org .elasticsearch .xpack .esql .core .expression .Attribute ;
1413import org .elasticsearch .xpack .esql .core .tree .NodeInfo ;
1514import org .elasticsearch .xpack .esql .core .tree .Source ;
1615import org .elasticsearch .xpack .esql .io .stream .PlanStreamInput ;
1918import java .util .List ;
2019import java .util .Objects ;
2120
21+ /**
22+ * A Fork is a {@code Plan} with one child, but holds several logical subplans, e.g.
23+ * {@code FORK [WHERE content:"fox" ] [WHERE content:"dog"] }
24+ */
2225public class Fork extends UnaryPlan {
2326 public static final NamedWriteableRegistry .Entry ENTRY = new NamedWriteableRegistry .Entry (LogicalPlan .class , "Fork" , Fork ::new );
27+
2428 private final List <LogicalPlan > subPlans ;
25- private List <Attribute > lazyOutput ;
2629
2730 public Fork (Source source , LogicalPlan child , List <LogicalPlan > subPlans ) {
2831 super (source , child );
Original file line number Diff line number Diff line change 1919import java .util .List ;
2020import java .util .Objects ;
2121
22+ /**
23+ * A Merge is a {@code LeafPlan}, which holds several logical subplans.
24+ */
2225public class Merge extends LeafPlan {
26+
2327 public static final NamedWriteableRegistry .Entry ENTRY = new NamedWriteableRegistry .Entry (LogicalPlan .class , "Merge" , Merge ::new );
28+
2429 private final List <LogicalPlan > subPlans ;
2530
2631 public Merge (Source source , List <LogicalPlan > subPlans ) {
You can’t perform that action at this time.
0 commit comments