Skip to content

Commit

Permalink
Remove Source misdirection and cast
Browse files Browse the repository at this point in the history
  • Loading branch information
AndrewSisley committed Feb 12, 2024
1 parent 936300a commit 625ab14
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions planner/multi.go
Original file line number Diff line number Diff line change
Expand Up @@ -240,16 +240,11 @@ func (s *selectNode) addSubPlan(fieldIndex int, newPlan planNode) error {

// We have a internal multiscanNode on our MultiNode
case *scanNode, *typeIndexJoin:
multiscan, sourceIsMultiscan := sourceNode.Source().(*multiScanNode)
if !sourceIsMultiscan {
return client.NewErrUnexpectedType[*multiScanNode]("mergeNode", sourceNode.Source())
}

// replace our new node internal scanNode with our existing multiscanner
if err := s.planner.walkAndReplacePlan(newPlan, multiscan.Source(), multiscan); err != nil {
if err := s.planner.walkAndReplacePlan(newPlan, sourceNode.multiscan.Source(), sourceNode.multiscan); err != nil {
return err
}
multiscan.addReader()
sourceNode.multiscan.addReader()
// add our newly updated plan to the multinode
sourceNode.addChild(fieldIndex, newPlan)
default:
Expand Down

0 comments on commit 625ab14

Please sign in to comment.