99import org .elasticsearch .common .io .stream .NamedWriteableRegistry ;
1010import org .elasticsearch .common .io .stream .StreamInput ;
1111import org .elasticsearch .common .io .stream .StreamOutput ;
12- import org .elasticsearch .xpack .esql .capabilities .PostAnalysisVerificationAware ;
1312import org .elasticsearch .xpack .esql .capabilities .TelemetryAware ;
14- import org .elasticsearch .xpack .esql .common .Failures ;
1513import org .elasticsearch .xpack .esql .core .expression .Attribute ;
1614import org .elasticsearch .xpack .esql .core .tree .NodeInfo ;
1715import org .elasticsearch .xpack .esql .core .tree .Source ;
2119import java .util .List ;
2220import java .util .Objects ;
2321
24- public class Subquery extends UnaryPlan implements PostAnalysisVerificationAware , TelemetryAware , SortAgnostic {
22+ public class Subquery extends UnaryPlan implements TelemetryAware , SortAgnostic {
2523 public static final NamedWriteableRegistry .Entry ENTRY = new NamedWriteableRegistry .Entry (LogicalPlan .class , "Subquery" , Subquery ::new );
2624
2725 // subquery alias/qualifier could be added in the future if needed
@@ -30,7 +28,6 @@ public Subquery(Source source, LogicalPlan subqueryPlan) {
3028 super (source , subqueryPlan );
3129 }
3230
33- // TODO does Subquery need to be Serializable?
3431 private Subquery (StreamInput in ) throws IOException {
3532 this (Source .readFrom ((PlanStreamInput ) in ), in .readNamedWriteable (LogicalPlan .class ));
3633 }
@@ -63,7 +60,6 @@ public List<Attribute> output() {
6360
6461 @ Override
6562 public boolean expressionsResolved () {
66- // TODO add if needed
6763 return true ;
6864 }
6965
@@ -91,30 +87,7 @@ public String nodeString() {
9187 return nodeName () + "[]" ;
9288 }
9389
94- @ Override
95- public void postAnalysisVerification (Failures failures ) {
96- // TODO add verification if needed
97- }
98-
9990 public LogicalPlan plan () {
10091 return child ();
10192 }
102-
103- public boolean canMerge () {
104- // if the subquery contains from/eval/where/subquery, it can be merged
105- LogicalPlan child = child ();
106- if (child instanceof UnionAll unionAll ) {
107- for (LogicalPlan subPlan : unionAll .children ()) {
108- if (canMerge (subPlan ) == false ) {
109- return false ;
110- }
111- }
112- }
113- return true ;
114- }
115-
116- // more plan types could be added if needed, non-pipeline breakers
117- private boolean canMerge (LogicalPlan plan ) {
118- return plan instanceof Subquery || plan instanceof Filter || plan instanceof EsRelation ;
119- }
12093}
0 commit comments