Skip to content

Commit

Permalink
fix case
Browse files Browse the repository at this point in the history
  • Loading branch information
starocean999 committed Aug 16, 2024
1 parent b4d6e2f commit 5805433
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,7 @@ private Pair<LogicalPlan, Optional<Expression>> subqueryToApply(
}

if (!ctx.subqueryIsAnalyzed(subqueryExpr)) {
tmpPlan = addApply(subqueryExpr, childPlan,
tmpPlan = addApply(subqueryExpr, tmpPlan.first,
subqueryToMarkJoinSlot, ctx, conjunct,
isProject, subqueryExprs.size() == 1, isMarkJoinSlotNotNull);
}
Expand Down Expand Up @@ -410,6 +410,7 @@ private Pair<LogicalPlan, Optional<Expression>> addApply(SubqueryExpr subquery,
Slot anyValueSlot = null;
Optional<Expression> newConjunct = conjunct;
if (needAddScalarSubqueryOutputToProjects && subquery instanceof ScalarSubquery
&& !subquery.getCorrelateSlots().isEmpty()
&& !((ScalarSubquery) subquery).hasTopLevelScalarAgg()) {
// if scalar subquery doesn't have top level scalar agg we will create one, for example
// select (select t2.c1 from t2 where t2.c2 = t1.c2) from t1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,8 @@

import java.util.ArrayList;
import java.util.Collection;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;

/**
* Common interface for logical/physical project.
Expand Down Expand Up @@ -65,15 +63,15 @@ default Map<Slot, Expression> getAliasToProducer() {
* @return project list for merged project
*/
default List<NamedExpression> mergeProjections(Project childProject) {
Set<NamedExpression> projects = new HashSet<>();
List<NamedExpression> projects = new ArrayList<>();
projects.addAll(PlanUtils.mergeProjections(childProject.getProjects(), getProjects()));
for (NamedExpression expression : childProject.getProjects()) {
// keep NoneMovableFunction for later use
if (expression.containsType(NoneMovableFunction.class)) {
projects.add(expression);
}
}
return new ArrayList<>(projects);
return projects;
}

/**
Expand Down

0 comments on commit 5805433

Please sign in to comment.