Break isResolvedScalarSubquery into smaller methods
This will enable iterative optimizer performing an isResolvedScalarSubquery check using lookup
@@ -85,12 +85,17 @@ public class ApplyNode
this.correlation = ImmutableList.copyOf(correlation);
}
+ public boolean isResolvedScalarSubquery()
+ {
+ return isScalar(subquery) && isSubqueryResolved();
+ }
+
/**
- * @return true when subquery is scalar and it's output symbols are directly mapped to ApplyNode output symbols
+ * @return true if output symbols of subquery are directly mapped to ApplyNode output symbols
*/
- public boolean isResolvedScalarSubquery()
+ public boolean isSubqueryResolved()
{
- return isScalar(subquery) && subqueryAssignments.getExpressions().stream()
+ return subqueryAssignments.getExpressions().stream()
.allMatch(expression -> expression instanceof SymbolReference);
}
