Skip to content

Commit

Permalink
Simplify adding child to parallel node
Browse files Browse the repository at this point in the history
  • Loading branch information
AndrewSisley committed Feb 12, 2024
1 parent 625ab14 commit cae8436
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions planner/multi.go
Original file line number Diff line number Diff line change
Expand Up @@ -234,22 +234,16 @@ func (s *selectNode) addSubPlan(fieldIndex int, newPlan planNode) error {
// we already have an existing parallelNode as our source
case *parallelNode:
switch newPlan.(type) {
// easy, just append, since append doest need any internal relaced scannode
case *dagScanNode:
sourceNode.addChild(fieldIndex, newPlan)

// We have a internal multiscanNode on our MultiNode
case *scanNode, *typeIndexJoin:
// replace our new node internal scanNode with our existing multiscanner
if err := s.planner.walkAndReplacePlan(newPlan, sourceNode.multiscan.Source(), sourceNode.multiscan); err != nil {
return err
}
sourceNode.multiscan.addReader()
// add our newly updated plan to the multinode
sourceNode.addChild(fieldIndex, newPlan)
default:
return client.NewErrUnhandledType("sub plan", newPlan)
}

sourceNode.addChild(fieldIndex, newPlan)
}
return nil
}

0 comments on commit cae8436

Please sign in to comment.