Skip to content

Commit

Permalink
use groupExpr children to make logicalPlan
Browse files Browse the repository at this point in the history
  • Loading branch information
keanji-x committed Jul 13, 2023
1 parent 77336bf commit 8b8a9bc
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ private void makeLogicalExpression(Group root) {
}
hasGenerated.add(groupExpression);

// process child first
// process child first, plan's child may be changed due to mergeGroup
Plan physicalPlan = groupExpression.getPlan();
for (Group child : groupExpression.children()) {
makeLogicalExpression(child);
Expand All @@ -316,12 +316,12 @@ private void makeLogicalExpression(Group root) {
if (physicalPlan instanceof PhysicalProject) {
PhysicalProject physicalProject = (PhysicalProject) physicalPlan;
logicalPlan = new LogicalProject<>(physicalProject.getProjects(),
physicalProject.child(0));
new GroupPlan(groupExpression.child(0)));
} else if (physicalPlan instanceof AbstractPhysicalJoin) {
AbstractPhysicalJoin physicalJoin = (AbstractPhysicalJoin) physicalPlan;
logicalPlan = new LogicalJoin<>(physicalJoin.getJoinType(), physicalJoin.getHashJoinConjuncts(),
physicalJoin.getOtherJoinConjuncts(), JoinHint.NONE, physicalJoin.getMarkJoinSlotReference(),
physicalJoin.children());
groupExpression.children().stream().map(g -> new GroupPlan(g)).collect(Collectors.toList()));
} else {
throw new RuntimeException("DPhyp can only handle join and project operator");
}
Expand Down

0 comments on commit 8b8a9bc

Please sign in to comment.