Skip to content

Commit

Permalink
Handle subqueries through non-Expressions
Browse files Browse the repository at this point in the history
Let `handleSubqueries` find subqueries nested under `Expression`
nodes, linked via children not being `Expression`.
  • Loading branch information
kasiafi committed May 27, 2022
1 parent 73c4617 commit 2feacd6
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -144,9 +144,9 @@ public PlanBuilder handleSubqueries(PlanBuilder builder, Expression expression,
private <T extends Expression> List<T> selectSubqueries(PlanBuilder subPlan, Expression parent, List<T> candidates)
{
SuccessorsFunction<Node> recurse = expression -> {
if (expression instanceof Expression &&
!analysis.isColumnReference((Expression) expression) && // no point in following dereference chains
!subPlan.canTranslate((Expression) expression)) { // don't consider subqueries under parts of the expression that have already been handled
if (!(expression instanceof Expression) ||
(!analysis.isColumnReference((Expression) expression) && // no point in following dereference chains
!subPlan.canTranslate((Expression) expression))) { // don't consider subqueries under parts of the expression that have already been handled
return expression.getChildren();
}

Expand Down

0 comments on commit 2feacd6

Please sign in to comment.